Archive for the ‘Linux’ Category

Resetting rkhunter

Monday, February 22nd, 2010

Here’s another memory crutch.

# rkhunter --propupd will “update the entire file properties database, or just for the specified entries”. Run after a significant system upgrade or prepare for a few moments of self-inflicted panic a day or two later.

ntop is not iftop

Wednesday, January 13th, 2010

On a couple of occasions now I have accidentally installed ntop, a web-based “top” clone for network monitoring, when really I want iftop, with it’s libcurses-based command-line goodness. The web thing is cool and all, and I’ve got nothing against it’s suite of dependencies, such as graphvis, however when I’m frantically installing a network visualizer — which generally means that bad shit is going down on some box over which I’ve formally had little control — then I really do need to know what’s happening *right this second*. Hence iftop.

I think iftop used to be called ntop on some distros, which is why I keep mixing them up.

Cygwin More

Monday, December 14th, 2009

Everytime I install Cygwin I find myself rooting around for the “more” command. It’s been removed in favor of “less”, however I prefer “more”. It’s more or less (ha! Linux humor!) a simpler pager.

Install the util-linux package for a random collection of older utilities, including “more” and “whereis”.

defeating Gentoo ImportError: No module named WebappConfig.config

Friday, June 19th, 2009

Run # python-updater. Some of the old Python packages don’t play so nice with the new snake.

If you get an emerge: there are no ebuilds to satisfy "=dev-libs/libxslt-1.1.20" error or similar, try running the updater with the --ignore-versions switch.

Why does emerge suddenly want to rebuild all your packages?

Tuesday, June 16th, 2009

Because the default Portage behavior has changed.

Old: $ emerge world
New: $ emerge -u world

New Portage thinks that a simple “emerge world” means you want to reinstall everything.

Shame on you for not zealously reading and memorizing everything that Portage has to tell you. Bad Admin. Bad.

defeating vsftp error “500 OOPS: cannot change directory:/some/directory”

Monday, June 15th, 2009

There’s lots of recommendations floating around the net for this, but try the following first:

Make sure that the user and group permissions for the account and the home directory match. For example, if you are logging in as:

account:x:521:500::/some/directory:/sbin/nologin

then make sure that the home directory defined for “account” is at least readable and executable by user 521 and group 500.

Updating fstab and missing data!

Thursday, April 2nd, 2009

If you have drives mounted over cifs and, after calling mount -a or /etc/init.d/netfs restart, suddenly find that your data is missing — even though you can still access your drives — try deleting the corresponding entries in /etc/mtab and mount/restart again.

I just experienced this on an elderly Red Hat distro. Problem with the older kernel?

Getting past VSFTP’s 500 OOPS: cannot change directory

Thursday, April 2nd, 2009

This is a frustrating one. Make sure that the user you are connecting as and the target directory have both the same user as well as group permissions.

For example, if you are chroot jailing a particular user, given this entry from /etc/passwd:

username:x:100:200::/ftp/directory:/sbin/nologin
(where 100 = “username” and 200 = “somegroup”)

Make sure that the user and group permissions of the directory match what is set in /etc/passwd:


$ ls -lah /ftp/directory
drwxrwx--- 4 username somegroup 4.0K Mar 24 23:56 .

Posted this one since I’ve probably solved it, and then promptly forgotten the solution, at least three times.

Diff’ing files over the network

Tuesday, February 24th, 2009

This is a godsend. Wish I had thought about doing this before.


$ diff source/worksforme.php <(ssh -n me@liveserver cat /home/me/source/worksforme.php)

You can also compare files on two remote hosts.


$ diff <(ssh -n me@testserver cat /home/me/source/worksforme.php) <(ssh -n me@clientserver cat /home/me/source/worksforme.php)

What the heck network am I on again?

Friday, December 19th, 2008


$ grep GATEWAY /etc/sysconfig/network
GATEWAY=1.2.3.4

Oh yeah.