Troca de conhecimentos sobre o uso da linha de comando e referencia direta ao site commandlinefu.com.
Cleanup firefox's database.
5 de Setembro de 2009, 0:00 - sem comentários ainda$ pgrep -u `id -u` firefox-bin || find ~/.mozilla/firefox '*.sqlite'|(while read -e f; do echo 'vacuum;'|sqlite "$f" ; done)
Sqlite database keeps collecting cruft as time passes, which can be cleaned by the 'vacuum;' command. This command cleans up the cruft in all sqlite files relating to the user you have logged in as. This command has to be run when firefox is not running, or it will exit displaying the pid of the firefox running.
by David Winterbottom (codeinthehole.com)
use vim to get colorful diff output
4 de Setembro de 2009, 0:00 - sem comentários ainda$ svn diff | view -
:q to quit
by David Winterbottom (codeinthehole.com)
Find files that were modified by a given command
4 de Setembro de 2009, 0:00 - sem comentários ainda$ touch /tmp/file ; $EXECUTECOMMAND ; find /path -newer /tmp/file
This has helped me numerous times trying to find either log files or tmp files that get created after execution of a command. And really eye opening as to how active a given process really is. Play around with -anewer, -cnewer & -newerXY
by David Winterbottom (codeinthehole.com)
directly ssh to host B that is only accessible through host A
31 de Agosto de 2009, 0:00 - sem comentários ainda$ ssh -t hostA ssh hostB
Of course you need to be able to access host A for this ;-)
by David Winterbottom (codeinthehole.com)
Terminal - Show directories in the PATH, one per line with sed and bash3.X `here string'
31 de Agosto de 2009, 0:00 - sem comentários ainda$ tr : '\n' <<<$PATH
by David Winterbottom (codeinthehole.com)
get all pdf and zips from a website using wget
30 de Agosto de 2009, 0:00 - sem comentários ainda$ wget --reject html,htm --accept pdf,zip -rl1 url
If the site uses https, use:
wget --reject html,htm --accept pdf,zip -rl1 --no-check-certificate https-url
by David Winterbottom (codeinthehole.com)
How fast is the connexion to a URL, some stats from curl
28 de Agosto de 2009, 0:00 - sem comentários ainda$ URL="http://www.google.com";curl -L --w "$URL\nDNS %{time_namelookup}s conn %{time_connect}s time %{time_total}s\nSpeed %{speed_download}bps Size %{size_download}bytes\n" -o/dev/null -s $URL
by David Winterbottom (codeinthehole.com)
convert unixtime to human-readable
28 de Agosto de 2009, 0:00 - sem comentários ainda$ date -d @1234567890
by David Winterbottom (codeinthehole.com)
Show directories in the PATH, one per line
26 de Agosto de 2009, 0:00 - sem comentários ainda$ echo ${PATH//:/$'\n'}
Shorter version.
by David Winterbottom (codeinthehole.com)
Search commandlinefu.com from the command line using the API
23 de Agosto de 2009, 0:00 - sem comentários ainda$ cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }
Usage: cmdfu hello world
by David Winterbottom (codeinthehole.com)