History Meme

Ok I give in. After seeing this on many blogs over the last 48 hrs I have to give in.

history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s\n ",a[i],i}}'|sort -rn|head

Macbook Pro
98 ls
96 cd
30 ping
29 ssh
26 du
22 sudo
20 rm
19 cvs
18 top
18 sed

Linux box:

88 ls
63 cd
33 ssh
31 su
30 vi
24 du
17 exit
16 ./Encode2flv.sh
13 rm
13 mv

Even on my Mythtv box:

33 ls
23 df
22 su
19 sudo
12 firefox
9 mplayer
9 cd
7 killall
5 vi
5 tail

Not that informative, but a good laugh! Although I do have to ask myself.  Why do I need to look in a directory so many times?  Another question that comes into mind is that I think I do too much stuff as root.  There’s a lot of commands that I know I run, that are missing there.

Linux to OS X

It’s been 12 months almost in my new job, and those 12 months have seen a slow migration to having my MacBook Pro(MBP) as my main computing plaything. Previous to this I’ve always had a Windows laptop as a business machine and consequently for reasons not worth going over, my Linux workstation was my main machine. However, now the MBP has slowly, but surely surplanted it as my main machine.  Obviously for work but for personal stuff too.

I’ve spent nearly a grand this year upgrading the Linux box, and to be honest it was money poorly spent. OK currently once again I have a pretty fast machine: 3.6Ghz dual Xeons, 6GB Ram, reasonably fast graphics and a 0.5Tb RAID10 array, but even though it’s connected to a pair of Dell 24″ widescreen LCDs, I seem to spend much of my computing time sat in front of the telly with the laptop, placed where it’s named to be placed. Sometimes even in the local pub/cafe connected to the free wireless.

Furthermore now that I’ve got the 1.4TB ReadyNas+ as the central storage in the home LAN, and moved the DNS server over to the DD_WRT running WRT54GS , the machine does not even act as a server. 2 years ago I would almost get the Jones if the machine was down. Now I even turn it off sometimes. What a change!

I really enjoyed the upgrading, and I suppose this enjoyment from rebuilding the hardware is worth it. Although something that I did not enjoy was the money and time spent quietening the dammed machine, as working from a home office the constant hum is an annoyance.  My next challenge is that I really do want to get the machine booting from a RAID10 array though (small raid1 /boot partition with 2 RAID10 array’s for everything else). Perhaps having the MBP and other reliable storage will stop me panicking during some tricky rebuild, when I remember that my backup is quite old! Although there’s nothing quite like the live reshaping of a system, when you have no backup

Incremental backups using Rsync

Many thanks for Raj for pointing me to this great tutorial on making incremental backups using Rsync.

I’ve been using rsync for a while for backups now. First my Macbook Pro’s Docs and Scripts directories are synced with my Linux box’s (initiated by a Cron job on the Linux box). Then I irregularly backup my Home directory to a USB disc. I’ve recently moved this to the ReadyNas+ box, although its horsepower is a little slow for rsync over ssh. I read a few emails on the Linux Raid list a while ago intimating that rsync incrementals were possible by creating a hardlink to the previous directory backup and as a consequence only putting new files in the new directory. However, laziness has fought against motivation and it’s not got done.

This nice tutorial should fight against the inertia and make me do it.

Missing XInputExtension when using XForwarding over SSH

I recently had some issues whilst trying to tunnel an Xsession over to another machine (basically as I was too lazy to walk downstairs to my Mythtv box to use xxdiff to analyse 2 config files).

Using this command
ssh -X mythtv

resulted in many error messages once i ran any app that would have launched a Xdisplay:

mythtv ~ # xxdiff httpd.conf httpd.conf.old
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
Major opcode: 55
Minor opcode: 0
Resource id: 0x1a6
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 2
Minor opcode: 0
Resource id: 0x1a6
Xlib: extension "XInputExtension" missing on display "localhost:10.0".
Failed to get list of devices
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 2
Minor opcode: 0
Resource id: 0x1a6
X Error: BadWindow (invalid Window parameter) 3
Major opcode: 2
Minor opcode: 0
Resource id: 0x1a6
X Error of failed request: BadGC (invalid GC parameter)
Major opcode of failed request: 60 (X_FreeGC)
Resource id in failed request: 0x3200000
Serial number of failed request: 131
Current serial number in output stream: 133

Apparently the current version of SSH limits the X Window extensions that can be used. XInputExtension is one of these. If instead you use “-Y” it will accept ALL these X Window extensions and it works

ssh -Y mythtv


Laziness promotes education.

Screencasts of Installing MythTV Via MythDora 4.0

Slashdot | Screencasts of Installing MythTV Via MythDora 4.0

Seen on /. a new @boot and install from a single CD” MythTV distro. This time based on a more mainstream RedHat/FC one.

I’ve been using a MythTV box as my ONLY TV for about a year now. With 2 Freeview (UK DVB-T) tuners and a single tuner connected to a dish with multiple LNB’s pointing at Hotbird and Astra. I can wholeheartedly recommend it. A fine piece of software



Incidentally thanks to a cool new utility I discovered about 10 mins ago, I am now typing this on my Macbook with the keyboard attached to my Linux box. How cool is that?

Basically I’ve been looking for a decent DVI/USB LVm, but appalled at just how expensive they are. So I’ve been looking for a software solution. This is effortless to setup, and seems very robust.

The utility has a client server type connection. Running on OSX, Linux and/or Windows. You run the server on the machine with the physically connected mouse and keyboard, and a client on each machine that you want to share the mouse/keyboard to. It also shares the clipboard too. The URL above was copied from Firefox running on the Linux box, and pasted into the Macbook.Took me 5 mins to setup

The only downside I can see so far is that the Apple CMD and OPTION keys don’t work on the Mac. I guess since the linux box cannot recognise these to pass the key strokes across.
Am impressed. Of course now I need to buy myself a second 24″ widescreen monitor.

RAID10 over 6 devices

I’ve been struggling to find the best layout for my 6 drive RAID10 device: I settled for near with 2 copies, and a 1M chunksize. As far as I understand this I get the r/w speed equivalent to RAID0 with this. It means that each block has two copies, which are striped across 2 drives. So you get the RAID0 speed, with the redundancy of RAID1. Plus since this is kernel RAID10, it’s a lot easier to create and more flexible than a mirror of raid0 devices.
mdadm --create /dev/md1 --chunk=1024 --level=raid10 --layout=f2 --raid-devices=6 /dev/sd[defghi]1

So far the speed seems to be OK. Nothing at all spectacular though. At the moment I think my limitation is that I am running a 64bit PCI-X u320 card in a 32bit PCI slot since my motherboard only has these…. I need to get myself a PCI-X dual socket 604 motherboard. Trouble is these are quite expensive…..! In my quest to silence the machine I replaced the fan in my Graphics card with a quieter one. Unfortunately whilst doing so I knocked of a small component. The card works fine except that I get visual aretefacts on any hw accelerated graphics now. I’ve alwasy steered away from upgrading my motherboard due to the fact I would need to also buy a new GPU to go with PCI-E slots. But if this is now damaged perhaps I should splurge out. Hmmm.

HASH key on a Mac Keyboard with Linux

Right I’ve had a bit of a palaver with the HASH key on my Mac. Well actually with a Mac keyboard attached to a Linux box. After getting my nice new MacBook Pro, I had a issue trying to find the hash key. (How long until my nice new MacBook Pro loses the nice new?). Anyway to cut a long story short it’s ALT + 3. Not too much hassle, and apparently a common thing with Mac UK keyboards.

When i finally settled down to working, I’ve started plugging in the MacBook to my Del 24″ widescreen monitor, and sharing the keyboard and mouse via a cheap USB switch. So with two clicks I can switch between the mac and My Linux box, without the vast expense of a DVI/USB KVM (do they even exist?). The Dell has a VGA and DVI input. so that’s very convenient. To make it easier I’ve plugged in a Apple keyboard to the switch. Linux behaves quite well with this. However, for the life of me I’ve not been able to fathom out how to type HASH in linux with the Apple keybaord attached. Untuil now….

It’s CTRL + SHIFT + 3

How odd!