From x61s to x60s

January 22nd, 2012

Well. Once more I picked up some old equipment at work. This time an x60s. I have recently gotten my hand on a x61s. The x61s is a wonderful machine by most standards, especially as I bought a large 8-cell battery and a 64GB SSD for it. One major disadvantage however, is the fan and power usage: Even ad idle, light websurfing it is so hot that the fan has to spin so fast that it is annoying to listen to.

The switch from x61s to x60s took around 60 seconds: unscrew the screw holding the harddrive into place. Swap the drive. Do the same with the battery. And power on. Ubuntu 11.10 booted just fine. No errors whatsoever. But then again. I had forseen this might happen, so I was already running an 32-bit version of ubuntu 11.10. Had I run an x86_64 version I wouldn’t have been that lucky as the cpu in my x60s is on 32-bit.

So to sum up: The x60s is a  teeny weeny bit slower than the x60s, but has marginally better power-envelope, but most importantly is quite a bit more silent to use! I will recommend the x60s over the x61s for the noise alone.

Ubuntu and Cisco anyconnect

January 16th, 2012

I recently installed ubuntu 11.10 in a laptop. I then had the need to connect that laptop to a cisco based anyconnect VPN. I could have gone the route of trying to install some cisco anyconnect software. I could also just issue

sudo apt-get install network-manager-openconnect-gnome

And then configure the vpn using network-manager. I choose the latter ;-)

Hurraayyy for OSS

HP-UX filecache_max tunable and system unresponsiveness

January 12th, 2012

During work today I tweaked the online tunable called filecache_max on an HP-UX 11.31 box. From 1 to 5%. Went fine. I tested what I needed to test and then decided to lower the value again. So I ran kctune filecache_max=2% and then nothing.

Everything(!) stopped working. Well, the system could be pinged, but the other cluster node started to complain about its sister disapperaing. I littlerally got cold hands. This was supposed to be an online operation. I waited for 4 very very long minutes (being a computer professional have learned me to wait for stuff to finish).

After 4 minutes the system was back. Running as nothing had happened. Everything littlerally just froze up trying to reduce the filecache. I learnt it the hard way. Hope this post will prevent you from getting into the same kind of troubles.

Hyundai i30cw blue

January 1st, 2012

For new years eve i rented an Hyundai i30cw blue. Compared to other cars in Københavns delebiler, this is one of the more interesting cars to drive. It feels good to drive. Has what you would expect it to have of equipment and all the room you need for a little family. One of the more peculiar things is the onboard computer that keeps telling you to shift gears. On the negative side, the transmission feels a bit platsic-ish. I’ll give it 3 out of 5 stars.

 

i30cw blue

No cola again again

January 1st, 2012

I had a blast with coca cola for 4 months (2011-09-01 to 2012-01-01) and now it is time to stop again. It is not healthy for me. Teeth and weight. So I’ll give it at try of staying ‘sober’ for 2 more years. New target is 2014-01-01.

Using the E3000 as a caching DNS server (on dd-wrt)

December 31st, 2011

Due to popular demand I’ll post this on how to use the E3000 as a generic DNS server. I’t will be very brief, you have to fill in the blanks yourself.

First you have to get the support tools in place for this. dd-wrt is build for smallish setups as well, so some of the tools are quite limited to say the least. There are basically two routes:

  • Fiddle with the internal flash so that you can use the built-in ipkg on a jffs2 mounted flashdrive
  • Mount an USB stick, download ipkg-opt and work from there

I choose the latter. Primarily due to the fact that, that option gave me 4GB of space in /opt. It is actually quite simple

dd-wrt usb flash

dd-wrt usb flash

You then install ipkg-opt and companion tools (uclib-opt). You can use this wiki post on the dd-wrt wiki.

After that you can install all your extensions through ipkg-opt (or download them by hand). For my DNS resolver needs I choose the wonderful dnsmasq software. It acts as DNS/DHCP and TFTP software. From my router

root@dd-wrt:/opt/sbin# ipkg-opt list | grep -i dnsmasq
dnsmasq – 2.58-1 – DNS and DHCP server

The observant reader noticed that dd-wrt calls /opt/etc/config/startup in the screenshot abov (after having mounted /opt). This script is the startup script of all your /opt related stuff. I went with something like

#!/bin/sh

unset LD_LIBRARY_PATH
unset LD_PRELOAD

[ -e /opt/etc/profile ] && mount -o bind /opt/etc/profile /etc/profile

grep nobody /etc/passwd > /dev/null
if [ $? -ne 0 ]; then
echo “nobody:*:65534:65534:nobody:/var:/bin/false” >> /etc/passwd
fi

if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
[ -x $f ] && $f start
done
fi

and have a

root@dd-wrt:/opt/sbin# ls -al /opt/etc/init.d/S56dnsmasq
-rwxr-xr-x    1 root     root          215 Jan  1  1970 /opt/etc/init.d/S56dnsmasq
root@dd-wrt:/opt/sbin# cat /opt/etc/init.d/S56dnsmasq
#!/bin/sh

unset LD_LIBRARY_PATH
unset LD_PRELOAD

if [ -f /var/run/dnsmasq.pid ] ; then
kill `cat /var/run/dnsmasq.pid`
fi

rm -f /var/run/dnsmasq.pid

sleep 2
/opt/sbin/dnsmasq –conf-file=/opt/etc/dnsmasq.conf

Finally we are getting there. Before showing the dnsmasq.conf file, I will show a screenshot of the setup on the dd-wrt gui in order to use dnsmasq as DNS and DHCP server:

dnsmasq setup in dd-wrt

dnsmasq setup in dd-wrt

Notice how the built-in dhcp server is disabled and how I have choosen to use dnsmasq. Now onto the configuration of dnsmasq.conf:

root@dd-wrt:/opt/sbin# grep -v “^#”  /opt/etc/dnsmasq.conf  | grep -v “^$”
tftp-no-blocksize
log-dhcp
interface=br0
resolv-file=/tmp/resolv.conf
domain=zensonic.dk
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-lease-max=50
dhcp-authoritative
dhcp-range=lan,192.168.1.100,192.168.1.143,255.255.255.0,1440m
stop-dns-rebind
dhcp-host=00:22:FB:BB:C8:E0,kitchen,192.168.1.116,infinite
dhcp-host=00:18:71:E3:22:4d,dl145-1,192.168.1.117,infinite
dhcp-host=00:14:38:bf:a9:16,dl380g4i,192.168.1.119,infinite
dhcp-host=00:14:38:bf:a9:19,dl380g4,192.168.1.121,infinite
enable-tftp
tftp-root=/opt/var/tftproot
dhcp-boot=pxelinux.0

You will immediately notice a couple of things. Notice how I have the range setup for dhcp leases. Notice also how I have static leases. And finally notice how I have tftp enabled. Another blogpost on tftp another time (quite nifty for setting up servers on my vmware backend in minutes using kickstart, yast2 and solaris jumpstart).

You might think: where are the zone records? The answer can be found from the man page for dnsmasq

Dnsmasq accepts DNS queries and either answers them from a small, local, cache or forwards them to a real, recursive, DNS server. It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts.

So I simply add my infrastructure to /etc/hosts and run /opt/etc/init.d/S56dnsmasq.

I only had the need for running DNS locally, so my choice was dnsmasq. You can also install a full fledged bind if you have that desire

root@dd-wrt:/opt/sbin# ipkg-opt list bind
bind – 9.6.1.3-4 – Bind provides a full name server package, including zone masters, slaves, zone transfers, security multiple views.  This is THE

Brute force password cracking of ATA security locked harddrives

November 28th, 2011

Recently I found a x41 thinkpad in good condition, but with a locked 1.8″ drive. I google a bit and found that there is almost no chance of buying a new 1.8″ drive. So now what? I could mod the machine with SSD like this guy has done. Or I could try to crack the password of the 1.8″ drive. I’ll try the latter before I give in an mod the machine.

So how do I crack the password of a 1.8″ drive. You can buy all kinds of stuff of the internet. And lo and behold. Someone claims to be able to give you the master password if you give them some stash.

Instead of handing out my money to strangers on the internet, I read the ATA specs and tried to do it like this:

  • Realize that the drive is in maximum security mode. So you have to cycle the drive power for every X failed tries with the user password. Go for a security erase of the drive with the master password instead. Might be a harder password, but atleast I can try unlimited amount of times without the drive demanding a power cycle.

So I ended up like this

  • Download ubuntu 10.04. Create bootable usb pen.
  • pull out the drive of the x41
  • Boot the x41 of the usb pen
  • put the drive back into the x41 while ubuntu boots.
  • issue ‘echo “- – -”  >  /sys/class/scsi_host/host0/scan
  • download john the ripper from openwall together with a dictionary.
  • compile john the ripper.
  • Figure out details of the drive with hdparm -I /dev/sda
  • Execute this command: ./john –wordlist=./all –stdout | while read pass ; do hdparm –security-erase “$pass”  /dev/sda ; if [ $? -ne 5 ]; then exit 1; fi ; done > /dev/null 2>&1

Presently I brute force attack the drive with 1000 words pr. second. Might not yield anything. But atleast I tried ;-)

 

RHEL5 kernel versions vs. update levels

September 23rd, 2011

Nothing special. I just couldn’t find this easily on the net

2.6.18-8.el5 (General Availability)
2.6.18-53.el5 (RHEL5.1)
2.6.18-92.el5 (RHEL5.2)
2.6.18-128.el5 (RHEL5.3)
2.6.18-164.el5 (RHEL5.4)
2.6.18-194.el5 (RHEL 5.5)
2.6.18-238.el5 (RHEL 5.6)
2.6.18-274.el5 (RHEL 5.7)

Using an Linksys E3000 AP as a general linux server

September 21st, 2011

Recently I said farwell and thanks for all the fish to my old Linksys WRT54G router(s). They served me well for many years, but end the end they lacked IEEE 802.11n and 1000BASE-T. After looking around I decided to buy the Linksys E3000 AP. It stayed within my budget, had almost all features I desired and could also run community based firmware.

I tried to run with the built in firmware. And I did. For a month or so. And then I gave in and installed dd-wrt on the thing. The built-in firmware works and is stable. But boy it lacks features!

Getting dd-wrt onto my AP was easy due to this tutorial. After I got dd-wrt onto the AP I had myself a full blown linux distribution. Comparing the E3000 with its 240MHz MIPS cpu and 64MB memory to my first PC with its 66MHz intel 80486 with 4MB memory made me smile ;-)

root@dd-wrt:~# cat /proc/cpuinfo
system type             : Broadcom BCM4716 chip rev 1
processor               : 0
cpu model               : MIPS 74K V4.0
BogoMIPS                : 239.20
wait instruction        : no
microsecond timers      : yes
tlb_entries             : 64
extra interrupt vector  : no
hardware watchpoint     : yes
ASEs implemented        : mips16 dsp
shadow register sets    : 1
VCED exceptions         : not available
VCEI exceptions         : not available

Having such a small nifty general purpose platform at my disposal ofcourse made me think what I should use it for (besides moving bytes around in my house). I found these things I want to and/or have implemented on it:

  • Local DNS server. I have many many projects brewing all the time and have vast amount of hardware. I utilize a DNS server to keep track of my ip assignments, either static or through DHCP. Running a DNS server on the router is a must.
  • PXEBOOT server.
  • TFTP server.
  • NFS server
  • DansGuardian filter

I will write a blog entry or two about how I have setup the router to run the services above. Nothing that will revolutionize the world, but not exactly plug and play either.

2 years without Coca Cola

September 1st, 2011

Just a post to myself about that two years has passed since i stopped drinking coke. I will celebrate today and then try to find a way to stay away from coke in my daily life.