just a snippet of something i was working on to add volumes to instances in aws using the amazon ec2 ami / api tools. very rough draft. TMP_VOL_OUT=”$(basename $0).$$.tmp” TMP_INST_OUT=”$(basename $0).$$.tmp” ## input the number of volumes to create- echo “How many volumes to create ?: \c” read VOLNUM echo “Creating ${VOLNUM} volumes” ## input … Read More
linux: find . -type f -print0 | xargs -0 -n1 md5sum | sort -k 1,32 | uniq -w 32 -d –all-repeated=separate | sed -e ‘s/^[0-9a-f]*\ *//;’ mac osx: find . -type f -print0 | xargs -0 cksum | sort | awk ‘{if($1 == prevsum) {printf(“—-\n %s\n %s\n”, prev, $0);} prev=$0; prevsum=$1;}’
on some of the app boxes at work we have an issue with tomcat not free’ing up cached memory quickly after either a tomcat restart or tomcat stop so we did some google-ing to find a way to quickly free up cached memory. what this script does is sync writes the cache then echo 3 … Read More
lets say that i run netstat -tanpu which gives an output of : netstat -tanpu (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp … Read More
so i was getting tired of the prompt i have / had and wanted a prompt that would give me more info. since i already had tmux giving me a decent amount of info i wanted to see if i could get my prompt to color code the load and give me the pwd. after … Read More
i was writing a script and needed to hide input for a password. here is the snippet: echo -n “please enter password and press [enter]: ” STTY_ORIG=`stty -g` stty -icanon -echo KEY=$(dd bs=1 count=1 2>/dev/null) while [ x$KEY != x$(echo) ]; do PASSWORD=$PASSWORD$KEY echo -n \* KEY=$(dd bs=1 count=1 2>/dev/null) done echo stty $STTY_ORIG # … Read More
i have made the switchover to tmux (in gentoo: app-misc/tmux) from screen. from the tmux site: tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in … Read More
just as the name says, this is a bit of my xinitrc file as used in a dual monitor evilwm setup. a little about my setup: Gentoo evilwm (emerge x11-wm/evilwm) SLiM Simple Login Manager (emerge x11-misc/slim) conky lightweight system monitor (emerge app-admin/conky) so when i first started using evilwm in a dual monitor setup i … Read More
here is my latest revision of conky (click to enlarge): with the latest .conkyrc file here. as you can see i added a port inbound/outbound monitor, portage sync status, gentoo linux security advisories and a cool looking date and time (as detailed here) here is the screenshot (click to enlarge): screenshot is running the conkyrc … Read More
EDIT: Sep-28-2010 : as of a while ago 1x.com changed how their random images are served so this script no longer works. i’ll see if i can use a different site as pointed out in the comments. so after creating the evilwm random wallpaper script i decided that i wanted to use the fixed resolution … Read More