Aquarionics

Home | Projects | Archives | About Aquarionics | About Aquarion

A tale of two operating systems

My main machine is primarily used for websurfing, ssh and games, and because the first two are OS agnostic and the third isn’t, it runs Windows 7. Clare’s PC, however, runs Windows XP for games, and she would like it also to run Ubuntu, because it’s the OS she’s most familiar with.

(Yeah, I know).

So while she’s away at a LARP event for the weekend, I decided it was a good time to put the newest version of Ubuntu on her machine. When I built the Windows install, I left a partition at the end to put it on, so I booted from my handy 9.09 CD and installed it there. Ran though the install, answered all the questions, booted into shiny Linux install. Boom, multiboot.

No, wait. Hmm. The install process usually recognises Windows installs and adds them to the menu. Where is it?

Aha, they’re using the new version of grub. Maybe the detection’s not quite perfect. I’ll add it manually.

Menu item doesn’t work. Odd.

What do you mean “isn’t a valid NTFS drive”?

There is nothing quite like the sinking feeling when you realise that the drive that isn’t working anymore is the one that has your SO’s data on it. I mean, there are backups in place and everything, but still. There might be stuff not backed up.

Eep.

This is when I discovered that Partition Magic-, my go-to software for “My Windows partition is hosed” – no longer exists, and that my old copy no longer works. So, I have a weekend of alternately trying not to think about it and tracking down things that might work that have no possibility of hosing the rest of the drive (I’m still pretty sure it’s just the partition table at this stage).

Fixed it in the end, though. I’d tried the Windows XP Recovery Console, because I’d assumed it was just the MBR broken and “fixmbr” repairs that. I had, however, not gone far enough.

Microsoft Windows XP(TM) Recovery Console.
The Recovery Console provides system repair and recovery functionality
Type EXIT to quit the Recovery Console and restart the computer.
1: C:\WINDOWS
Which Windows installation would you like to log onto
(To cancel, press ENTER)? 1
C:\WINDOWS>fixboot
The target partition is C:.
Rre you sure you want to write a new hootsector to the partition C: ?
The file system on the startup partition is NTFS.
FIXBOOT is writing a new boot sector.
The new bootsector was successfully written.
C:\WINDOWS>_

And relax.

March 15, 2010 - 7:15 AM Comments (4)

DNS for DHCPd in the FUTURE

I have a dream.

My dream is that one day, a giant carrot carved into the shape of a submarine will sail down the Thames before sinking below the waves to take back America using only the power of latin.

But also, I want for machines that are on my local network to be accessible as “$hostname.d.water.gkhs.net” to everyone else on the same local network. That’s a more technical dream, and this is how I did it:

first, we google “smoothwall dhcp to dns”. The first result seems to be exactly what we need, so we click it, and find outselves on Kryogenix, the website of Aquarius, who I have known for somewhere close to a decade, which is an aeon in internet time. The article is now close seven years old, and while its lost its styling, it is (a) entirely what I want to do (b) comprehensive and (c) now completely broken.

The new page that Douglas Warner’s dhcp2dnrd script lives is now somewhere else on the site, and appears to be having some kind of formatting problem, but can still be downloaded from this direct link. At the bottom of this is a link to my own version of this file, with all these changes already made.

Although the the class::date problem no longer exists, a few other things that have changed since the article was released. So, this is what to do to get it working. Most of this is built on the stuff sill said already in his article, just updated for Smoothwall 3.0:

Log in to your Smoothwall box over ssh (If you cannot do this, you need to go to the web interface, Services, Remote Access, and tick SSH. Then, using your favourite terminal, log in to the same IP, port 222. Username root, password whatever you chose when you set up the firewall so long ago. I do hope you remember it.

mkdir dhcp2dnrd; cd dhcp2dnrd # (Being neat and tidy is good)

wget http://www.silfreed.net/download/progs/dhcp2dnrd.pl
wget http://search.cpan.org/CPAN/authors/id/D/DL/DLUX/Class-Date-1.1.9.tar.gz

tar xzvf Class-Date-1.1.9.tar.gz # to extract the perl module.
mv Class-Date-1.1.9/Date* /usr/lib/perl5/5.8.8/Class/ # to copy the perl module in place
vim dhcp2dnrd.pl # Or use your personal favourite editor. Unless it’s emacs or something, because I don’t think that’s installed.

Personally, I change the “home.net” line to “d.water.gkhs.net”, because it fits my network model better. You do need to change the “$dhcpdpath” to “/usr/etc/dhcpd.leases”, however.

Finally, smoothwall no longer uses dnrd, so either comment out the entire bottom of the file after “# restart dnrd”, or rewrite that to work. I’ve modified the code in mine to “work”, but it’s mostly cargo culty.

Downloading Douglas’ script, I found it had windows line endings, which confused me. You can convert it back to unix format in vim with “:set fileformat=unix”. If you’re using mine you shouldn’t need to.

Finally, run it, check the output of /etc/hosts is roughly what you expect, then throw the script into cron like this:
cp dhcp2dnrd.pl /etc/cron.often/

And that appears to work. You can grab my copy of the code from github should you want to.

Tags: , , ,
March 3, 2010 - 5:44 PM Comment (1)

Hate Technology

  1. Thursday, 22:00: Accidentally buy an XBox 360
  2. Decide it needs to talk to the network (before playing any games on it)
  3. Current Network: Desktop (“Tsunami”) & 360 plugged into Belkin Wireless Router, laptop and Wii talk to it remotely. Cable modem is upstream on Router.
  4. 360 cannot phone home due to closed ports.
  5. Open ports
  6. All ports not documented.
  7. Fuckit(1): 360 in DMZ
  8. 360 can talk to home for twenty minutes, then cannot anymore.
  9. Reboot router
  10. Reboot modem
  11. Another 20 minutes
  12. Fucket(2): Play GTA4 for a while, ignore the network. (Friday, 02:00)
  13. Saturday, 06:00: Up early, decide to fix network.
  14. Fiddle around with ports for a while, decide the route is at fault.
  15. Attempt to reroute everything though just a hub.
  16. Realise that takes away the single point of entry for the cable modem, which can therefore not connect.
  17. Also: No DHCP server. Things complain at me.
  18. Fortunatly, I have a spare firewall box (“Boilingpoint”) which still has IPCop on it from when it was my firewall in Bedford (and, before that, in Reading and Cambridge)
  19. Boilingpoint has a network card and a PCI ADSL modem. On-board motherboard has no network. Turn out boxes of hardware looking for spare network card to use for upstream connection.
  20. Fail. Find old desktop machine whose motherboard does have onboard networking, and cobble together bits of it and Boilingpoint until it works. (07:00)
  21. (07:10) Machine stops booting (Fans spin, nothing happens), fiddle with connections and reseat ram to fix it.
  22. (07:20) Machine stops turning on at all.
  23. Transfer everything back to Boilingpoint, which at least boots, for fucks sake.
  24. (07:45) Get tea, shower, email, clothes.
  25. Find spare network card in sock drawer.
  26. Install network card into IPCop
  27. Attempt to reconfigure IPCop as GREEN/RED instead of GREEN/RED
  28. Discover I can’t remember the root password for boilingpoint (Installed ~2003 and has Just Worked since then)
  29. Decide to screw this for a game of sontarians, and install Smoothwall instead (IPCops website is down. Brand loyalty is strong within me. Plus, Neuro’s been recommending Smoothwall instead forever)
  30. Realise I can’t install Smoothwall for the same reason I can’t bypass root on boilingpoint: because the reason it became a firewall box was that the PS/2 ports don’t work anymore, so cannot access it locally.
  31. I don’t have a USB keyboard.
  32. Plug the hard drive and network cards from Boilingpoint into Tsunami (Desktop) and install Smoothwall onto hard drive on that
  33. Transfer everything back over.
  34. This doesn’t work due to hard-drive naming.
  35. Cannot SSH into new box because default smoothwall install doesn’t have SSH.
  36. Cannot access web interface either. Don’t know why.
  37. Resolve to borrow a USB keyboard from someone.
  38. Now have to leave for Gamecamp London. Do so (10:00)
  39. Gamecamp is awesome. I’ll write more about it soon.
  40. After Gamecamp, go to party. After party, borrow USB keyboard from friend. Get home (02:00)
  41. Discover that Boilingpoint predates having USB ports on the motherboard.
  42. Search for PCI USB card we used to put a USB ADSL modem onto boilingpoint before we got the PCI modem.
  43. Fail
  44. Swear. Go to bed.
  45. Have another thanksgiving dinner that couldn’t be beat, and didn’t get up until the following morning.
  46. This morning: Decide to fix this once and for all.
  47. Search for ages. Find USB card in box with university diploma in it, on top of a book case.
  48. Repress momentary flash of optimism.
  49. Install PCI card, configure Smoothwall
  50. Access web interface.
  51. Configure SSH!
  52. Configure DHCP!
  53. Connection to cable modem (RED) doesn’t work.
  54. Swap network card roles a bit to see if it is a driver issue.
  55. Isn’t.
  56. More tea.
  57. Remember that ex-NTL Virgin Media customers will still suffer from the fact that once Virgin have a MAC address for the connecting machine, they won’t accept a connection from anything else.
  58. Put network back together. Access interwebs.
  59. Discover that Smoothwall corp count MAC spoofing as a premium fucking feature, not to be fucking included with the free fucking distrifuckingbution.
  60. Am a little put out by this.
  61. Find out how Smoothwall works a bit, and hack the config file to run ifconfig eth0 hw ether 00:11:22:33:44:55 to set the mac address when the RC script sources the file.
  62. There are more elegant solutions than this, including paying for the software.
  63. Get a DHCP address!
  64. Get a connection!
  65. GET THE INTERWEBS!
  66. Boot Xbox 360. Remember the Xbox 360? This is a song about Xboxes.
  67. Cannot connect to XBox Live.
  68. headdesk
  69. headdesk
  70. headdesk
  71. Find a guide to opening up all the required ports to make an Xbox 360 work though Smoothwall
  72. Assign the open ports to a static DHCP record
  73. Xbox refuses to pick up the DHCP record.
  74. Cut all electricity to the network, TV & surrounds and everything for a while.
  75. Bring up everything in the right order.
  76. Xbox still picks up a standard DHCP address. Same one, in fact.
  77. Give in and move all the port forwarding to the address it wants anyway.
  78. Connect to XBox Live.
  79. Play GTA4.
  80. Get stuck.
  81. Write up all this.
  1. Hate technology.
May 4, 2008 - 12:48 PM Comments: Closed

Import ant

I have had it with Windows Mobile Devices.

My main phone has been a HTC Wizard, sold by O2 as the XDA Mini. I bought it because it has a nice screen, a built-in keyboard, and will run PuTTY, which is handy when I’m pretending to be a sysadmin. It’s useful, in that it’s a pretty good Internet Device – though one of the new Nokia tablets would be better – but it fails massivly on several important criteria. Like:

  • It’s too big. It’s not a device you can slip into your pocket and forget about, and it has an exposed screen so you have to remember not to put it where your keys or anything sharp is.
  • The touch-screen is too stupid, and occasional resets the time while in your pocket.
  • The battery life is annoying.
  • You can’t lock the display when the media-player is on.
  • The headphone jack is 2.5mm. Why? What is stopping them from using a standard jack?
  • Windows.
  • Mobile.
  • Sucks
  • Donkey
  • Balls.
  • Yes, that did need to be five or six points.

    So, my new solution is for the XDA to live in my bag and be Wifi and GPRS if I can be bothered to swap the sim around, and I have got hold of a Sony Eriksson z310g. One of the few Eriksson’s with the clamshell form factor I prefer, an Eriksson interface (which I prefer to most of the rest) MP3 ringtone support and, and this was no small part of my decision to buy it, support for trutap. If I’m going to work for a mobile application company, it would seem useful if the software works on my phone. (FTR, it installed quickly and easily, its failure to connect to start with was because the phone installed the new Internet settings for WAP but not Java connections, and the MSN IM networking stuff seems to work. I’m pleasantly surprised :-).

    Now the complicated bit. Getting my contacts off my XDA onto the 310 from a clean Windows install (without the supplied XDA drivers). Note: I do not have Office installed.

  • Install Microsoft Active Sync
  • Discover latest Active Sync will not sync to Windows’ built in address book like all previous versions would.
  • Discover that there is no way around this, searching on the internet for a while.
  • Decide to fuck this and try it in Linux. (Ubuntu, Feisty Fawn install)
  • Find a tutorial for this follow it religiously.
  • Everything installs fine, detects fine, all messages fine.
  • Click “Sync”
  • Nothing happens.
  • Tail all relevant logs, track USB connections, unplug USB, reboot, plug in, tracking all logs, viewing all messages, turning up debug.
  • Nothing happens.
  • Search internet for solutions to nothing happening.
  • Nothing continues to happen.
  • Decide to fuck this and go back to Windows
  • Find age-old version of Outlook 2002 that came with an older computer.
  • Install it.
  • Discover that latest version of Active Sync doesn’t support that either.
  • Wonder how Microsoft Internet Explorer is not allowed to be backwardly compatible with itself when ActiveSync is.
  • Wonder how the fuck we expect Microsoft to comply with other people’s data interoperability ideals when their own software is incompatible with itself.
  • Locate shady copy of Outlook 2007.
  • Install shady copy of Outlook 2007. Am surprised when I don’t have to reboot.
  • ActiveSync doesn’t find any copy of Outlook on this computer.
  • Reboot.
  • ActiveSync finds Outlook 2007.
  • The more things change.
  • Sync contacts to Outlook.
  • Install “Sony Ericsson PC Suite”
  • Allow PC Suite to sync with Outlook and Phone.
  • Get contacts on new phone.
  • Jump for joy.
  • Attempt to PURGE all traces of Outlook from my computer
  • Fail.
  • Book complete windows Reinstall for when I get back home from Christmas With Folks.
  • Sigh.
  • Go find Christmas Cake.
  • Yay Christmas Cake
December 25, 2007 - 8:33 PM Comments: Closed

Snippit

a=0;for fle in *; do b=`for c in $(seq 0 $a); do echo -n " "; done`; mv "$fle" "$b"; a=$(($a+1)); done

August 24, 2007 - 9:29 PM Comments: Closed

The Iceweasels Come

The Mozilla Corperation don’t want people to change the source code of Firefox, recompile it with extra bonus bugs and possible API incompatibilities, and release it – as Firefox – to people who might use it and blame them for bugs that aren’t their fault.

Linux distros – such as Debian and Ubuntu – routinely maintain their own forks of open source applications with security updates backported from newer versions of software, without the associated functionality updates that the full new version has. This is why we call the current release “stable”, functionality doesn’t change.

Firefox the application is open source, Firefox the brand is decidedly not. Firefox the brand is the protected property of the Mozilla Corperation and they really don’t want people messing with it.

People produce systems on top of Firefox, hundreds upon hundreds of extensions. These rely on the version of the browser being reported being accurate. If the browser says it is version X.01, but it is really X.01 with the security patches from X++, then even if it reports itself as X.02, it doesn’t know if functionality it is relying upon is working. Or if it will segfault if it tries. It doesn’t even know to check, because as far as the extension is concerned, it’s running on a minor patch level advance on its target version.

Enter the iceweasel concept.

Iceweasel is a way around this problem. It is not Firefox, but it is mostly compatible. It is, in fact, Firefox with a different name and logo, and with the patches that the package maintainer applies. It isn’t called Firefox, so gets around the branding limitations. It is compatible with most firefox extensions, as it happens.

Then the GNU foundation go ahead with an actual product called Iceweasel which is not just Firefox with the serial numbers filed off, but a seperate maintained branch with new functionality. This (the name, at least) is a really silly idea, as it confuses the concept of “iceweasel” as suggested in the Debian-devel discussions last time this came up as an unbranded Firefox with an actual product.

So Firefox – the brand – isn’t quite free enough for Debian, and Iceweasel isn’t actually 100% compatible with Firefox.

So stop fucking telling me it’s just an argument about the graphics.

October 10, 2006 - 10:33 PM Comments: Closed

LUGRadio Live 2006

Okay, third time lucky…

Last weekend I went to LUGRadio Live 2006. I had a blast from the moment I got to the initial Friday lunch meet to the moment I left, annoyed I couldn’t stay for the after show party (Damn hotel bills).

Good Things

Talks

I didn’t go to very many talks, mostly because I was too busy shooting the breeze with people and playing computer games. In fact the only two actual talks I went to were Sara Ewen’s talk on PlayStation 2 Linux (Though I missed the bit on PS3 Linux) and Simon’s talk on Django (Which has lead to the rebuilding of the “Storyville” and “PFD4-2” projects in it. Watch this space). I also went to Bruno Bord’s talk on how much they swear in LR, and bits of the Women in Open Source talk (I caught the last twenty minutes) (Actually, I’d quite like to know what Jen, Kat & Phated – who hosted the talk – think about the recently announced Fedora Women project and others of its ilk. They may have discussed that, I wasn’t there.

Oh, and Dotwaffle’s talk on the Linux Demo scene (including a demonstration of a 64k demo called Origami, which I highly recommend you watch. It’s beautiful.

I went to more talks than I realised.

People

I met and remet some wonderful people. I made them wince at bad jokes and I took the piss out of their beards. Some of the people had corsets, some had full tuxedos, most had jeans and T-Shirts. They were all wonderful.

LAN Gaming

We played Enemy Territory. I shot Aquarius. He shot me. Repeat. This would have been better had we not been on the same team.

The Party.

About more later.

The Low Tech Wiki

They set up a Low Tech WikiAKA, A black board – upon which notes were made about stuff that was changing.

But it got spammed, and used for random crap, and because we had no revision history we couldn’t revert the changes.

Simon Willison and I started a discussion page on the back of the board on the Saturday night and by the end of Sunday that was still going strong.

What went not so right

Don’t get me wrong, the entire event was a blast, but in order to help them do even better next time:

The Hotel

I stayed at a hotel universally referred to as the Quality Chin. As hotels go it was reasonably priced (Heh. Our prices were something like 33% of their normal rates. At full price I’d have been… disappointed). The breakfast was fine but nothing stellar.

The hotel’s heating broke down. Or, rather, broke up. It apparently – on one of the hottest days of the year – decided to put everything up to full whack until they ripped the fuses out. The hotel was hot.

My room’s bathroom had black bits.

The bedroom was definitely a single. The bathroom could have held the encampment for napoleon’s entire army. I found this odd.

None of this is the LUGRadio team’s fault or responsibility, obviously.

Too Many Things

As Aq mentioned I’m not entirely sure how you can resolve this. There were effectively seven things happening at any one time. One main stage, two smaller stages, three community group gathering events and just shooting the breeze. I suppose the only way around it is to see which talks people want to go, see if you can group them so that those things don’t clash, and hope it all works. So if you found that the people interested in Linux on PS2 tended to also want to go to see Matthew Garrett’s talk about “Linux and Laptops” but not the more ethereal talks such as “The Zen Of Free”, arrange that Zen clashes with PS2, for example. It’s the kind of system that requires a lot more organisation and a certain amount of living with the consequences, but since it’s not me who will have to do the organising, I can suggest things as I please.

The Party DJ

Of which more later.

The weather

Winter. LRL2007 needs to be in winter or at least autumn. If nothing else, flights are cheaper.

Beards

This year by the end of LR, there were significantly fewer beards, and this is a Good Thing.

The Party

So, upon the Saturday evening it was decided that there should be a Party. So there was a Party. Some people dressed up properly for it (well, two people did). Some dressed up a bit (wave) most didn’t bother. There were cakes, and the cakes were very fine indeed. There was Guinness, and that was very fine also (I haven’t drunk Guinness since I was at university, and since we were back in a student bar I decided to revert to form and sit in the dark with a pint of the black watching the social butterflies dance in the bright lights.

Watching the dancing was interesting. (No, of course I didn’t dance. If you say you saw me, you are wrong. I have a twin brother. His dancing is worse than mine). Mostly because the DJ was more of a club-style than disco-style, as he claimed. The result of this was he was playing lots of loud thumpy tracks at deafening volume and complaining that nobody was kickin’ it on the dance floor. Then he started playing cheesy stuff (The Time Warp – albeit a disco remix; Madness – which got Jono on the dance floor; and Breakfast at Tiffany’s. This brought a core of hard-core dancers onto the floor, where they danced as if nobody was watching. Natalie was intent on getting people to dance, but had to leave early, so it is for her benefit I mention the first person to start dancing was at 23:10.

Anyway, after a few cheesy tracks people could dance to, the DJ went back to the heavy thumpy stuff that drove them away. After that it turned into a tide effect: The DJ would play a few cheesy tracks to lure people into his domain, and then as he thought he had them in the groove would switch to something loud and thumpy, clearing the floor in seconds.

There was a MAME cabinet (Which played 4 player Gauntlet, which is something everyone should so at least twice), at one stage I counted 8 people around it with nobody on the dance floor at all.

Somewhere in this country there is a facility designed to get around the laws stopping them from cloning people. This facility is running a scientific study into how many times you can create an absolutely generic DJ, identical to all the others. Every so often one fails and is forced to become a fairground announcer (“If you’d like to ride, if you’d like to ride… scream if you want to faster…”) but the rest go out into the world of professional party DJing, and nobody can tell the difference…

…also, I notice that if you want to find out how many long haired people are in your audience, simply start playing “The Ace Of Spades” and they’ll all be in one place. Moshing like their hair was on fire.

The Macs

I can’t let this one go. At Linux User Group Radio Live 2006: the plasma announce boards, the recording software and – for a while – the Enemy Territory server were all PPC Macs running OS X, because they Just Worked when they needed to.

Nothing much I can add to that.

The final bit

It was great. Same time next month?

July 29, 2006 - 11:02 PM Comments: Closed

MLP

What if Microsoft redesigned the iPod packaging?

And if you can tell me the name of the track that accompanies most of this, I’ll be your friend forever.

March 1, 2006 - 2:29 PM Comments: Closed

Mail

So, this is how my mail works:

  • Mail going to things at aquarionics go to Sneaky
  • Mail going to things at gkhs go to Jar
  • Other mail goes to POP accounts
  • All mail is pulled from POP/Sneaky/Jar to Atoll, my home server
  • I read mail over IMAP with Mail.app, Thunderbird, or Roundcube, depending on where I am.

    So, on Friday, DNS on Sneaky goes away, meaning mail can’t get to it for a while. Mail begins to build up.

    Saturday, Jar’s mail goes bye-bye for a little while too, but just my ability to collect it.

    Sunday, Atoll runs out of disk space on /

    By Sunday afternoon, all this is fixed. I’ve deleted excess stuff on Atoll, pol’s got DNS back for Sneaky, ccooke has put Jar’s door open again.

    I’m still not getting mail.

    Seems odd, Retchmail is still supposed to run on the half hour… Spamassassin isn’t admitting to junking it all… Nothing in syslog…

    …nothing at all in syslog…

    Todays lesson in Linux Admin. If you run out of space on /var, Syslog and Cron will shut down, as will anything that can’t live without syslog.

    So I restarted syslog, cron, and everything else that had died without my permission.

    Emails. Fassands of them.

    sigh

January 19, 2006 - 7:16 PM Comments: Closed

PHP sessions in Debian Sarge

This is how debian Woody (and all sane systems) clean up PHP disk based (the default) sessions:

  1. Every x (default: 1000) requests, PHP will delete all outdated sessions.

    This is how Debian Sarge does it:

  2. Every half hour (at 9 and 39 past) run a script
  3. This script runs a second shell script that parses the PHP config file with a regex to get the value for how long sessions should last (Which is odd, because a PHP script will get this automatically)
  4. The first script will then find all session files older than that value
  1. Delete them.

    WHY? WHY WHY WHY?

    This is the kind of braindead overcomplication stuff I’d expect from Gentoo, but the whole point of Debian is that it’s /sane/.

December 22, 2005 - 10:15 AM Comments: Closed

« Older Entries