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:
Oct 11

Here’s a starting point if you can’t remember a Unix command that you know exists: Wikipedia’s List of Unix Commands.

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?

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.

Apr 17

bash-2.05# ./configure
checking MACHDEP… sunos5
checking EXTRAPLATDIR…
checking for –without-gcc… no
checking for –with-cxx=… no
checking for c++… c++
checking for C++ compiler default output file name… configure: error: C++ compiler cannot create executables
See `config.log’ for more details.

If you get the above error, basically it means that your system is not set up at all for compilation. Try compiling the most basic C “hello world” application and see how far you get. In my case even the gnu assembler “as” wasn’t installed. The “configure” script checks your configuration but even it assumes that you have the minimal most basic of tools installed.

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