msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

10 Sep 2010 Randomize filenames

This is a simple bash script to create random filenames of all jpg-files (*.jpg) in a folder using the linux commands mv, sha1sum and cut.

#!/bin/bash
# Randomize filenames

for fname in *.jpg;
do
        mv "$fname" $(echo "$fname" | \
                sha1sum | \
                cut -f1 -d ' ' | \
                cut -b 1-5).jpg
done

The jpg-files can have names like

08df4.jpg  
1e788.jpg  
315e6.jpg  
41e19.jpg  
5f7d0.jpg  
7471e.jpg

Tags: , , ,

Posted by

04 Dec 2007 Strip the kernel to contain only needed modules

This is a great page with som nice bash scripts describing how to remove unwanted modules from your kernel.

Tags: , , , , , , ,

Posted by

20 May 2007 Get your IP address

ifconfig eth0 | awk '/inet addr/{print $2}' | cut -d: -f2

Tags: , ,

Posted by

26 Apr 2007 Generate a list of target hosts to nmap scan

Legg følgende inn i fila iplist.sh

#!/bin/bash
# filename: iplist.sh
# usage: ./iplist.sh 192.168.1.0/24 > iplist.txt

nmap -sL $1 --randomize_hosts | grep '^Host' | cut -d '(' -f 2 | cut -d
')' -f 1

(more…)

Tags: , , ,

Posted by