April 8th, 2008 cmsj
You have new hardware (most likely server).
You pop in a debian/ubuntu installer CD, tell it what kind of keyboard you have and expect it to scan the CDROM for packages, but….uh-oh, it can’t find the CD!
What do you do?! Well, realistically there’s not a lot you can do to make it work, but you can do a lot to help get it fixed.
You need to pull off /var/log/syslog, the output of lspci, lspci -v and lspci -vvnn.
You may very well find yourself having a problem with that though, because you’re still pretty early in a typical linux boot process, so you probably don’t have any disks mounted and you may find yourself missing any modules to make that happen.
You should have usb-storage.ko though. That and isofs.ko.
Can you see where this is going? :)
find the .udeb’s on your install CD with a working computer, ar -x the core fs modules one and pull out ext3 (and jbd and mbcache), or vfat and its dependencies. put them in a directory, then do mkisofs -o /dev/usbstick1 /path/to/modules.
You now have a partition on your USB stick that is an ISO9660 filesystem (ie a CD). Obviously make sure you don’t do this on a USB stick you care about the contents of.
Chuck the USB stick into the broken server, modprobe usb-storage, mount the newly appeared partition and copy the modules over to the right place in /lib/modules/. Unmount the USB stick, modprobe the drivers and now you can put in an ext3/vfat formatted USB stick and you have somewhere to write the debugging information to!
Easy! :) Now file a bug with the debugging information you collected.
Posted in FOSS, Techie, Ubuntu | No Comments »
February 7th, 2008 cmsj
Maybe you’re fresh out of college or university, or maybe you just love tinkering with computers so much you didn’t bother with stuffy education.
We’re looking for someone to take on a junior role in our sysadmin team, so if you’re interested, take a look at the description and mail our lovely HR people!
Posted in FOSS, Techie, Ubuntu | No Comments »
January 31st, 2008 cmsj
Some administrivia about my PPA builds of Terminator.
Firstly, and somewhat late (for which I apologise), the 0.7 release should be available shortly from the PPA. It’s just been accepted, so should be built for gutsy soon.
Secondly, as some people may have noticed, Terminator is now included in the Universe repository of hardy (for which I humbly thank all involved in making it happen).
When hardy is released, I will remove terminator from my PPA. at that point, we can consider publishing further gutsy packages in the Terminator team’s PPA, however, I’m not hugely keen on supporting old distro releases that I don’t run myself anymore.
Posted in FOSS, Techie, Terminator, Ubuntu | No Comments »
January 14th, 2008 cmsj
I have a fair stack of data that I quite like, some of which is vitally important, stored in multiple places and generally not at concern for loss without some very bad things happening already.
The rest I’d just like to keep. For example, I wouldn’t cry if I lost all my uni work, but it would be a shame. Same for the working emulation of my trusty Amiga that I used for so long, but now barely remember how to use.
So, not wanting to trust it all to a single hard disk, I bought a second so I can could clone the data onto two disks with RAID1. Not a problem in Linux thanks to software RAID. I knock up a RAID1 with a single partition on the new disk (which the tools like doing as much as they make sandwiches, grr). rsync across the existing / to the raid volume, modify fstab, grub and maybe something else and reboot expecting tenshu to finally live up to its name…
Except that’s not its name.
Not when it’s booting.
It turns out that having created the RAID volume while fully booted, it had been tagged as being for a machine with a hostname of “tenshu”. The initramfs does not know your hostname because your hostname is stored on your root partition, which is a RAID partition that hasn’t been mounted yet. It is possible for the initramfs to have a hostname, and I expect it might even have a kernel commandline option to specify it, but either way it’s not there by default.
As any string comparison function will tell you, “tenshu” is not an acceptable match for “(none)”.
So to fix this, boot the system and it should sit for ages waiting for the RAID arrays to assem ble (this timeout is *far* too long. what the hell takes this long to be detected by the system?!). After a while it will get bored and give you an initramfs shell. Busybox to the rescue!
I suspect you can run mdadm -A /dev/md0 --auto-update-homehost, although I ran mdadm -A /dev/md0 /dev/sdb3 --update=homehost to be specific and because I found those options first.
Reboot and bam, the orange bar of progress skips up merrily.
Assured that my data is safe on the new partition, I can now proceed to trash the original disk and grow the RAID1 to include it.
Posted in FOSS, Techie, Ubuntu | No Comments »
September 21st, 2007 cmsj
If you’ve been over to my Terminator page you may have noticed that I use Launchpad for basically all of the services of releasing.
Taking this one step further, I have been building packages for Ubuntu Gutsy with Launchpad’s excellent PPA service. Details for how to get your Terminator goodness from PPA have been added to the Terminator Homepage.
Posted in FOSS, Techie, Terminator, Ubuntu | No Comments »
August 22nd, 2007 cmsj
I use a docking station with my laptop. When it’s in the dock it has a wired connection, otherwise it’s just wireless.
Since most of my work involves ssh and I tend to have several long running ssh sessions at a time, it’s quite annoying if I quickly undock to go and work in another room and have to reconnect everything.
Of course, this is entirely fixable in Linux (albeit by way of some slightly dodgy hackery). Network Manager is just about quick enough to pick up a new connection before TCP connections time out, and Linux’s routing stack is somewhat forgiving about connections switching interface. So, with that in mind, and using a DHCP network - all you need to do to preserve a connection across switching interfaces is have the same IP address on both. Sure you could go and hack at the DHCP config to make sure it serves the same IP to both of your MAC addresses, or you could just have both interfaces share the same MAC. I’m quite sure this breaks all manner of rules, conventions and RFCs, but the point is that it works and it makes my life easier :)
I’ll happily take suggestions for a better way to override the MAC address, but this is how I do it:
-(cmsj@waishou)-(~)- cat /etc/modprobe.d/local
install ipw2200 /sbin/modprobe --ignore-install ipw2200 ; ifconfig eth1 hw ether XX:XX:XX:XX:XX:XX
So in this case I am setting my wireless card’s MAC address to that of my wired interface (replace the XX:XX bit with the MAC from your other interface).
This worked fine for me in feisty, but was failing in gutsy and my wireless interface was coming up as eth1_rename. Obviously something new and strange was going on.
It turns out that, in the same way we handle disks by UUID, we now handle network interfaces by MAC address, so udev was getting a little confused.
A quick change of /etc/udev/rules.d/70-persistent-net.rules to stop recognising them by MAC address and start looking at the driver name instead, and it’s all fixed. This is how the file looks now:
-(cmsj@waishou)-(~)- cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, probably run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# PCI device 0×8086:0×1077 (e1000)
SUBSYSTEM==”net”, DRIVERS==”e1000″, NAME=”eth0″
# PCI device 0×8086:0×4220 (ipw2200)
SUBSYSTEM==”net”, DRIVERS==”ipw2200″, NAME=”eth1″
I’d be wary about doing this on a desktop system where interfaces are more likely to change, but this is a laptop and I am quite certain the e1000 NIC isn’t going to move on the PCI bus!
So there you have it :)
Update: It’s worth noting that sometimes this will confuse some networks (e.g. I recently confused a hotel wired&wifi network into not talking to my laptop anymore and had to change both the wired and wireless MAC address to different addresses)
Posted in FOSS, Techie, Ubuntu | No Comments »
July 11th, 2007 cmsj
How would you shrink the root file system of a remote machine? Of course the easy answer is to boot into a rescue environment and do it (because you can’t shrink ext3 online).
If you have a good KVM or ILO setup, you already have a rescue environment of sorts - initramfs.
Chuck “break=mount” on your kernel commandline and the initramfs will drop out to a shell before it mounts the root filesystem. You can now mount the root fs manually and copy out the required tools/libs (e2fsck, resize2fs, fdisk and their libraries, in this case), then unmount the root fs.
Now, with appropriate $LD_LIBRARY_PATH mangling you can run the extracted binaries and operate on your root partition with impunity
Posted in FOSS, Techie, Ubuntu | 1 Comment »
June 13th, 2007 cmsj
I usually have at least 4 terminals visible on my screen at once. Each one is running screen(1), and each screen has probably at least 3 or 4 different things going on in it (usually sshing to servers).
Once you are up to about a dozen or so shells spread across 4 terminals it can get quite interesting to remember where you left the one you are looking for.
Since screen can have a status line which lists its screens, and it is possible to change their names, I figured it ought to be possible to have ssh set the title of a screen when it connects to a remote machine. This would make things a lot easier to find, as well as being a cute hack.
It turns out that it is indeed possible…. to a degree.
ssh lets you specify a command to be run on the local machine after a connection is established, which is the ideal place to do this kind of thing. Sadly it doesn’t help you out by setting any useful environment variables (such as the machine you just ssh’d to). You’re probably thinking “but you know which one it is, you just ssh’d there!” and while that is true, it’s not very easy to handle programatically. Mainly because it means parsing the arguments to ssh, which is no fun at all.
So, rather than do that, I am making the blanket assumption that the final word on ssh’s command line is the host you are sshing to. If that is not true (e.g. you are doing “ssh someserver rm /etc/foo”) you will get whatever the last word actually is, sucks to be you.
Also, if you use ProxyCommand, you really don’t want the second ssh to do this, because it will confuse the first one and you’ll never establish a connection, so detecting the type of output ssh is connected to is necessary.
Thanks to the many, many people I’ve consulted in the process of figuring this out. It doesn’t seem like anyone has done this before (at least I can’t find an example on google. There are some very similar things though), so after running out of ideas myself I started polling the community and got enough nuggets of inspiration back to produce a workable solution.
You will need to make sure screen is configured to show a status line (otherwise you won’t see the screen names, except in a C-A-” or similar). Then drop this into ~/.ssh/config:
PermitLocalCommand yes
LocalCommand tty -s && cat /proc/$PPID/cmdline | xargs -0 | awk '{ printf ("\033k%s\033\\", $NF) }'
(yes, that is hacky and disgusting. I am tempted to look at patching ssh to provide the hostname to the spawned LocalCommand shell, but right now the above config seems to be the best way of doing this).
Posted in FOSS, Techie, Ubuntu | No Comments »
June 7th, 2007 cmsj
I’ve yet to complete this, because I stopped my attempts last night when I reached an unusual situation.
Specifically, I was doing the partitioning manually, but the two visible disks had no partition tables. Not wanting to trash the PS3 disk I didn’t let it create the tables, so had to abort.
After consulting with the very helpful Colin Watson, it turns out that the disk Ubuntu sees as sda is not the whole PS3 disk, it’s the Other OS partition virtualised to look like a whole disk. It is therefore fine to create a partition table and proceed with the install, which I will do tonight.
(I’m not sure yet what sdb is, it smells like the PS3s internal flash and again I’m not sure if it’s wise to mess with it)
UPDATE: The disks that Linux sees are virtualised by the PS3 (they’re actually just partitions made to look like whole disks), so it is fine to make the partition tables (or indeed let the installer do automatic partitioning). The bug where the installer hangs at 15% is due to the low RAM in the PS3. Stop some services (cupsys and hplip are good candidates) and remove some things from your session (update-manager and gnome-cups-icon, for example). Removing applets from the panel is not a bad idea either, and don’t run anything else while you are installing. Of course you could plug in a disk of some kind and set up swap, but this bug makes that quite hard at the moment.
Posted in FOSS, Games, Ubuntu | No Comments »
June 3rd, 2007 cmsj
The title says it all really. I’ve banged on about games a bit and now it’s time to do something involving curiosity!
So I know how to, should i want to for any reason, this is how you can make videos that are playable on a PS3 (only tested on firmware 1.80). Note that it doesn’t transcode to H.264, but instead uses a lesser MPEG4 profile of some kind (mpeg4 appears to be entirely too complicated to figure out!).
This mostly comes from here, but the gist is that you grab a specific version of ffmpeg from SVN and compile it against a variety of media libraries from multiverse. This makes me think ubuntu should have a bleeding edge version of ffmpeg in multiverse that links against the libraries there - if licences allow for it.
For what it’s worth, this is the command line I’ve been using with it (note that it will strip surround audio down to 2 channel stereo. That’s all i have, so I haven’t bothered to figure out anything better).
ffmpeg -y -i /path/to/source.avi -acodec aac -ab 192kb -vcodec mpeg4 -b 1500kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -title "Blah 2: The blahing" /path/to/output.mp4
Posted in FOSS, Games, Ubuntu | 2 Comments »