Troca de conhecimentos sobre o uso da linha de comando e referencia direta ao site commandlinefu.com.
Google verbatim search on your terminal
5 de Abril de 2013, 5:04 - sem comentários ainda$ function google { Q="$@"; GOOG_URL='https://www.google.de/search?tbs=li:1&q='; AGENT="Mozilla/4.0"; stream=$(curl -A "$AGENT" -skLm 10 "${GOOG_URL}${Q//\ /+}" | grep -oP '\/url\?q=.+?&' | sed 's|/url?q=||; s|&||'); echo -e "${stream//\%/\x}"; }
Put it in your ~/.bashrc
usage:
google word1 word2 word3...
google '"this search gets quoted"'
by David Winterbottom (codeinthehole.com)
Press enter and take a WebCam picture.
17 de Janeiro de 2013, 0:00 - sem comentários ainda$ read && ffmpeg -y -r 1 -t 3 -f video4linux2 -vframes 1 -s sxga -i /dev/video0 ~/webcam-$(date +%m_%d_%Y_%H_%M).jpeg
This command takes a 1280x1024 p picture from the webcam.
If prefer it smaller, try changing the -s parameter: qqvga is the tiniest, vga is 640x480, svga is 800x600 and so on.
Get your smile on and press enter! :)
by David Winterbottom (codeinthehole.com)
Commandline document conversion with Libreoffice
27 de Dezembro de 2012, 0:00 - sem comentários ainda$ soffice --headless -convert-to odt:"writer8" somefile.docx
In this example, the docx gets converted to Open Document .odt format.
For other formats, you'll need to specify the correct filter (Hint: see "Comments" link below for a nice list).
by David Winterbottom (codeinthehole.com)
Convert Shell Text to Upper/Lower Case
27 de Dezembro de 2012, 0:00 - sem comentários ainda$ ALT-U / ALT-L
by David Winterbottom (codeinthehole.com)
grep processes list avoiding the grep itself
15 de Dezembro de 2012, 0:00 - sem comentários ainda$ ps axu | grep [a]pache2
Trick to avoid the form:
grep process | grep - v grep
by David Winterbottom (codeinthehole.com)
Check if system is 32bit or 64bit
12 de Dezembro de 2012, 0:00 - sem comentários ainda$ getconf LONG_BIT
Needed a quick way to see if my server distro that I setup years ago was running 32bit or not, since with time I had forgotten.
Note: does not check _hardware_ e.g. /proc/cpuinfo but rather the kernel installed
by David Winterbottom (codeinthehole.com)
Encrypted archive with openssl and tar
27 de Novembro de 2012, 0:00 - sem comentários ainda$ tar --create --file - --posix --gzip -- <dir> | openssl enc -e -aes256 -out <file>
Create an AES256 encrypted and compressed tar archive.
User is prompted to enter the password.
Decrypt with:
openssl enc -d -aes256 -in <file> | tar --extract --file - --gzip
by David Winterbottom (codeinthehole.com)
vi a remote file
23 de Novembro de 2012, 0:00 - sem comentários ainda$ vi scp://username@host//path/to/somefile
notice the double slash
by David Winterbottom (codeinthehole.com)
Display current time in requested time zones.
16 de Novembro de 2012, 0:00 - sem comentários ainda$ zdump Japan America/New_York
The time zone names come from the tz database which is usually found at /usr/share/zoneinfo.
by David Winterbottom (codeinthehole.com)
Binary digits Matrix effect
27 de Setembro de 2012, 0:00 - sem comentários ainda$ perl -e '$|++; while (1) { print " " x (rand(35) + 1), int(rand(2)) }'
Silly Perl variant.
by David Winterbottom (codeinthehole.com)