Entries Tagged 'Ubuntu' ↓

IPv6 Experimentation – Servers, DNS, Google Apps, and Glue

So recently I’ve been messing around with IPv6. Probably a good idea, seeing as IPv4 space is running out fast.

The Computer Networking module at my university didn’t seem to cover IPv6 in any great depth. It appears Surrey University haven’t even thought about providing IPv6 DNS records to any of their servers yet. But they do allocate IPv6 addresses to every user on the network (WiFi and ResNet I’ve found so far, but not the lab computers).

I decided to try and get IPv6 rolled out across all the domains on my VPS (perfectly hosted by bitfolk). This involved configuring IPv6 addresses for my VPS’ network interface, adding IPv6 AAAA records in my DNS server, setting up reverse DNS records for the IPv6 addresses I use, and making sure that my name servers have IPv6 AAAA records and glue records at my domain registrar. My VPS provider assigns each VPS a /64 of IPv6 space. I think that will be plenty of IP addresses for my needs 🙂

First problem I encountered was I failed to set up ip6tables correctly. Being used to using the simple ufw, which manages iptables for you, I had failed to think that ip6tables was filtering and then dropping my IPv6 packets! So once I understood properly how iptables worked, I was able to open up IPv6 traffic to my VPS (thanks @grifferz). Next I assigned 4 IPv6 addresses to my network adapater, after disabling auto configuration for IPv6.

I then added AAAA DNS records for the domains I host. So if you have IPv6 connectivity, you should now be viewing this blog over IPv6! AAAA DNS records are just like the A records but instead point to an IPv6 address, rather than IPv4. I then made sure that I had AAAA records for my DNS servers too.

Now my email. I have used Google Apps to host my email for a few years now. The main reason I use them is their excellent spam filter. But I was quite surprised to find that the MX servers they ask you to use aren’t IPv6 ready. And I can’t see anywhere that suggests this will be available in the near future.

I’ve been following through the he.net free IPv6 certification to make sure that I’m doing everything right. It’s been good to check that I’m doing everything correct and to understand what exactly I’m doing. Their tunnel service has also been useful for testing.

But by going through their free certification, I discovered glue records. I had always wondered how some domains have name servers defined under the same domain. For example andrewgee.org now has a name server of ns1.andrewgee.org. Glue records allow you to define these name servers at the registrar of your domain, by supplying the IP address of the name server. Now this doesn’t seem to be a widely supported feature, with few registrars allowing both IPv4 and IPv6 addresses for a name server. I’ve found a number of registrars that claim to, but I’m still waiting for their support departments to ensure this works for .uk domains.

So it hasn’t been a wasted easter break so far. I’d better get to some coursework soon, though.

IPv6 certification

GPX Viewer in Debian \o/

So as I’m trying to make an effort to start being more productive again, I’ve kicked this off by packaging my python application, GPX Viewer, for Debian. Last year, I created GPX Viewer to read GPS trace files in the GPX format, calculate some stats, and display the trace on a map.

I started packaging it for Debian/Ubuntu last summer, but sort of forgot about it. But at the weekend I finished it off and submitted it to the Python Applications Packaging Team, where a Debian developer (Piotr Ożarowski) kindly reviewed my packaging, advised of a few tweaks, and then sponsored my package for the repositories.

And it’s as simple as that. It’s now nicely in the repositories: http://packages.debian.org/sid/gpxviewer

Now, what shall I package next? 🙂

Enabling the PC Speaker in Karmic

So I upgraded to Ubuntu karmic a few weeks back. To my horror, I found that the PC Speaker has been disabled. I like the use of the PC Speaker, for irssi and my email. It’s very handy. I seem to be one of the few people that feel like this. Anyway… After a few weeks, I’ve finally worked out how to enable it again 🙂 Yay!

  1. Open up /etc/modprobe.d/blacklist.conf
    gksudo gedit /etc/modprobe.d/blacklist.conf

    (Use kdesu rather than gksudo, in KDE)

  2. Comment out the following lines, by placing a # at the start:
    blacklist snd_pcsp
    blacklist pcspkr
  3. Save and exit.
  4. Load the modules manually, rather than restarting
    sudo modprobe snd_pcsp
    sudo modprobe pcspkr

It could work now. Have a try. If not, you may have to change a gconf setting. To do this:

  1. Load the gconf editor:
    gconf-editor
  2. Navigate to /desktop/gnome/peripherals/keyboard
  3. Adjust bell_mode to on

Edit: Now this did originally work for me, but it stopped after I rebooted and snd_pcsp was making the pc speaker make strange noises. So I’ve tweaked it a bit.

  1. Blacklist the two modules again in /etc/modprobe.d/blacklist.conf
  2. Open up /etc/rc.local
    gksudo gedit /etc/rc.local
  3. Before the exit line add these two lines:
    modprobe pcspkr
    modprobe snd_pcsp

The end. It REALLY should be working now. Good luck!

Linux Software RAID 5

So, I’ve been using MythTV recently. I have my master backend upstairs, with all of the storage. And then downstairs is the slave backend with the three tuner cards. Soon after setting all of this up, I found that I was going to run out of disk space for recordings pretty quickly.

Therefore, I bought three 750GB hard disks to complement the one 750GB disk that I had already. And I decided to get a bit of RAID 5 set up. I didn’t trust the fake raid card in my server box, or even believe it was supported in Ubuntu. So I had a look into software RAID. It looked pretty good, so that’s what’s setting up now.

Scan Packaging

I was a bit shocked to see the packaging Scan.co.uk sent the hard disks in, as you can see. There is also a hard drive mounting kit for a optical drive bay in there as well. Luckily, nothing seems damaged, so let’s hope it stays that way!

Hard Disks in Server

And this is the process I am following to get all of this organised and set up…

  1. Connect up all the new hard disks
  2. Format the new disks and set the RAID flag
  3. Create a new blank RAID array with the three disks
  4. Transfer all the old data onto the array
  5. Change the /var/nas mount point to the new array
  6. Format the old disk
  7. Add the old disk to the array and expand the array
  8. Expand the file system

It’s taking time, but it’s coming along. I’m at step #7, and it looks like it’s going to take a while. It’s at 3.9% and has an estimated time of 869 minutes left. Should give me a chance to do something useful.

Anyway… On to some revision. See ya.

GPX Viewer 0.1

Noticed anything different about the blog? I hope not, as I’ve made a smooth transition to using my own VPS provided by Bitfolk. Yay! But that’s the topic of another blog post!

I’ve made a little app, with Python. This app opens up GPX trace files and allows you to view them on a map, and view basic stats. For those who don’t know, GPX files, are tracks recorded by a GPS device. Making tracks with a GPS device lets you review your journey later.

GPX Viewer 0.1

As you can see, and  can possibly recognise, the trace is drawn on an openstreetmap map. This was made possible thanks to John Stower’s brilliant openstreetmap GTK widget with Python bindings. (I’ve packaged this GTK widget up for Ubuntu and it was accepted in. That was my first packaging, which I will talk about in a future blog entry!)

Go ahead and download it from http://andrewgee.org/downloads/gpxviewer

I’m going to work on Ubuntu and Debian Packages very shortly, so it’s easy to install. Are you a packager for another distribution? Would appreciate it if you’d package this up for me. It would be great if you let me know if you are going to do this.

Translations. This program is fully translatable on Launchpad at http://translations.launchpad.net/gpxviewer – Go ahead and check it out, if you know another lanuage and want to help out! Shouldn’t take too much effort, as there’re few strings to be translated at the moment!

Leave a comment to let me know what you think of the application.

Radio

Within the past year, my school has started to become very involved in trying to start it’s own radio station. We’ve had a large amount of money put into it and it’s slowly growing. We have the software that all the professionals use, and all of the equipment too.

But now I’m moving on to developing an automation application for the time that there isn’t a show on air. This will be similar to Southampton University’s radio station automation system (http://surgeradio.co.uk).

I’m using a combination of python and gstreamer. The feedback so far from the teacher involved, with our radio station, is good. The only problem is the network technician that is a Windows Server user. I think I’m going to have a problem, when I ask for a linux server to host the automation server, streaming, file server, and website. I expect he’ll wonder what’s wrong with his little sharepoint setup, he has going. Hopefully I might be able to do some persuading to get past that, but it’s not going to be easy. I understand the problem that this would cause though. I’m the only one with the skills to maintain the linux server. When I leave next year, I doubt they will have a clue how to operate the server, as I don’t think they have no knowledge of Linux. Anyway, that’ll be fun to try and sort out. Any suggestions?

At the application side, it’s coming along well. I’ve made a website that will allow listeners to request songs to be played. These requests are popped into a MySQL database. From here, my python app checks for new requests after every song. If there is a request, it’ll play that. If not, it’ll choose the next song from a pre chosen list. Nifty, aye?

I was amazed at how quick it was to develop in python, as this is my first real programming project in python. It was so simple to get a basic set up done. I had it done within a night! Jono Bacon’s excellent guide on gstreamer in python helped me well. The app now also has a nice little GUI, made in glade, that’ll help the DJs turn the automation on and off.

For the hardware setup, I’m looking to get the server, that I mentioned, and a few high quality sound cards, that’ll provide balanced audio in and out. I don’t think we’d need much processing power for the encoding of the streaming, as I’ve done a few test runs with my old Pentium 4 clocked at 1.8GHz.

All I have to do is finish it all up now… And perhaps do some of my many pieces of homework!

Vodafone 3G card in Ubuntu

Update: Since writing this blog entry many developments have happened with mobile internet under linux. These days you can just plug and go. NetworkManager will even help you find the right settings. However, I haven’t tested this particular mobile broadband pcmcia card with recent versions of Ubuntu, but assume that it works well. Leave a comment if you have any problems 🙂

First off, I realise that I haven’t posted a blog entry in a while now. I don’t know why I haven’t, as I’ve had plenty of time, it being the summer holidays and all. I always find my self wanting to do so much stuff in the summer holidays, and somehow turn up doing hardly anything. ‘Tis a shame.

Anyway…

After reading this mailing list post on ubuntu-uk, I was surprised these 3G datacards actually worked under ubuntu. Therefore, I instantly zoomed off to ebay and purchased one for £34 + postage. I made sure it said unlocked in the ebay listing, as I currently have a virgin mobile sim card and didn’t want to waste/switch to vodafone.

So the datacard turned up and I popped my phone SIM in it. Following the guide that was written in the mailing list, I configured it. This was using kppp. So I made everything was in there right and tried to connect. One problem though. Everytime I tried to connect kppp would lock up instantly. “Ah dear”, I though.

After much researching, I managed to set up the datacard using gnome-ppp, which is equally, if not more, easier to set up the datacard in. And here is a little guide I’ll write in full for you…

Continue reading →

Servers and Whatnot

So I’ve been on a little fun into setting up a webserver. Using an old computer which uses a shuttle case + motherboard. This case and motherboard has been through a lot. Stuff taken in and out loads.

And the fan failing. That was fun. It kept overheating and after much playing around, we found that the fan on the cpu heatsink had died. Shuttle being nice and kind when they designed this heatsink, made a size fan that you can’t get anywhere. Instead, I got a generic case fan and duct taped it to the heatsink! Clever, eh?

So my server. What is it serving? Well, it’s backup server. Thanks to the backuppc package, all the computers will be backed up in my house. Every week a full backup is done. Followed up by a incremental backup each day. Backuppc is also very clever. If there are files that are the same across backups and computers, the file will only be stored once. I can’t backup my whole house yet though. This is because of the hard drive in the server. It’s only a 120GB one. That means I’m currently only backing up one computer as a test.

What else is my server serving? SSH. The first thing I did when I set up the server was install SSH. This is for two reasons. The server is now on top of a shelf somewhere else in the house with only power and an ethernet cable attached. SSH is my means of remote access. The other reason is so I can have a nice SSH tunnel when I go to sixthform in September. No more annoying school filters to me 🙂 Another part of my SSH server is a key based authentication. I decided that I didn’t really want to put my server out on the internet, if someone was able to bruteforce the password. Therefore, I have set up key based authentication and completely turned off Password authentication.

Quotas. I also managed to set these up. Just as a play around really. It was pretty simple to do:

  1. sudo apt-get install quota
  2. Open up fstab and pop in the usrquota option to the partitions that need to be quotaised
  3. Restart
  4. sudo edquota -u username
  5. The quota config for that user will show up. Under the blocks and inodes column, you are able to see what the current use of that user is.
  6. You are then able to edit the number of blocks (1,000 blocks = about 1MB) that the user can make under the first hard and soft columns.
  7. The second quotaing is the number of files which can be set under the second hard and soft columns
  8. Save and quit. You’re set!

What’s the difference between hard and soft quotaing you ask? From what I’ve read around the internet, a soft quota is one that limits the user slightly. The user is allowed to go over the soft quota. But only for a limited time, before they have to delete the files. The hard quota is a strict quota. You hit that quota, and that’s it. Delete the file or be able to do nothing!

And of course, to do my bit, my server is folding proteins. Slowly but surely…

Folding stats

Take 97

Before you ask… No I don’t know why I chose 97 takes for the title! It just seems like that after the number of times I had to rerecord.

Having my summer holidays starting early, I’ve got to find things to fill my day with. Yesterday was “make the samba screencast” day.

New format as well. Full 720p HD format and also a little introduction at the start.

Here it is anyway, in all of it’s hd goodness:

Samba Filesharing

I seemed to be extremely slow in making this screencast too. It took me the whole day to make a 4 and a half minute screencast. I suppose. I wasn’t working on it constantly though.

So, in making the screencast I did the following things:

  • Planned my general script while running through it with a vm
  • Make a little presentation to start off the screencast
  • Get the transitions to work just right
  • Record the intro + presentation
  • Add audio
  • Record the content
  • Add audio
  • Record the ending
  • Add audio
  • Join it all together

Simple, eh? Not really. I kept bumping in to little problems whilst recording which annoyed me everytime.

And with the audio, if I say one word wrong, that’s it, I’d have to start again. Audacity seems to hate me. If I was to want to have a separate track to record to it would decide that the sound would be all broken up. Annoying I know, but I think I fixed it *after* I recorded all the sound. At least it should be better next time!

And today I found out that I forgot to include a part on changing the samba configuration file.

Oh well. Hopefully more will be on the way soon!

It’s good when things don’t work

Things going wrong. You’d expect this to be a bad thing. But I often find this a good thing. Why? Well it may take ages to fix a problem, but you learn so much in the process!

I persuaded my friend to use Ubuntu Linux a while back. So he went and installed it. He found that his wireless network card didn’t work, and there was no way it would work (even under ndiswrapper). So he went ahead and bought a nice wireless card from linuxemporium.co.uk. You’d think that they’d pick one that would work “out of the box”. Well, no! You get this awkwardly written guide (not good for newbies to linux). So I went ahead and re wrote it into simple talk. Great! It worked!

About a month later he decided to reinstall ubuntu and windows so that he could get the partitions right. So he went and did it and began to set up the wireless network card again. This time it didn’t work, even with my simpler instructions. So instead of getting me to help that much he decided he’d just get a nice ethernet cable instead.

Right. So he’s trying to get *everything* to work under ubuntu now. One of those things required his external USB hard drive. Simple you’d think. Plug it in and see it appear on the desktop. Unfortunately not. In this case it was, plug it in and see *nothing at all* happen. So he comes talking to me to ask for help. This is what I found out

  • The device was being recognised as sde – from dmesg
  • The device was not mounted – from mount
  • The device had partitions – from cfdisk /dev/sde

So, I go ahead and tell him to mount the disk manually.

sudo mount /dev/sde1 test

“Please specify a file system type”. Ok then.

sudo mount -t vfat /dev/sde1 test.

“Invalid file system type”. At this point my friend restarted into his windows partition, and the drive worked perfectly. During this time I had a google around and found that there might be an error on the drive. I don’t know much about fsck, but I gave it a go anyway.

fsck /dev/sde
Response: No FSINFO sector 1) Create one 2) Do without FSINFO

Ok then. We’ll press 1 and continue, even though I don’t know what a FSINFO sector is (but at a guess I’d say it is a sector that holds information about the file systems). After that part there were a few other messages like “Free cluster summary uninitialized (should be 10914208) 1) Set it 2) Leave it uninitialized”. We just hit 1 each time and carried on. But at the end of all of that we get a message saying “Leaving file system unchanged.“. I was asking myself why it isn’t saving the fixes, even though I told it to fix it. Ah well. Back to the drawing board.

After a few variations on the fsck command I came up with this nice one:
dosfsck -w -r -v /dev/sde1

So. Ran that. Hit 1 a few times. And tada! All fixed!

And now I know how to operate fsck more! Yipee!

In other news, it’s raining a bit here, and there’s a lot of thunder

/me hides