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: Ubuntu • command line • wifi
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: Solaris • Sysadmin • memory • swap
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.
Sep 25
“A Googlewhack is a Google search query consisting of two words–both in the dictionary, and without quotation marks–that returns a single result.”
Doug Sypeck is such an example. Well, almost. I guess names don’t count.
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.
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.