Some useful hacks and snippets dumpsh download source
a small shell-script that dumps a filesystem determining the level by the
current date (it uses level 0 in the week of month, 1 else), encrypts
the file, wipes out the unencrypted dump and 'scp's it to a remote host. sslenc download source
This skript en-/decrypts the files placed in another directory with OpenSSL
stefan@AragornOfArathorn {56} ls test/
dmes       dmm.1.txt  l          ll         uname      upt
stefan@AragornOfArathorn {57} ./ e test/ passwd
files encrypted and originals removed
stefan@AragornOfArathorn {58} ls test/
dmes.enc      dmm.1.txt.enc l.enc         ll.enc        uname.enc     upt.enc
stefan@AragornOfArathorn {59} ./ d test/ passwd
files decrypted
stefan@AragornOfArathorn {60} ls test/
dmes       dmm.1.txt  l          ll         uname      upt
stefan@AragornOfArathorn {61} 
lilo download source
a PERL-script that reads in a file and prints it to stdout linewise
with a given pause between each line

I use it on my VAX on roadshows or with XScreensavers phosphor-module.
stefan@AragornOfArathorn {633} ./ -h -v        : show version -h        : show this   : reads in and prints it linewise out 
                    with a standard pause of 1 sec between each line 3 : reads in and prints it linewise out 
                    with a pause of 3 sec
signpic download source
Sometimes I decide to publish fotos I've taken by digicam on my HP, but I'm
to lazy to add a kind of sign to each pic, so I created a small skript
solving the task for me.

First I created a transparent GIF containing my sign the following
way with GIMP: [FILE] -> [NEW] -> [FILL TYPE] -> [TRANSPARENT]
Saved it and now I use to add that GIF to the lower right corner
of each JPG located in the current dir.
Requires 'identify' and 'composite' of ImageMagick package (/usr/pkgsrc/graphics/ImageMagick/)
stefan@AragornOfArathorn {222} ./ -h -v            : show version -h            : show this foobar.gif    : add foobar.gif to each *.jpg at the lower right corner
                          writing the result to signed-*
stefan@AragornOfArathorn {223} 
alb download source
uses ImageMagick 'convert' to create thumbnails of given size and creates a
HTML gallery as table with the thumbnail, file size and filename as link.
An example gallery can be found here
pkgdb download source
creates 3 HTML files, 1 containing a list of all installed pkgs
linked to one with the detailed description of the pkg and one
with a list of installed files
dblrem download source
NAME - remove duplicate files using a MD5 hash

DESCRIPTION creates cryptographic MD5 hashes over 
filecontents and deletes duplicate files
stefan@AragornOfArathorn {136} ls -la | wc -l
stefan@AragornOfArathorn {137} time ./ 

real    2m1.055s
user    0m52.437s
sys     1m15.175s
stefan@AragornOfArathorn {138} ls -la | wc -l
stefan@AragornOfArathorn {139} 
gpgrecv download source
Imports all PGP Keys that are used as signature for another key,
but not found at the keyring.
Requires a Keyserver to be set in ~/.gnupg/options xferlog download source
A *very* dirty hack to analyze the 'xferlog' logfile of a NetBSD FTP Server.
stefan@AragornOfArathorn {27} ./ 
anonymous logins             1375 
downloaded files             3287   
downloaded bytes         7452354548  
downloaded Kbytes        7277689.98828125
downloaded Mbytes        7107.11912918091
downloaded Gbytes        6.94054602459073
ent a way to get some random data:
 while true ; do dd if=/dev/urandom bs=1200 count=1 2>/dev/null | sha1 ; done
per substition of text in multiple files substitutes "new" (case insensitive) in each html-File with "old"
find daten/www/ -newer index.html -name "*.html" -printx | xargs perl -i -pe 's/new/old/gi'
con convert images in a directory resize each JPG in this directory to 800*600 with ImageMagick convert
for i in *.jpg
	convert -size 800x600 -resize 800x600 $i $i.2
	mv  $i.2 `basename $i.2 .2`
load Sometimes I have to check if a machine's Hardware (esp. CPU and/or RAM) is OK. I use prime95 (it generates primes and can do some torture testing) and additionally the following shellskript.
It writes 50MB of data from /dev/urandom to a file, generates a SHA1 hash over the file, encrypts and decrypts it with OpenSSL and writes a 2nd SHA1 hash over the decrypted file. So you'll get two lists of hashs which should be equal if your machine is OK, FUBARed hardware usually results in problems with en-/decrypting files. I suggest to generate a load of at least 4, so on more sophisticated machines I do some dd if=/dev/urandom of=/dev/null &
typeset -i cnt=1
while [[ $cnt -le 5 ]] 
	dd if=/dev/urandom of=temp.wipe bs=1M count=50 2>/dev/null
	sha1 temp.wipe >> temp.sha1.1
	openssl des3 -in temp.wipe -out temp.wipe.enc -e -salt -k passwd 
	rm -Prf temp.wipe
	openssl des3 -d -in temp.wipe.enc -out temp.wipe -k passwd
	rm -Prf
	sha1 temp.wipe >> temp.sha1.2
diff temp.sha1.1 temp.sha1.2
[ $? -eq 0 ] && { echo "No Error"; } || echo "Errors found!";
rm temp.wipe.enc
rm temp.wipe
silcd starting a silc-daemon bound to a dynamic IP There is no way to bind silcd to a dyn IP (eg. a DSL-PPP connection), so I configured and copied the conf /usr/pkg/etc/silcd/silcd.conf to /usr/pkg/etc/silcd/silcd.conf.dynip and manipulated "Secondary" ("Primary" is my local that way:
Secondary { ip = "dynip"; port = 706; };
now my skript pipes silcd.conf.dynip through sed, which substitutes "dynip" to my IP address of ppp0 using the backticks calling ifconfig and using awk to reveal the IP. Maybe you have to tweak it a little bit for other OS.
cat /usr/pkg/etc/silcd/silcd.conf.dynip | sed s/dynip/`ifconfig ppp0 | 
awk '$0 ~ /inet / {print  $2}'`/ > /usr/pkg/etc/silcd/silcd.conf
www logfile analyzer a small shellskript to analyze logfiles of my university www-account:
for i in `awk '{print $5}' *|sed s/'\/steschum\/'// | sort|uniq`; 
do cat * | grep $i| awk '{summe+=$1;groesse+=$3} END {printf summe"        "groesse"       "}';echo $i ;
done|sort -n, Index
$Id: index.html,v 1.45 2014/08/21 09:24:33 stefan Exp $ 
Autor: Stefan Schumacher,, PGP-Key 0xB3FBAE33

Bitte beachten Sie, das die Seite inhaltlich seit Ende 2007 nicht mehr gepflegt wird!
Aktuellere Informationen erhalten Sie auf