Check These Out
If everything validates, there's no output. Can be handy to run on a cron job set up to email output.
An easy alias for opening a manpage, nicely HTML formatted, in your set internet browser.
If you get a "command exited with status 3" error you need to install groff.
Requires:
curl
xsel
access to the internet(http://transfer.sh)
This is an alias utilizing the transfer.sh service to make sharing files easier from the command line. I have modified the alias provided by transfer.sh to use xsel to copy the resulting URL to the clipboard.
The full modified alias is as follows since commandlinefu only allows 255 characters:
transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" |xsel --clipboard; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" |xsel --clipboard ; fi; xsel --clipboard; }
Shows all block devices in a tree with descruptions of what they are.
I use terminal with black background on the Mac. Unfortunately, the default ls color for the directory is blue, which is very hard to see. By including the line above in my ~/.bash_profile file, I changed the directory's color to cyan, which is easer to see. For more information on the syntax of the LSCOLORS shell variable:
$ man ls
I tested this command on Mac OS X Leopard
Using this command you can track a moment when usb device was attached.
for i in $(ls /home/marco/.mozilla/firefox/*\.*/places.sqlite); do sqlite3 $i "SELECT strftime('%d.%m.%Y %H:%M:%S', dateAdded/1000000, 'unixepoch', 'localtime'),url FROM moz_places, moz_bookmarks WHERE moz_places.id = moz_bookmarks.fk ORDER BY dateAdded;"; done
This is to fetch the Gateway Ip Address of a machine. Use the below format to put the value in a variable if you wish to find the gateway ip in a script
$GATEWAY=$(netstat -nr | awk 'BEGIN {while ($3!="0.0.0.0") getline; print $2}')
Just a simple way without the need of additional tools. Of course, replace eth0 with your IF.
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.