Check These Out
An other way to run it ( playing a random file ending with avi, flv or mpeg ) from a specified dir and a specified type of extension :
making MOVIE array with a glob :
$ MOVIE=( /PATH/TO/MY/FAVORITE/MOVIES/*.{avi,flv,mpeg} )
playing the random file from a random key from the array
$ mplayer ${MOVIE[ RANDOM % ( ${#i[@]} + 1 ) ]]}
I use only globs and a bash array.
I use GNU bash, version 3.2.48
Puts a splash of color in your access logs. IP addresses are gray, 200 and 304 are green, all 4xx errors are red. Works well with e.g. "colorize access_log | less -R" if you want to see your colors while paging.
Use as inspiration for other things you might be tailing, like syslog or vmstat
Usage:
$ tail -f access.log | colorize
Used to copy and paste a terminal buffer of a python interactive session into an editor
the command is obvious, I know, but maybe not everyone knows that using the parameter "-l" you can limit the use of bandwidth command scp.
In this example fetch all files from the directory zutaniddu and I copy them locally using only 10 Kbs
Seq allows you to define printf like formating by specified with -f, %03g is actually tells seq I got three digits, fill the blank digits with 0, and the range is from 176 to 240.
cat file1 file2 file3|sort|uniq -d
finds the same lines in several files, especially in files with lists of files.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
the "delay" utility is an invaluable tool for me. with gnu-screen it allows you to schedule something and have it run and output to the current terminal, unlike "at".
You can also use it like "sleep" with seconds and also with date:
delay until 13:33 friday && echo test
get it from: http://onegeek.org/~tom/software/delay/current/delay.c
(author: Tom Rothamel)
For this hack you need following function:
$ finit() { count=$#; current=1; for i in "$@" ; do echo $current $count; echo $i; current=$((current + 1)); done; }
and alias:
$ alias fnext='read cur total && echo -n "[$cur/$total] " && read'
Inspired by CMake progress counters.