If you need to figure out what a unix program does fast, whatis can tell you.

ian@thoughtdeposit.net:~$ whatis rsync
rsync (1) – faster, flexible replacement for rcp

Whatis simply sucks out the program’s man page description field, and barfs it onto the screen.

Technorati Tags: ,

You know you have spent too much time in unix when you use a unix command to remind you it’s time to step away from the terminal, and go feed the dog. Leave does just that.

leave +0115

This will remind you an hour and fifteen minutes from now to leave your command prompt. If you stay put, it will keep pestering you until you go nuts.

(Depending on your distro, leave may not be standard. In Debian, apt-get install leave will get it installed for you)

I’m talking in terms of keystrokes, and you don’t know the PID.

pgrep fooapp | xargs kill – 9

That’s twenty-three characters, including whitespace, excluding the process name. What’s quicker?

Don’t know where I picked this one up, but here is a tip for today.

I totally heart vi, I can’t deny it. Knowing how to manipulate can sometimes be tricky, and nobody says it has an easy learning curve. Maybe somebody will find this useful:

To find a particular line in vi you could first press / and then type in what you are looking for. And poof, you go to that line. Press ‘n’ and you will keep going. But sometimes I want to go straight to a line but don’t quite know what it is. For that…

# grep php -n httpd.conf
26:LoadModule php5_module modules/libphp5.so
137: DirectoryIndex index.html index.php
382:AddType application/x-httpd-php .php .phtml

Now you know the lines of whatever you are looking for. Now open up vi, press : and then enter the number, e.g.

:382

Press enter and you are there. Yay.

Wikity is a miniature wiki in your OSX dashboard. If you’re a GTD true believer, it’s can also be the linch-pin of your system.

I keep four instances of Wikity open in my dashboard, one for my ‘next actions’ list, one for my ‘waiting on’ list, one for my ‘projects list’, and one for my ‘someday maybe’ list. My someday maybe window usually gets cannibalized to look at other wiki pages I keep in the system, like my errands list, or the various agenda lists I keep for people.

This system fits my style because I, for my own picky reasons, really hate having extra icons in my dock or seeing them listed in the task switcher. So that rules out apps like Kinkless GTD. I just hit F12 and my lists pop-up, hit it again and everything disappears.

Wikity used to even work with Quicksilver, but the plugin seems to be broken for me right now. Still, I swear by this simple system, even not playing nice with my beloved Quicksilver wasn’t enough for me to abandon it.

Link

One of the most cumbersome parts of *nix is typing out god damn directory paths. Worse is when you need to switch back and forth between them. If you’re like me, you never typo directory names when shuffling back and forth (sure… )

pushd & popd allow you to memorize a directory, and then quickly switch back to it. Try this on for size:

$ pwd
/home/some/long/directory/name/goes/here/
$ pwd | pushd
$ cd /home/ian/
$ popd
$ pwd
/home/some/long/directory/name/goes/here/

Handy!

I like most standards, I can’t deny it. One thing that I find too humorous is the amount of sites that are not valid, even sites that claim they are. One tool in my box is HTML Validator, an extensioni for Firefox. A nice little icon appears in the lower right, indicating whether a page is valid, not-so-valid, or really-not-so-valid. Makes it easy to check your own sites, and others.

I always forget how to backup the 2003 box, which is something I try to do whenever updating it (or installing new software).

The command is “ntbackup” from Run.

Logs spiraling crazy, we run out of disk space all the time. A nifty trick to find where the disk went is to issue: du -cks * |sort -rn |head -11

This returns where the disk usage is, and makes finding the bloated log a lot easier.

So we all know we shouldn’t access router configuration pages when wireless, right? http://router.yourdomain.com:8080, including the password, will go over the are crystal clear. But when duty calls,

1) Connect to a cisco VPN

2) kelvin@pluto:~$ sudo route add -host router.yourdomain.com dev cipsec0

This will tunnel all traffic over the VPN to malaysia.

Note: Command for Linux — Ian, do you know the similar command of OS X/BSD?