All posts by admin

iPod nano 2nd generation on Ubuntu 6.10 (Edgy)

My girlfriend and I both have iPods. I have a 2nd gen shuffle, she has a 2nd gen nano. Both were working fine on my Edgy install, however, the 2nd gen nano wasn’t being ‘found’ by Gnome, and therefore not appearing in Banshee (which is what I really wanted).

There is a workaround, it’s a replacement for Gnome’s HAL. Simply follow the instructions here for results:
http://www.tigert.com/archives/2007/01/09/ipod-and-ubuntu-edgy/

Virtualbox – Virtually twice as fast as vmware (and open source!)

A relatively unknown bit of virtualisation software called ‘virtualbox‘ from InnoTek has recently become open source’d. I’m actually quite surprised it hasn’t received more publicity. After hearing people rave about virtualbox in #hantslug on the blitzed irc network, I thought I’d give it a whirl. Setup was far easier and much more sane than vmware player/server, all configured via nice gui rather than weird perl script.

The best bit was yet to follow…the performance. Now, I’ve never used xen before, but compared to vmware, this thing flew. Honestly, I’ve never seen virtualisation so fast. Windows installed in no time at all on my Celeron 1.4ghz 768MB ram. Very impressive. So I thought I’d put it to the test. I loaded up a high def xvid video (960×528 w/5.1 sound).. it played flawlessly. This was stunning. I’d say it’s probably somewhere between 5-10% off native speed, and closer to the 5% than the 10%.

I’ve yet to comment on stability as I’ve not used it that long. The setup window did disappear once, but I think that may have been a one off.

There’s also USB support on the non-free binary, so it’s very close to having a native setup…virtually!

Try it now!!

Setting up VirtualBox on Ubuntu.

Tesco Internet Phone for Linux

After wasting many hours messing around with VoIP solutions, I’ve finally decided that Tesco Internet Phone is the way to go. There’s a few good reasons why I think this, it’s easy for anyone to obtain and install. This was one of the main factors in my decision. With Tesco Internet phone, you don’t have to open ports on your router, it comes with a USB handset, so no need to get one of those, and you can just pop down to tesco and pick one up for really cheap (£15 I think) WITH a £5 calling credit thing.

Anyway, on to setting it up on linux. You’ll need to install kiax or some other IAX capable client. Unfortunately, Ekiga CVS still doesn’t support IAX (as far as I can see) so you’ll be stuck with a qt or kde client.

You’ll probably have to set up on a windows machine unfortunately, but basically, the main thing you’ll need to know is the Tesco IP server address, which is:
vrv.lon.uk.voicestream.net.au
Use your phone number as login and the password you set up. Then under Kiax’s settings you should be able to choose /dev/dsp1 to use the handset. There’s a few little quirks. The hash key doesn’t work, as don’t the volume controls, although there’s probably a way of getting these to work. More later!

Quickones – Short, useful linux screencasts

I recently stumbled upon a really interesting site called Quickones which has a series of screencasts on how to use various things in Ubuntu (among other distributions).

For example, there’s a short guide on how to get flash to work on Ubuntu. Alan Pope delivers a very well paced and easy to follow screen cast. These screencasts are highly recommended to newcomers to the Ubuntu Linux distribution.

Installing Python2.5 on Debian Etch


Linking and byte-compiling packages for runtime python2.5...
pycentral: pycentral rtinstall: installed runtime python2.5 not found
pycentral rtinstall: installed runtime python2.5 not found
dpkg: error processing python2.5-minimal (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python2.5:
python2.5 depends on python2.5-minimal (= 2.5-3); however:
Package python2.5-minimal is not configured yet.
dpkg: error processing python2.5 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python2.5-minimal
python2.5

Is your Etch install doing this? It was with me, really annoying. However, I found a solution (not a great one, but it works).

I got around the problem by forcing removal of python-central,
installing python2.5, then reinstalling python-central.

This seemed to work for me, although the remove did uninstall gnome (although easy to put back after). Thanks to Cameron (http://http://lists.debian.org/debian-python/2006/11/msg00006.html.

Hope this helps!

CakePHP

This was written haphazardly in a forum, please take it as-is (or as a rant of some kind)!
Ok, so before I started using cake I went in to the #cakephp channel on freenode and asked:

“yes, but what about when my application gets really complicated?”
“don’t worry, it’s totally flexible”
“I love cake”
“etc..”

I was still skeptical, but we had a small project coming up at work and a fair bit of time to do it in. Cake fit the bill perfectly. A success!

We’re just coming to the end of a project say, 2 or 3 times the magnitude of that first one. I’ve now had time to form some real solid opinion about CakePHP.

CakePHP has some good points and bad points. One of the nice things about cake is it throws you into the MVC (Model/View/Controller) pattern way of thinking, and without having to learn ruby or something weird like that. The code I’ve been working on has been a lot easier to code because of this nice seperation..although in some cases it has taken slightly longer.

For example, a simple login form can take slightly longer to make as you have to create an login action member to your controller (a function), and then the view (template) and then the model (I’ll get on to that) rather than one quick bodge.

Having said that, I really like it so that gets thumbs up!

Now for why it isn’t quite as good as people say (or at least why I think it’s a bit shit). Models.

So instead of just doing $data = mysql_fetch_assoc($query, $handle) or whatever, you use cake’s ‘model’ abstraction layer, so you’d do something like $this->Model->fetch($data) or something..I don’t remember exactly.

There are a few problems with this:

First and foremost, you need to learn quite a lot, and it’s poorly documented for when you have many to many relationships etc..
CakePHP is poorly documented anyway!
It’s silly, because like a lot of these ‘bright’ ideas, it ends up being wayy more complex than just throwing in a simple (or complex) query.

Yes, for quite simple projects, you (me) could probably get away with using Cake’s modeling bit. However, for complex stuff, you’ll find you’re using $this->Model->query();

That brings me on to why I might continue to use cake in the future…

It’s nicely flexible, next time, I won’t bother trying to use any of Cake’s modeling features to get my data. I’ll just use normal queries..we found we were doing that by the end of the project anyway. I think for beginners, Cake’s modeling language *might* be easier to learn than SQL, but I know SQL and that works well for me…and you don’t have to be messy with it either.

Second thing I really like about cake is that a lot of stuff can be done for you by it’s helper library, for example, $html->dropdown() (or something to that effect) adds a drop down list from an array in your view.

What would be really cool is a cakephp without all the chaff of the model stuff…some kind of cakephp for people who know and love SQL perhaps?

Well, that’s my take on it. If you’re thinking about using it, first I’d suggest you think very hard. Cake is still in it’s infancy, and you’ll find quite a bit isn’t documented at all (I had to speaker to the developer to get some answers). Secondly, it might be easier/better..especially if it’s a one person project to write your own framework based around all this. I’m talking about a very ‘lite’ framework, perhaps just a few files, no more than 200 lines of code?

I’ve had a bit of experience writing my own framework, first one I tried sucked, second one worked really well and I’m now in the process of making a third simply for knocking up sites really quickly. How often do you find yourself coding the same things?

Happy baking!

Auto mounting using SSHFS and your /etc/fstab file (in Ubuntu)

Unfortunately, Ubuntu (Edgy and previous versions of Ubuntu) doesn’t seem to have a handy little script called mount.fuse which should come with the fuse-utils package.

This basically means it’s impossible to get Ubuntu to mount sshfs mounts upon startup (nicely), or using a nice and simple mount command like:

mount /my/sshfs/mount/point/

Anyway, personally, I find it really annoying. Yes, there are probably good reasons why they don’t include the script, but no I don’t care. Well, not until someone can tell me an easier/cleaner way of doing this.

First, you’ll need to:
sudo apt-get install sshfs
sudo apt-get install fuse-utils

Then, download mount.fuse (works with Edgy Eft Ubuntu, not sure about anything else!).. stick it in /sbin/ and then sudo chmod 777 /sbin/mount.fuse (or you could be more careful with those permissions).

You’ll want to add lines with this format to your /etc/fstab file:
sshfs#jrh@alf:/ /sshfs/alf fuse defaults,noauto,user 0 0

I’ve found there’s a lot of mount.fuse scripts out there, which expect the fstab lines to be in a different format..so it’s quite important to use the right mount.fuse with the right fstab formatting!

Finally, if this happens when trying to mount:

fusermount: mount failed: Operation not permitted

try this.. it’ll allow your normal user to run fusermount (as root iirc):
sudo chmod 4755 /usr/bin/fusermount

It continues to amaze me how few people actually use this method of mounting with sshfs…it just seemed to make sense to me! Please leave a comment if you have a problem with this so I can add more info if needs be.

Edgy Eft released

Perhaps I’m a bit late in posting this, but version 6.10 of Ubuntu was released this week. I highly recommend you give it a go..there’s no need to install anything, you can boot the whole OS from the CD (and then choose to install if you like it). I’m using the live CD now to write this, neat huh?

Even if you can’t be bothered with that, I recommend you find out what all the fuss is about anyway:

Ubuntu Linux

Ubuntu is really starting to impress me quite a lot. This latest version comes with almost out of the box support for all those fancy 3d effects you may have seen on Youtube.