Table of Contents
recursive toc v1.4

Shell scripts

My shell scripts. Written to help speed-up and automate ordinary tasks.
Script Version Description
kernel.sh v1.2
2007/03
Linux Kernel download script
Downloads Kernel sources or patchsets from official mirror (or others) with a simple short command. Aditionally, it can verify downloaded files' GPG signatures.
clear-converted-png.sh v1.0
2006/07
clear-converted-png
Clears all .png images that were converted by convert-png-jpg.sh. The script works by parsing a logfile.
clear-converted-jpg.sh v1.0
2006/07
clear-converted-jpg
Clears all .jpg images that resulted from a run of convert-png-jpg.sh. This script was written to undo a conversion run and works by parsing a logfile.
convert-png-jpg.sh v1.0
2006/07
convert-png-jpg
Convert images from .png format to .jpg to save space and bandwidth. The script converts files using the convert tool with a default quality setting of 95 and scraps the result if it is bigger than the original .png file.
alsadecode.sh v1.1
2006/07
ALSA decoder script
ALSA tools (obviously) don't include audio decoders (like mp3 or ogg), and sometimes it would be useful if a single program could transparently decode and play audio samples encoded with different codecs. This is a small wrapper script for playing mp3, ogg and uncompressed audio samples (wave).

I use it with kde's knotifier, as an external player to avoid using aRts at all.
retrieve.sh v1.0
2006/05
retrieve
Retrieves a defined group of files from multiple hosts. This script is similar to fetch-data, but while fetch-data fetches output of executed commands, retrieve retrieves given files.
fetch-data.sh v1.2
2006/04
fetch-data
Remotely executes a defined group of commands via ssh on multiple hosts and fetches their output into separate files.
propagate.sh v1.1
2006/04
propagate
This small script is incredibly useful when managing tens or hundredes of remote hosts. It sends a defined group of files into a defined location of a multiple hosts via secure copy.
cpu_power.sh v1.0
2006/03
cpufreq selector script - performance
Sometimes we just want full throttle, and this script does just that. It selects the performance governor which statically selects the highest available frequency for the cpu. VMWare users may find this useful.
make-gvs-patches.sh v1.0
2006/03
GRSec-VServer patcher
When I adapted the GRSecurity and VServer patchsets into a single patch, I found myself repeatingly patching between 4 Kernel source trees with EXTRA care to prevent overwrites. This is a specific patch, but can be the basis of something better or perhaps adapted to another reality.

This script makes 3 patchsets from 4 Kernel source trees, gzips the results and stores them in a configured directory with an incremental version suffix to prevent overwrite.
stop_wireless.sh v1.1.1
2005/07
WPA wireless stop script
similar to above script, but this one stops the wpa_supplicant daemon and brings the interface down.
start_wireless.sh v1.1
2005/06
WPA wireless startup script
Starts my wireless interface, using wpa_supplicant for AP association and key management. The script sets the essid, calls the wpa_supplicant daemon and waits for successfull authentication before requesting DHCP configuration for the wireless network interface.

Useful when used with sudo. An unprivileged user could start and stop a wireless connection.
cpu_cool.sh v1.0
2005/04
cpufreq selector script - powersave
The powersave cpufreq governor statically selects the lowest possible cpu frequency. This is doable on chips that support the cpufreq Kernel driver (like the Intel Centrino or AMD Athlon Mobile)

Very useful when used with sudo for laptops running on the battery.
cpu_ondemand.sh v1.0
2005/04
cpufreq selector script - ondemand
This shell script sets up the cpufreq Kernel driver so that cpu frequency is scaled dynamically depending on workload. This cpufreq governor is called ondemand. Another way to do the same job would be to use the userspace governor and scale the frequency from an userspace process.

I use this governor for everyday work.
Wallpaper converter to wide format
Since I bought a wide screen laptop, it became interesting to convert 4:3 formatted wallpapers into cropped versions of the same with 16:10 format.
Linux Kernel patch manager
It is very annoying to manually patch, unpatch and repatch the kernel if you do it a lot of times. I do, and to help me with that, I wrote this small script to automate some tasks.
Gentoo portage updater info
While administrating more than one server at once, I thought it would be useful if they warned me of pending updates. this is a small shellscript that does just so.