Check These Out
-r : repeat mode
gps data from geocaching.com is provided for free in .loc format.
PING
parameters
c 1 limits to 1 pinging attempt
q makes the command quiet (or silent mode)
/dev/null 2>&1 is to remove the display
&& echo ONLINE is executed if previous command is successful (return value 0)
|| echo OFFLINE is executed otherwise (return value of 1 if unreachable or 2 if you're offline yourself).
I personally use this command as an alias with a predefined machine name but there are at least 2 improvements that may be done.
Asking for the machine name or IP
Escaping the output so that it displays ONLINE in green and OFFLINE in red (for instance).
when using Gnome or KDE, you will have a hard time getting a screenshot of something like a login screen, or any other screen that occurs before the desktop environment is up and monitoring the printscreen key. (this probably applies for other DEs as well, but I haven't used them)
What this command is meant to do is take a screenshot of an X window using a command you can run from your virtual terminals (actual text terminals, not just an emulator) To do this:
Press CTRL+ALT+F1 to go to a virtual (text) terminal once your login window comes up
Login to the virtual terminal and enter the command (you'll have to type it in)
You should now have a file called screenshot.png in your home directory with your screenshot in it.
For those of you who are new to the virtual terminal thing, you can use CTRL+ALT+F7 to get back to your regular GUI
From http://www.gnome.org
pushd and popd are your friends, but sometimes they're just incompatible with the way one works...
Two shell functions:
bm bookmarkname - "bookmarks" the current directory, just 'cd $BMbookmarkname' to return to it.
forget bookmarkname - unsets the 'bookmarkname' variable. It isn't mandatory, they cease to exist when the session ends.
You need to have fortune and cowsay installed. It uses a subshell to list cow files in you cow directory (this folder is default for debian based systems, others might use another folder).
you can add it to your .bashrc file to have it great you with something interesting every time you start a new session.
$ time perl -e 'if(opendir D,"."){@a=readdir D;print $#a - 1,"\n"}'
205413
real 0m0.497s
user 0m0.220s
sys 0m0.268s
$ time { ls |wc -l; }
205413
real 0m3.776s
user 0m3.340s
sys 0m0.424s
*********
** EDIT: turns out this perl liner is mostly masturbation. this is slightly faster:
$ find . -maxdepth 1 | wc -l
sh-3.2$ time { find . -maxdepth 1|wc -l; }
205414
real 0m0.456s
user 0m0.116s
sys 0m0.328s
** EDIT: now a slightly faster perl version
$ perl -e 'if(opendir D,"."){++$c foreach readdir D}print $c-1,"\n"'
sh-3.2$ time perl -e 'if(opendir D,"."){++$c foreach readdir D}print $c-1,"\n"'
205414
real 0m0.415s
user 0m0.176s
sys 0m0.232s
In case you need to test some CGI scripts this does the job. It also has the functionality of a http server.
Enjoy!