weresheep
May 13th, 2007, 01:07 AM
Hi all
I think one of the greatest things about GNU/Linux (and UNIX in general) is how easy it is to incorparate scrips into your daily work flow. Simple (and sometimes complex) tasks that other operating systems require full blown GUI programs for can be accomplished with a little Bash knowledge. With that in mind, whats in your ~/bin/ ?
Here are mine...
-rwxr-xr-x 1 gavin gavin 573 2007-04-01 09:14 banstatus
-rwxr-xr-x 1 gavin gavin 247 2007-04-20 15:06 bday
-rwxr-xr-x 1 gavin gavin 979 2007-04-17 11:14 filterlog
-rwxr-xr-x 1 gavin gavin 491 2007-05-06 12:09 gprune
-rwxr-xr-x 1 gavin gavin 464 2007-05-10 21:43 gsync
-rwxr-xr-x 1 gavin gavin 226 2006-11-22 19:23 money
-rwxr-xr-x 1 gavin gavin 910 2007-04-01 09:15 parselog
-rwxr-xr-x 1 gavin gavin 642 2007-05-05 16:07 profilelog
-rwxr-xr-x 1 gavin gavin 928 2006-11-23 09:43 rip
-rwxr-xr-x 1 gavin gavin 9493 2007-01-09 15:38 sum
-rwxr-xr-x 1 gavin gavin 329 2006-11-23 09:44 trimws
-rwxr-xr-x 1 gavin gavin 3392 2007-05-10 21:31 upmusic
banstatus - a script that looks through /var/log/fail2ban.log and lists the addresses that have been banned recently.
bday - loops through the entries in ~/doc/people/ and checks for anyone with a birthday this month. I am moving away from this one now that I've discovered 'remind' and so I'll probably delete it at some point.
parselog, filterlog - two scripts I wrote to filter /var/log/auth.log. Parselog extracts all the failed (or successful depending on argument) log in attemps and prints the date, time, username and address of each one. Filterlog works on the output of parselog to do such things as count the number of times a specific user name has been tried etc.
profilelog - uses parselog and filterlog to check for addresses that have made multiple attacks.
gsync, gprune - these two scripts keep my home folder synchronised between my computers.
rip, upmusic - music processing scripts. Rip runs cdparanoia to rip a CD and renames the WAV files into my naming convention. Upmusic is the largest script I have written. It loops through every directory in my music folder looking for WAV files and encodes them to FLAC. It also is responsible for renaming and tagging all the FLAC files.
money, sum - Money is a script that looks through ~/doc/money/in.txt and ~/doc/money/out.txt and prints my current money situation. Sum is a C program I wrote to sum up successive numbers from STDIN (I haven't figured out an elegant way to do it in a script yet) and is called by the money script to do the additon.
trimws - trims trailing white space from text files. A very simple script but its handy.
So thats it. I've recently pruned my bin directory to remove a lot of old and unused scripts but those listed above get used all the time. As you can see from the large number of security scripts I've written I was a bit paranoid when I first exposed SSH access to the internet :-D
Anyone else fancy sharing?
I think one of the greatest things about GNU/Linux (and UNIX in general) is how easy it is to incorparate scrips into your daily work flow. Simple (and sometimes complex) tasks that other operating systems require full blown GUI programs for can be accomplished with a little Bash knowledge. With that in mind, whats in your ~/bin/ ?
Here are mine...
-rwxr-xr-x 1 gavin gavin 573 2007-04-01 09:14 banstatus
-rwxr-xr-x 1 gavin gavin 247 2007-04-20 15:06 bday
-rwxr-xr-x 1 gavin gavin 979 2007-04-17 11:14 filterlog
-rwxr-xr-x 1 gavin gavin 491 2007-05-06 12:09 gprune
-rwxr-xr-x 1 gavin gavin 464 2007-05-10 21:43 gsync
-rwxr-xr-x 1 gavin gavin 226 2006-11-22 19:23 money
-rwxr-xr-x 1 gavin gavin 910 2007-04-01 09:15 parselog
-rwxr-xr-x 1 gavin gavin 642 2007-05-05 16:07 profilelog
-rwxr-xr-x 1 gavin gavin 928 2006-11-23 09:43 rip
-rwxr-xr-x 1 gavin gavin 9493 2007-01-09 15:38 sum
-rwxr-xr-x 1 gavin gavin 329 2006-11-23 09:44 trimws
-rwxr-xr-x 1 gavin gavin 3392 2007-05-10 21:31 upmusic
banstatus - a script that looks through /var/log/fail2ban.log and lists the addresses that have been banned recently.
bday - loops through the entries in ~/doc/people/ and checks for anyone with a birthday this month. I am moving away from this one now that I've discovered 'remind' and so I'll probably delete it at some point.
parselog, filterlog - two scripts I wrote to filter /var/log/auth.log. Parselog extracts all the failed (or successful depending on argument) log in attemps and prints the date, time, username and address of each one. Filterlog works on the output of parselog to do such things as count the number of times a specific user name has been tried etc.
profilelog - uses parselog and filterlog to check for addresses that have made multiple attacks.
gsync, gprune - these two scripts keep my home folder synchronised between my computers.
rip, upmusic - music processing scripts. Rip runs cdparanoia to rip a CD and renames the WAV files into my naming convention. Upmusic is the largest script I have written. It loops through every directory in my music folder looking for WAV files and encodes them to FLAC. It also is responsible for renaming and tagging all the FLAC files.
money, sum - Money is a script that looks through ~/doc/money/in.txt and ~/doc/money/out.txt and prints my current money situation. Sum is a C program I wrote to sum up successive numbers from STDIN (I haven't figured out an elegant way to do it in a script yet) and is called by the money script to do the additon.
trimws - trims trailing white space from text files. A very simple script but its handy.
So thats it. I've recently pruned my bin directory to remove a lot of old and unused scripts but those listed above get used all the time. As you can see from the large number of security scripts I've written I was a bit paranoid when I first exposed SSH access to the internet :-D
Anyone else fancy sharing?