Nico Schottelius
(linux|unix).schottelius.org


Scripts


Here are some scripts I wrote and use. Copying is allowed under the terms of the GPL 2.0 or higher, if not noted otherwise in the scripts.

Table of contents

0toX
ae_parser
add-mutt+procmail-autosort
axfrs
bg-image.dellist
db-dump+git.sh
generate_mutt_mailboxes
generate_script_header
get-latest-kernel
kopiere_ssh_key
latest-kernel
mini-mua
mk-screenshot
mmv
monotone-snapshotting
ns_ldif_to_mutt_alias
oldterm
ps-insert.sh
securemail
show_calendar
sort-backup.dothejob
suche_vi_files
update-gitweb.sh
update-git+cogito.sh
wecken.sh


0toX

Move blender output files to your extension: 00000 to 00000.bmp

ae_parser

replaces _ae_ with ä and so on (thought for german writers with non-german (e.g. qwerty/dvorak) keyboard layout)

add-mutt+procmail-autosort

Adds an mutt (mailbox checking and folder-hook) and procmail entry at the same time.
Helps to easily manage many different mail addresses without the need to type very much.

axfrs

transfer a dns-zone with a axfr from every authorized dns-server to you

bg-image.dellist

generates a random background; use `find imagedir > ~/.bgimages" and then run this script

db-dump+git.sh

Dump MySQL database and commit it to git.

generate_mutt_mailboxes

generate_mutt_mailboxes > .mutt/mailboxes

generate_script_header

generate a header for scripts from ~/.script-template

get-latest-kernel

Retrieve the latest Linux kernel available.

latest-kernel

show latest available Linux 2.6 kernel; usable as cron script; generates mail

kopiere_ssh_key

Copy your public ssh-key to another host. The used 'mkdir -p' is possibly GNU or Linux specific.

mini-mua

use mini-mua if you need something like mailx with gpg and blind copy to your save folder

mk-screenshot

Create a screenshot in PNG-format from the whole desktop. Requires: x11 and netpbm

mmv

Move *.a to *.b, use `mmv a b`

monotone-snapshotting

Extract snapshot from a monotone database. Can be used by cron and deletes old version from yesterday

ns_ldif_to_mutt_alias

convert netscapes addressbook to mutt's alias file

oldterm

xterm trimmed to be "old" (a little bit like old terminals)

ps-insert.sh

ps-insert.sh inserts a page after each page in the first document, creating a new document: A document with 5 pages named "letter.ps" and a document "spam.ps" with one page will result in a 10 pages big document after executing ps-insert.sh letter.ps spam.ps. Requires: psselect, gs and awk.

securemail

tunnel your pop3 connections to a secure host

show_calendar

This is a mini-calendar. The data of it is stored in a directory within as many files as you like. You have to edit the script to adjust the directory path. The filename also describes the category. Entries beginning with "TO.DO" will always been shown.
You can even use it in your .profile:

show_calendar `date +%d.%m` --> results to
scice% show_calendar 05.09
cLinux:TO.DO: doku: package/
cLinux:TO.DO: scripte kopieren aus ~root/scripts
cLinux:TO.DO: mini installer -> cinstall-chroot
otherfile:05.09: Test entry

You can also use the format DD.MM.YYYY, simply call show_calendar `date +%d.%m.%Y`.
I personally use "show_calendar `date +%d.%m` `date +%d.%m.%Y`" in my .profile.

sort-backup.dothejob

You have a backup directory. And most of the files are unsorted and the backup even contains binaries.
This script sorts out some types like audio,video, word documents...
nico@scice:~/backup$ sort-backup ~/backup/

nico@scice:~/backup$ cat /home/user/nico/bin/sort-backup
if [ -z "$1" ]; then
   echo "searchdir, please"
   exit 1
fi 

find "$1" -exec sort-backup.dothejob ~/sorted-backup {} \;

suche_vi_files

search for running/dead vim sessions (.$file.swp) in selected directories

update-gitweb.sh

Transfer the old configurations from gitweb to a new gitweb. How to use:

curl http://www.kernel.org/git/?p=git/gitweb.git;... > gitweb-new.cgi
./update-gitweb.sh oldgitweb.cgi gitweb-new.cgi

Then gitweb-new.cgi will have the configuration of your old gitweb.cgi

update-git+cogito.sh

Update git and cogito with git and cogito ;-)

wecken.sh

Very simple wacke-up script using xmms and xmms-shell