Check These Out
I tried a few curses based mp3 players for playing back choir practice songs for my wife.
Unfortunately none of the ones I tried were capable of scrubbing a track.
Firefox saves the day.
Show all commands having the part known by you.
Eg:
$apropos pdf | less
That will capture 200 seconds of video at fullscreen 1680x1050 resolution, but scaled down 25 percent, with 15 frames per second.
http://fusioncast.blogspot.com/2007/09/infobyte-how-i-record-my-desktop.html
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
I like much more the perl solution, but without using perl. It launches a backgroup process that will kill the command if it lasts too much.
A bigger function:
check_with_timeout() {
[ "$DEBUG" ] && set -x
COMMAND=$1
TIMEOUT=$2
RET=0
# Launch command in backgroup
[ ! "$DEBUG" ] && exec 6>&2 # Link file descriptor #6 with stderr.
[ ! "$DEBUG" ] && exec 2> /dev/null # Send stderr to null (avoid the Terminated messages)
$COMMAND 2>&1 >/dev/null &
COMMAND_PID=$!
[ "$DEBUG" ] && echo "Background command pid $COMMAND_PID, parent pid $$"
# Timer that will kill the command if timesout
sleep $TIMEOUT && ps -p $COMMAND_PID -o pid,ppid |grep $$ | awk '{print $1}' | xargs kill &
KILLER_PID=$!
[ "$DEBUG" ] && echo "Killer command pid $KILLER_PID, parent pid $$"
wait $COMMAND_PID
RET=$?
# Kill the killer timer
[ "$DEBUG" ] && ps -e -o pid,ppid |grep $KILLER_PID | awk '{print $1}' | xargs echo "Killing processes: "
ps -e -o pid,ppid |grep -v PID | grep $KILLER_PID | awk '{print $1}' | xargs kill
wait
sleep 1
[ ! "$DEBUG" ] && exec 2>&6 6>&- # Restore stderr and close file descriptor #6.
return $RET
}
see the TIME_WAIT and ESTABLISHED nums of the network
Ever need to know why Apache is bogging down *right now*? Hate scanning Apache's Extended server-status for the longest running requests? Me, too. That's why I use this one liner to quickly find suspect web scripts that might need review.
Assuming the Extended server-status is reachable at the target URL desired, this one-liner parses the output through elinks (rendering the HTML) and shows a list of active requests sorted by longest running request at the bottom of the list. I include the following fields (as noted in the header line):
Seconds: How long the request is alive
PID: Process ID of the request handler
State: State of the request, limited to what I think are the relevant ones (GCRK_.)
IP: Remote Host IP making the request
Domain: Virtual Host target (HTTP/1.1 Host: header). Important for Virtual Hosting servers
TYPE: HTTP verb
URL: requested URL being served.
Putting this in a script that runs when triggered by high load average can be quite revealing. Can also capture "forgotten" scripts being exploited such as "formmail.pl", etc.