Software written in Bash.

name-by-date.sh is a bash script to rename JPEGs to show their creation date.

$ name-by-date.sh *.JPG
DSC_0350.JPG taken on "2010.07.02.08.36.20"
DSC_0356.JPG taken on "2010.07.02.08.38.10"
...

name-by-date.sh uses the exif command line interface to libexif to extract the date from the picture's metadata, so you'll have to install that first.

Posted Tue Feb 1 11:44:58 2011 Tags: bash
bat

bat.sh is a bash script to display the available battery charge.

When I'm running X, I usually monitor battery charge with conky, but I wanted a script to allow quick status checks from the command line.

$ bat.sh
Full    4400000/4400000 (100.0%)
Posted Tue Feb 1 10:57:07 2011 Tags: bash

imapquota.py is a Python script that checks the space remaining in an IMAP mail account using imaplib.

$ imapquota -s imap.mail.drexel.edu xyz12@drexel.edu
Password:
Used 92693 of 102400 KB
90.5 percent
Posted Tue Feb 1 10:57:07 2011 Tags: bash

cache-file.sh is a bash script to make it easy to sort pictures using pqiv. If you place cache-file.sh in your path, and add

-1 "cache-file.sh saves"
-2 "cache-file.sh trash"

to ~/.pqivrc, you can move the current picture to .cache-saves/ or .cache-trash/ by pressing 1 or 2 respectively. The .cache-*/ directory is in the same directory as the image file, and will be created if it doesn't exist.

Not very complicated, but useful for quickly removing almost-duplicates, blurry pictures, etc.

Posted Tue Feb 1 10:25:28 2011 Tags: bash

passwd-gen.sh is a /dev/random sanitizer for generating random passwords of various length and complexity.

$ ./passwd-gen.sh 16
NEmXOH2djJvUamdh
Length of password: 16
Total bytes read:   52

The script is well commented, so there's not much more to say here...

Posted Sat Nov 20 20:02:01 2010 Tags: bash

alarm.sh is a bash script wrapping at to minimize the number of keystrokes required to set a simple alarm. This one currently rings a bell and prints a message, but the possibilities are endless...

You will almost certainly have to adjust my ALARM_SOUND_CMD to play a file that exists on your system. Try locate *.wav to see what's already there, or grab something new :).

Posted Sat Nov 20 15:24:09 2010 Tags: bash

The Bourne Again Shell is a very widely adopted Unix shell, and is the default shell for many distributions. Mendel Cooper's Advanced Bash Scripting Guide is an excellent resource, and there is also a nicely detailed manual.

Posted Sat Nov 20 15:05:16 2010 Tags: bash

The clickloc.tk micro-app just opens an image file and prints out the pixel coordinates of any mouse clicks upon it. I use it to get rough numbers from journal figures. You can use scale click.sh to convert the output to units of your choice, if you use your first four clicks to mark out the coordinate system (xmin,anything), (xmax,anything), (anything,ymin), and (anything,ymax).

$ pdfimages article.pdf fig
$ clickloc.tk fig-000.ppm > fig-000.pixels
$ scale_click.sh 0 10 5 20 fig-000.pixels > fig-000.data

Take a look at plotpick for grabbing points from raw datafiles (which is more accurate and easier than reverse engineering images).

Posted Thu Nov 18 09:41:21 2010 Tags: bash tcl-tk