LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-01-2010, 08:54 AM   #1
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
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.
 
Old 12-01-2010, 09:17 AM   #2
trey85stang
Senior Member
 
Registered: Sep 2003
Posts: 1,091

Rep: Reputation: 41
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.
 
Old 12-01-2010, 05:30 PM   #3
eveningsky339
Member
 
Registered: Mar 2010
Location: Western Maine
Distribution: PCLinuxOS (LXDE)
Posts: 466

Rep: Reputation: 51
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.
 
Old 12-02-2010, 02:51 AM   #4
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by eveningsky339 View Post
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 ?
 
Old 12-02-2010, 04:14 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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.
 
Old 12-02-2010, 04:49 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
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.
 
Old 12-02-2010, 02:49 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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.
 
Old 12-02-2010, 02:53 PM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
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.
 
Old 12-02-2010, 08:13 PM   #9
eveningsky339
Member
 
Registered: Mar 2010
Location: Western Maine
Distribution: PCLinuxOS (LXDE)
Posts: 466

Rep: Reputation: 51
Quote:
Originally Posted by H_TeXMeX_H View Post
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.
 
Old 12-02-2010, 10:08 PM   #10
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Probably this. That said, others may have also come up with similar scripts.
 
Old 12-02-2010, 10:25 PM   #11
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 371
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
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

Last edited by BenCollver; 12-02-2010 at 10:27 PM. Reason: Grammar fix.
 
Old 12-13-2010, 07:33 AM   #12
SharpyWarpy
Member
 
Registered: Feb 2003
Location: Florida
Distribution: Fedora 18
Posts: 862

Rep: Reputation: 91
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.
 
Old 12-13-2010, 08:32 AM   #13
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
That's the great thing about scripts, without them it would be a huge problem to do some of these batch tasks.
 
Old 12-13-2010, 08:42 AM   #14
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
@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.
 
Old 12-13-2010, 08:48 AM   #15
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928

Original Poster
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is the best scripting language? kike_coello Programming 22 07-25-2009 05:16 PM
event.d scripting language? Hourani Linux - Newbie 3 02-02-2009 04:39 PM
LXer: Scripting SSH and SFTP Made Easy With Python LXer Syndicated Linux News 0 12-17-2008 12:20 AM
Best scripting language? walterbyrd Linux - Software 2 01-08-2006 02:13 PM
Which Scripting Language? birdseye Programming 2 10-03-2005 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration