LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   What is the coolest script you've made ? Any scripting language. (https://www.linuxquestions.org/questions/linux-general-1/what-is-the-coolest-script-youve-made-any-scripting-language-847700/)

H_TeXMeX_H 12-01-2010 08:54 AM

What is the coolest script you've made ? Any scripting language.
 
You don't have to post the script, but at least say what it does. You can post more than one.

Probably the coolest one I've made is a script to download from MU using the premium account I bought. It's cool because they don't provide Linux programs or support, yet I can still do everything with a simple script. I just list the download links in a text file and it downloads them automatically while I'm away, one by one. I made one with parallel downloads that downloads faster, but there is a chance of connection timeout for some reason, so I don't use it.

If you want I guess I can post the script, but I have to censor it because it contains my login info, but it's only 22 lines long.

The second coolest script is the burnit script, not as advanced as other burning scripts like bashburn, but it does exactly what I need and has never burned a coaster. It's on my site if you want it. Oh, and there's also the slackware update script I made, because slackupdate didn't work for 64-bit.

These are all bash scripts.

trey85stang 12-01-2010 09:17 AM

I dont have a copy of the script to post, but I wrote a bash script to download New Episodes of specified TV shows from a tivo series 3. It also decrypted the files, and encoded them to smaller xvid... the only thing I didn't like about it was commercials were kept.

eveningsky339 12-01-2010 05:30 PM

I wrote a bash script that could add 2 + 2, print the sum, and then say "Hello, World!"

I also wrote a Python script which created a backup of a directory in .zip format.

My skill level ends there.

H_TeXMeX_H 12-02-2010 02:51 AM

Quote:

Originally Posted by eveningsky339 (Post 4177551)
I wrote a bash script that could add 2 + 2, print the sum, and then say "Hello, World!"

I also wrote a Python script which created a backup of a directory in .zip format.

My skill level ends there.

Hmm, so you consider that a cool script ?

crts 12-02-2010 04:14 AM

A couple of weeks ago I wrote a script to automate my LFS build. It extracts all the commands from the XML file and puts the commands necessary to build a package in their own dedicated script. Afterwards you can run the script and save yourself some tedious typing.
I know, there are already scripts to automate an LFS build. However, it was a nice exercise.

linuxlover.chaitanya 12-02-2010 04:49 AM

No way near to you guys. Use scripting for certain daily routine tasks and all. Like backing up bugzilla database daily and some other small backup scripts and like. Nothing cool about them but they work. Most of them are in bash. Another that I wrote some time ago was a Perl script to open the squid log file, read and then analyse the logs and then create an html page from the data so that I could analyse it the time I need. it also calculated the number of hits to cache and those that had no cache hits and got the results from internet and calculated the amount of data downloaded and all. It was not cool. Just crude but it worked fine for me like I wanted. gave all the information I wanted in a single html page. And then I could keep as many html pages I wanted for future references as well. I dont know if I still the script or not. I do not use it any more. I am using sarg but I think my script was custom made so worked for me better.

szboardstretcher 12-02-2010 02:49 PM

I made a script once that would go through a directory of pictures, finding similar (resized or resampled) pics and renaming them to a similar filename. Allowing for easier deletion and sorting.

Good for going through and finding doubles of pictures -- that are nearly the same, but differently sized, or cropped, or filtered.

H_TeXMeX_H 12-02-2010 02:53 PM

I just wrote a script to convert other multimedia files to .avi with xvid and mp3. I will probably post it on my site soon. It's not as extensive as other scripts /programs for this purpose, but this is the way I encode these.

eveningsky339 12-02-2010 08:13 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 4177934)
Hmm, so you consider that a cool script ?

The Python one was kinda cool. I still use it from time to time, and maybe I will start exploring some more powerful compression formats.

Kenny_Strawn 12-02-2010 10:08 PM

Probably this. That said, others may have also come up with similar scripts.

BenCollver 12-02-2010 10:25 PM

I have written scripts in different languages, but do not frequently use them. One was a portable shell script to download files in batch. I scheduled it from cron. It took input from a text file with one URI per line, with actions logged to another file. It would fetch a URI, retrying the download a number of times to deal with lost connections. After the download completed, it would remove the URI from the text file and move on to the next URI. It would repeat this loop until a certain time of day, or until all downloads completed.

Combined with demand-dialing, this made shared dial-up more bearable. I could stick a URI to a Linux .iso image in the queue. The download script would start around 10 P.M. and run until 4 A.M., so it would not interfere with our Internet usage during the day. It would take days to download an .iso image, but each night the download would resume where it left off the prior night.

It also helped when I wanted to download many audio files. I would just add the URIs to the list and let the script run. I added an option to throttle the speed so that it could be used during the day if desired. The script began on a LFS system with the snarf [1] command, then later on Debian with the wget command, and then on NetBSD with the ftp command.

[1]
http://www.ibiblio.org/pub/linux/sys.../snarf-1.2.lsm

SharpyWarpy 12-13-2010 07:33 AM

I wrote several bash scripts to help me organize a music library. My favorite accomplishment is one that will uppercase the first letters of the title in an mp3 id3 tag of all in a directory. Makes me squirm to see a music title show up on a player in all lowercase. I've fixed some of my friends libraries with these types of small scripts and they are real time savers. One library I fixed was 117gb. This guy has a TON of cds. It was fun.

H_TeXMeX_H 12-13-2010 08:32 AM

That's the great thing about scripts, without them it would be a huge problem to do some of these batch tasks.

catkin 12-13-2010 08:42 AM

@H_TeXMeX_H: please define "cool" in this context. I've written some fairly noddy scripts that get a lot of usage and some big (sets of) scripts that are behemoth examples of anally-retentive error trapping, logging and debug facilities -- maybe good practice but hardly "cool" in the usual sense.

H_TeXMeX_H 12-13-2010 08:48 AM

Well, cool = even you amazed by what you could do. I didn't think it was possible to write some of these scripts that I wrote, but I did it.


All times are GMT -5. The time now is 05:15 AM.