Upgrading Fedora 8 to Fedora 9

It’s time for another Fedora upgrade. Whilst the installations aren’t necessarily getting any better – fixing them is becoming a bit faster, because the problems are pretty similar every time and these notes I’m keeping are helping.

  1. System won”t boot. Met with a grub> prompt, and no menu
    • Boot the system from the DVD again, and select “rescue an install system”.
    • ‘chroot /mnt/sysimage/’
    • “nano /boot/grub/grub.conf”
    • Change this line, “root (hd2,0)” to root “(hd0,0)”. (I’m not sure why Grub seems incapable of finding the right hard drive to boot from each time… It doesn’t change.)
    • Uncomment the line at the top #boot
  2. Cyrus imapd won”t start. Complaining of libcrypto.so.6 library missing.
    • Upgrade Cyrus – “yum upgrade -y cyrus”
    • Restart the service – ‘service cyrus-imapd restart’
  3. Rss2imap no longer posts the messages into Cyrus IMAPD
    • Difficult to place the blame on this one. One turning on Rss2imap debug mode, I see i@m getting the error ‘Message contains bare newlines’, and although Rss2imap has posted the message. It’s been discarded by Cyrus. This is actually proper RFC behaviour for Cyrus – as message’s shouldn’t contain the broken ‘\n’ character, but rather ‘\r\n’. At the same time, I also think, ‘so what?’. Either way, the Cyrus behaviour has changed, or Mail::IMAPClient modules have.
    • So the fix… Edit Rss2imap\RSS2IMAPLIB\Rss2imap.pm, and add the bold text.
       my $message = ($headers . $body);
      $message =~ s/\n/\r\n/g;
      utf8::encode ( $message );

      and
       my $folder = $this->get_real_folder_name ($this->{'last-modified-folder'});
      $body =~ s/\n/\r\n/g;
      $this->{imap}->append_string ($folder, $body);

      You’ll notice we’ve replaced all the \n line endings with the more correct \r\n. Let’s just hope we don’t have to undo that later when the problem gets resolved elsewhere 😉

Remarkably, this was the first time the wireless card started up immediately after the upgrade, perhaps things are improving after all 😉

Linux server as a wireless bridge

Since learning the XBox 360 doesn’t come with a wifi adapter, and that buying such a thing would add another 60 pounds to the cost of the console… I’ve been thinking of different ways to get an Internet connection from my high-speed wired network in the living room out to the router way out in the spare room. For many reasons, it’s just not practical for me to wire the whole flat.

Most of the solutions I came up with involved things like ‘spending money’, which I’m slightly adverse to do if I can do it with the existing kit, so these are the really basic steps to turn the existing linux box (with both wireless and wired cards) into a useful bridge. As usual, don’t be fooled into thinking this guide is here for anyone else, as much as it’s here for me when I need to rebuild the machine and I’ve forgotten it all. But feel free to leave a comment about how much warmer and fuzzier I’ve made your life through your use of these “instructions”.

The current configuration

Fedora 8 installation
Wireless Ethernet (ath0) card is connected as 192.168.0.8
Wired Ethernet (eth1) card is connected as 192.168.1.8
Named/bind/DNS server already configured and set-up to accept requests on 192.168.1.8
The Xbox will be wired, on 192.168.1.20

Setting up Fedora

Setup the forwarding rules

#Outgoing requests
iptables -t nat -A POSTROUTING -s 192.168.1.8/24 -o ath0 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.0/24 -o ath0 -j ACCEPT
iptables -A FORWARD -d 192.168.1.0/24 -m state --state ESTABLISHED,RELATED -i eth1 -j ACCEPT
#Incoming requests (port forwarding)
iptables -t nat -A PREROUTING -p tcp -i ath0 -d 192.168.0.8 --dport 88 -j DNAT --to 192.168.1.20:88
iptables -t nat -A PREROUTING -p tcp -i ath0 -d 192.168.0.8 --dport 3074 -j DNAT --to 192.168.1.20:3074

Save your rules so they’re applied on start-up
sudo iptables-save > /etc/sysconfig/iptables

Enable ipv4 port forwarding
nano /etc/sysctl.conf
Change this line
net.ipv4.ip_forward = 0
to
net.ipv4.ip_forward = 1

The client machine / Xbox 360

Now on your client machine (note this will only have a wired connection).
IP Address: 192.168.1.20
Subnet mask: 255.255.255.0
Default Gateway: 192.168.1.8
DNS Server: 192.168.1.8

You’re going to need a DHCP server so that these settings are automatically assigned to the XBox 360. If don’t have one for your subnet already, you can set it up through dhcpd. You’ll probably want to do something about

Edit /etc/dhcpd.conf

ddns-update-style interim;
# HardWired
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.8;
option domain-name-servers 192.168.1.8;
authoritative;
range 192.168.1.10 192.168.1.20;
}
# Assign a static IP
host xbox {
hardware ethernet 00:45:40:10:FE:12;
fixed-address 192.168.1.20;
}

Then restart dhcpd
/etc/rc.d/init.d/dhcpd restart

Router

Remember those ports we forwarded on the server? You’ll also need to add port forwarding to your router, to forward the same ports (88, 3074) to the Fedora machine on 192.168.0.8.

And that’s really it. You should now be able to connect to the Internet without any troubles.

Why don’t you try the homepage? Idiot.

I recently read “The Inmates are Running the Asylum” by the father of VB, Alan Cooper. He spends quite a while arguing the case against obnoxious interfaces that make life difficult for your users. Quite right too. I highly recommend the read if you’re involved in any kind of user interface. Actually, I highly recommend it anyway – empower yourself with the knowledge that things don’t have to be this way.

Anyway, my small part towards eliminating frustration and annoyance was to try and create the perfect 404 page. And I know what you’re going to say… If you desire perfection, why would anyone ever even see your 404 page. Well you’re quite right, but it doesn’t hurt to be defensive about these sort of things. Accidents happen and believe it or not, not all of them are entirely my fault. Sometimes.

I’m not going to link to it here, because my 404 page automatically emails me whenever there’s a broken internal link. Frankly I could do without the hassle. That’s step one, and here are some more.

  • Tell the user what’s wrong. If they’ve come from another site (do this by checking the referrer URL), let them know which site, and that the link was broken at that end. If they haven’t – chances are it’s a bookmark / favourite. Tell the user that. The term ‘404’ is not helpful – telling the user what happened, is.
  • Recent Posts. It’s a blog. If you’re here, you’re most likely reading one of the latest five posts. If you’re applying this to your own non-blog site, list your most changed popular pages.
  • Search. If you’re looking for something and I’ve already failed to find it, searching seems more appropriate than to keep doing what you’re doing.
  • Possible matches. You’ve got a URL – use it. So I try to guess at what the user was hoping to find based on what’s in the URL. If you’ve got some decent SEO going on, chances are this will do better than you think.
  • Other helpful links. The homepage is generally a good starting point, and well, I don’t have a site map. But if I did – this would be another good thing to include.
  • Google Cache – Google maintains a cache, so why not make some use of it and point your visitors at it to hunt for your missing URL. This might not be exactly what you want for your site, but they could find it on their own anyway so stop being difficult.
  • Tags. All my posts are tagged, and provide a nice overview of what the posts are about, so let’s include those.

Turn your 404 page into a jump-board rather than a brick wall – or your readers are just going to find something better to do.

Facebook – one year on

It was a year ago today that I signed up to Facebook, so I felt I should commemorate that fact with a post like that one. At the time, I worried about the fact that a huge number of groups across the world were gaining more and more data about me – and that I was freely giving it away. Beacon, ‘stalkers’, a million new users each week, uncloseable accounts, email 2.0, evil universities down with the kids, the never-ending list goes on… Actually, that particular list ends at 233,000,000 – but my point is that Facebook’s had more than its fair share of publicity.

So with all that new information out there, companies are struggling to keep up. Poor marketing agencies across the world are inundated with too much data to cope with, and their servers are smoking with every 150,000 new users every day. My heart goes out to them.

So I’ll make it easier, with a year of Facebook in summary…

  • 127 foolish people have decided or agreed to call me their friend. 59 recognised as people from or at my current company, 9 from university, and 14 fellow college alcoholics.
  • Added 116 photos across 8 albums, 8 of which include me. A further 22 pictures of me have been added by other people.
  • I’ve developed two applications both for my own use on my own profile, one of which remarkably still maintains 58 users, 1 fan, and a total install count of 129. I can only imagine it’s even remotely usable by about 10.
  • Received 88 private messages.
  • Written 64 notes (imported and otherwise… This will make it 65).
  • Joined 18 different groups, including “that punch the slow walkers” one.
  • Updated my status 15 times in the past 3 months.
  • A total count of 27 events, 3 created by me including one that unknowingly spawned into 320 mostly unknown invitees.
  • I’ve played 20 games of scrabble on-line, completed 14 and won 11, with a top score of ‘utopias’ for 65.

So if you’re on Facebook – all that information and a whole more will be out there too (as well as all the specifics). Makes you think, doesn’t it?

Now, where’s that tin hat?