Wednesday, April 1, 2009

Couple compound shell commands

make passwords:
base64 < /dev/urandom
(I know of pwgen, but above line is better for paranoid. You may fear that pwgen has some sort of bug that greatly decreases amount of entropy in passwords, but, surely, you gotta trust /dev/random and /dev/urandom , and base64. if those fails you're screwed anyhow)

print all gcc defines
gcc -dM -E - < /dev/null

access to some sites behind mis-configured switches can be improved with (as root)
ifconfig eth0 mtu 1000
or lower number

reversing order of numbered files
for((i=0;i<720;++i)); do mv file_$(printf "%05d" $i).png file_$(printf "%05d" $((720-i))).png ; done
(replace 720 with number of files)

remove executable privileges recursively without making folders non-browsable:
find ./ -type f -exec chmod -x {} \;

No comments:

Post a Comment