then in another window
gives me watchable live tv.
I think I should really be using some variety of vlc but that's another day's work
A blog, no more need be said.
I think I should really be using some variety of vlc but that's another day's work
This is the concluding part of my earlier post on recovering after wiping the partition table and the first 30k or so of my harddisk. It has a happy ending.
It didn't take much more effort in the end to rebuild my laptop's partition table. It turns out that gpart was not terribly useful as I had used extended partitions and nuked the first one. It found my 2 linux partitions but refused to rebuild the partition table. It also outputs the location of the partitions in MB which is no use at all. This patch
Next I used sfdisk -d /dev/sda to dump a partition table from another machine as an example and then edit that to look like
I spotted a focaccia (Italian bread with veggies and maybe bits of bacon) shop while in Courmayeur a few days ago and got a great idea for a franchise. Kinda along the lines of It's A Bagel. As with all franchises you need a snappy name. I think
Not sure if "complete" is the correct term but I mean a parser that finds all possible parses of the stirng by the grammar. Usually very expensive but by memoising the application of rule A at char N in the string it becomes cheaper. The key is the value that you store. For memoised recursive descent, you just store the parsed value or FAIL. For this you have to store an object that can generate parsed values in the correct order and which caches any previously generated ones. Not so bad really. There are some questions though about quantifiers. It might be worth trying to share data between X{4} and X{5} applied at the same char. But maybe not.
Does anybody ever make a recovery disk these days after installing Linux. I certainly don't and now I'm regretting it! It's too inconvenient to root out a floppy or a blank CD and even if I had made one, I wouldn't have it with me here in Tokyo so I'd be just as badly off. Basically they are not terribly helpful.
The amount of non-redundant information stored on a recovery disk is quite small, basically it's your MBR and partition table and maybe some special boot params. Really all you need is a safe copyof your MBR and partition table. With that you can boot from a generic recovery CD, fix the partition table and MBR and then reboot as normal (or maybe fix the data on your partitions first now that you can access them).
So the world would be a better place if instead of offering to make a recovery CD, Linux distros offered to email you a copy of your MBR and partition table. If you use gmail then that's the end of it, it'll be there in your gmail account should the need arise. Download it and use dd to install it. Bingo. If you store your email on the computer itself then you need to copy that mail to somewhere else but that's still much easier that creating a floppy/CD that you're going to lose.
I'm off to file some bugs (just as soon as I get my data back!).
Doh! While trying to get my slax distro onto a USB key, I fucked up big time and dos formatted (mkfs.vfat) my hardrive (my head is still in the era where hard disks are hdX, not sdX).
gpart can try to guess where your partitions were but it doesn't know LVM2
LVM2 partitions have a sector which begins with "LABELONE" as documented in these slides (thanks to agk on #lvm!). I invoked the following script with ./lvm.pl /dev/sda to get a list of all the sectors that contains that string.
Stuffing all those sector numbers into $ss and then doing
I've built a headless box that's going to live in Japan when I go back to Ireland. There'll be no one in Japan to fix it if it goes bad. The best I can do is get someone to insert a CD and reboot but after some searching and some asking it seems none of the bootable CDs will boot the machine into a useful state for remote admin. slax was recommended to me on TLUG as a good customisable distro. It turned out to be pretty easy thanks to slax's rootcopy feature which allows you to make minor modifications without digging around (too much) in the compressed package files. I've broken the process down into a few steps, with a quick bash script for each one.
mkdir slax cd slax
You need slax-frodo-x.y.z.iso, you can get it from the slax download page. The frodo edition is the minimal version on which all the others are based.
This is necessary because we need to add some files. So I ran this as ./prep_image.sh ~/slax-frodo-5.1.8.iso
It's disabled by default (rc.sshd is not executable), so I replace it with one that is executable. I also turn off password logins because everyone knows the root password for slax. Finally I include an authorized_keys file so that I can ssh in with my ssh key. I ran this script as ./enable_ssh.sh ~/.ssh/authorized_keys
The machine is on a cable modem and doesn't have a fixed IP, so I need to know where it is. I downloaded the ddclient module and the following script puts it in place, puts your ddclient.conf file into /etc and makes sure that it gets started on boot (I assumed it would start by itself actually, I'm not sure if that's a bug or not). I invoked this script as ./ddclient.sh ddclient.conf
There doesn't appear to be an editor in the slax-frodo image so I grabbed joe and copied the .mo into slax/base/
So far everything we've done has been in a rootcopy/ directory in the current directory. Now it's time to move that into place in slax/ and invoke the iso building script with the following script which outputs it to slax-ssh.iso in the current directory.
qemu -cdrom slax-ssh.iso should boot up. I never figured out how to get qemu bring up a real IP interface - the virtual machine can connect to the outside world but I can't connect to it. I tested it by setting up an ssh tunnel connecting port 22 on the VM to port 2022 on the host machine with ssh -R2022:localhost:22 fergal@my.host.machine.ip. Then I did ssh -p 2022 root@localhost with my ssh keys loaded and in I went. When my keys aren't loaded, I don't get a password prompt so I can't get in. Perfect.
Finally got deep onto code.google.com/hosting/ and onto the python package repo CPAN-alike thingy, which means that it's just an easy_install deep away whenever I want it.