dblrem dblrem.pl
download source
NAME
dblrem.pl - remove duplicate files using a MD5 hash
SYNOPSIS
dblrem.pl
DESCRIPTION
dblrem.pl creates cryptographic MD5 hashes over
filecontents and deletes duplicate files
Example:
stefan@AragornOfArathorn {136} ls -la | wc -l
17315
stefan@AragornOfArathorn {137} time ./dblrem.pl
real 2m1.055s
user 0m52.437s
sys 1m15.175s
stefan@AragornOfArathorn {138} ls -la | wc -l
12
stefan@AragornOfArathorn {139}
gpgrecv gpgrecv.pl
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 xferlog.pl
download source
A *very* dirty hack to analyze the 'xferlog' logfile of a NetBSD FTP Server.
stefan@AragornOfArathorn {27} ./xferlog.pl
anonymous logins 1375
downloaded files 3287
downloaded bytes 7452354548
downloaded Kbytes 7277689.98828125
downloaded Mbytes 7107.11912918091
downloaded Gbytes 6.94054602459073
ent entropy.sh
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
do
convert -size 800x600 -resize 800x600 $i $i.2
mv $i.2 `basename $i.2 .2`
done
load load-runner.sh
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 &
#!/bin/ksh
typeset -i cnt=1
while [[ $cnt -le 5 ]]
do
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 temp.wipe.nc
sha1 temp.wipe >> temp.sha1.2
cnt=cnt+1
done
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 192.168.2.1) 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
silcd
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
net-tex.de, Index
$Id: index.html,v 1.45 2014/08/21 09:24:33 stefan Exp $
Autor: Stefan Schumacher,
stefan@net-tex.de, PGP-Key 0xB3FBAE33
für net-tex.de/cryptomancer.de
Bitte beachten Sie, das die Seite inhaltlich seit Ende 2007 nicht mehr gepflegt wird!
Aktuellere Informationen erhalten Sie auf Kaishakunin.com