Thursday, June 28, 2007

Xpdf Keyboard shortcuts

Xpdf is an alternative to Adobe's Acrobat Reader in Linux. It is fast and easy and simple to use.

However, it is also powerful. There are a whole slew of keyboard shortcuts that can be used in xpdf to enhance your productivity and xpdf experience. I have compiled a few of them below

g : Go to page
p : Go to previous page
n : Go to next page
b : Go to next page
w: Fit width
z: Fit page
f: Find in page
q: Close and quit
o: Open document
r: Refresh/Reload document

Tuesday, June 12, 2007

Limit SSH Access

For added security, one may want to limit access to a machine through SSH from certain machines only.

You need to edit your /etc/hosts.allow and /etc/hosts.deny files for this

Edit your /etc/hosts.allow file and add your trusted machines/IPs:

sshd: 101.212.332.444, 523.326.447.129
sshd: 1.2.3.

The first two match exact IP addresses, the third will allow any IP beginning with "1.2.3.".

Next edit your /etc/hosts.deny file and add the following line:
sshd: all

This will deny all logins from IPs not explicitly allowed in the hosts.allow file.

Caution: Make sure that the IP addresses entered are correct, otherwise you risk locking yourself out of the server

Monday, June 11, 2007

Command line interface for the web - this is cool

If you are like most *nix users, you would rather prefer using the keyboard and the command line to do most of your daily chores.

However, the web browsing part of it is pretty much GUI (allowing for the elinks, lynx community out there).

Now, there is another website called YubNub which seeks to brind the CLI to the web....

For example type "am david allen" to do a search on david allen at amazon
Other examples include "wp turing" to look at the wikipedia entry on turing

Friday, June 08, 2007

Kill a defunct process

Many a time, when I do a "ps" or a "top", I see some processes tagged with "" meaning they are dead but they are still there :(
Killing them using -9 and process ID won't work either.

The problem is that these processes are tthose that were corrupted such that they cannot communicate (hence signalling would not work) with their parent or child process.
So, you will have to kill the parent or child process.

To find this, you can use the foll. command in linux:
$ps -ef --forest | less
Search for the word "defunct" to find the offending process and its parent. Use the parent's process ID to kill it, thereby killing the offending process also.