May 25

One of the really nice things about running Ubuntu is that you can get information about the hardware from the command line.

For example:
sudo iwlist eth1 scan | grep ESSID

lists up the names of any Wifi hotspots in close proximity. I will leave it as an exercise for the reader to think as to what could this be useful for.

Tagged with:
Mar 25

Here’s a couple of handy commands that I noted down after searching for Solaris “swap memory”. It’s worth knowing how to find out this kind of information without using more sophisticated tools. pmap is a pretty deep command. It’s not really my idea of fun, late on a Sunday night to study how Solaris manages memory, but I ended up poking around on a Solaris box to find this out.

swap -s and swap -l gives swap space information
/usr/proc/bin/pmap -x PID gives information about the memory usage of a process

Tagged with:
Sep 01

Some figures to consider:

99% uptime is less than 88 hours of downtime in a year
99.9% uptime is less than 9 hours of downtime in a year
99.99% uptime is less than 1 hour of downtime in a year
99.999% uptime is less than 6 minutes of downtime in a year
99.9999% uptime is less than 32 seconds of downtime in a year
99.99999% utpime is less than 4 seconds of downtime in a year
99.999999% uptime is less than the precision of Excel

Aug 15

Say you know the name of  a process that you want to kill, usually you have to do ps to find out what it’s pid is before you can kill it. You can combine the ps command with other commands like this:

ps -ef | grep someprocess | grep -v grep | awk ‘{print $2}’ | xargs kill

As ever WL suggested an improvement:

ps -ef | grep [s]omeprocess | awk ‘{print $2}’ | xargs kill

grep -v removes the grep command from?ps listing but so does grep[s]omeprocess. I gave up and asked for help to figure it out. The answer is really obvious once you understand it.

Aug 11

I noticed that while doing some work that the disk space on the / partition was getting lower and searching for where the disk space has gone using:

find / -size +100000 -mtime -3 -exec ls -lh ‘{}’ ‘;’

I found huge file /dev/rmt/0 was written to around the time that I did made the tar file. From a quick search, this looks like it is related to the tape so it is related to tar. I didn’t expect / to be affected when making the tar file so I was a bit surprised to see the disk space there being eaten up so I made another tiny tar file. As I guessed, the disk space returned. Does tar use /dev/rmt/0 as temporary space?

Aug 08

I found a neat application today that deletes files based on their age. It is just the thing to run on your Windows temp folders to clean them up. If you delete everything, you end up trying to delete open files so if you set it to delete anything older than a day old you can be sure that you have the minimum amount of garbage left. The application is called DelAge32 and it can “delete or move files by age (days), options: include subdirectories, selection by date tag (created, last written, accessed), and more..”
I am using it with the following options: DelAge32 %temp%\*.* 1 /recurse /rd

Jun 25

I just realized that an account I don’t use very often has filled up with junk email forwarded from another account which gets lots of spam. I didn’t need the mail sent to that account so I deleted it using the following “find . -exec grep -l “name@example.com” ‘{}’ \; | xargs rm &” which finds all the files which contain “example.com” and deletes them.

Jan 16

Some useful steps when dealing with a disk space problem:

1) What has been modified in the last day

find /opt -mtime -1

2) Find the size of a folder in human readable disk sizes:
du -h /tmp

Jun 30

MailTunnel Description
The author writes:

Mailtunnel creates a bidirectional virtual data path tunnelled in E-Mail
messages. This can be useful for users behind restrictive firewalls that
only allow Mail-Access (usually through a central mailhub).
In a situation like the above, it’s possible to use mailtunnel to tunnel
anything from simple telnet sessions to SSH-PPP VPNs (practically anything
that can be tunneled over TCP/IP) to a non-blocked system on the internet.
This allows users(well..) behind even the nastiest firewalls to access
resources they’re not ment to access.

I wrote this piece of software in the spirit that it should be possible to
gain full netaccess, no matter how good you’re firewalled.

Tagged with:
preload preload preload