Command Line Foo v2.0

From: Jon Stanford 
------------------------------------------------------
So I've been beefing up my ~/.bashrc with some useful, and some not so useful CLI magic.  I thought I would share some of my fav functions... and offer a beat that style discussion ;)

One thing I'm working on is using the takepic to capture an image of anyone who opens the terminal and eventually everytime the computer turns on. The problem is each time it overwrite the previous pic, so I can't keep a directory with all the pics using the date as the filename. :(

Here are my fav functions.

# Take webcam pics
#usage: takepic 4 #takes four pictures
takepic() {
   if [ -z "$1" ]; then
     echo "Taking one picture"
     mplayer -vo png -frames 1 tv://
   else
     echo "Taking $1 pictures"
     mplayer -vo png -frames "$1" tv://
   fi
}

#show a pretty figlet clock (blocks term)
clock() {
    while [ 1 ]; do
        clear
        date +%r | figlet
        sleep 1
    done
}

#search wikipedia for a term
wiki() {
    if [ -z "$1" ]; then
        echo -e "You must supply a query\nie: wiki Snoop\ Dogg"
    else
        dig +short txt "$1".wp.dg.cx
    fi
}

#get my external IP
myip() {
     curl ifconfig.me
}

#show time in top right of terminal (persistant, constantly updated and doesn't block term)
showtime() {
    while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-29));date;tput rc;done &
}

#get all the strings from RAM **may contain private info like passwords**
showram() {
    sudo strings /dev/mem
}

#make a graphical representation of the underlying directories from current location in file tree
graphtree() {
    ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
}

#free memory that is no longer being used
freemem() {
    free && sync && echo 3 > /proc/sys/vm/drop

=============================================================== From: Mike Harrison ------------------------------------------------------ Impressive command line foo, I learned a few things! The original BOFH excuse server(s) used to provide a primary and secondary excuse for just about anything, that was the same for the same day. So if you called two or three different sysadmins (BOFHs) and got a ridiculous excuse, they all gave a variation of the same excuse. Sunspots. Rusty Packets.. Etc. I forgot the one THE Bofh (Chris) used, but it was the same as the tech support sysadmins at some other ISP's.. Hilarious tech support calls..