Archive for the ‘UbuntuIreland’ Category

Installing Drupal on Ubuntu (Gutsy) in a few easy steps

Friday, November 28th, 2008

Drupal is a great solution if you’re looking for a CMS system. In order to sneakily install LAMP with the minimum of fuss, I usually just install mod php and mod mysql (the apache related modules for php and mysql respectively) and that triggers pretty much everything else to be pulled automatically! So, from the command line…

sudo aptitude install libapache2-mod-php5

sudo aptitude install php5-mysql

… should give you Apache, MySQL and PHP in one fell swoop. Just to be sure that all is well run the following install commands

sudo apt-get install mysql-server
sudo apt-get install apache2
sudo apt-get install php5
sudo apt-get install php5-mysql

Then download and install Drupal (version 6.6 at time of writing) at http://drupal.org and follow their install guide.

One final tip, if there’s any problem with your apache installation’s configuration, you can install phpMyAdmin in order to plough through these problems as it will supply its own configuration. For example, I got the database configuration error when I was trying to connect to my database for the first time using Drupal

“Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports.”

Turns out my apache config was dodge as when I did a ’sudo apache2ctl restart’ I got the following…

“apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName”

Installing phpMyAdmin and choosing apache2 when prompted during this process did the trick. Now go forth and Drupal!

3 Cheers for OSS Barcamp Dublin!

Sunday, November 23rd, 2008

Another exciting event has just been announced for Dublin next year with an Open Source Software Barcamp planned for Dublin March 28th next year. And you could be one of the speakers! The idea behind a barcamp is to have a casual relaxed atmosphere where the attendees can help drive the schedule - like a conference done in the spirit of Digg. For more info check out Laura Czajkowski’s blog post and if you want to keep up to date with further details you can track things on ossbarcamp on twitter.

File downloads over the command line via CURL

Sunday, November 23rd, 2008

This could be a pretty obvious one to a lot of people but it’s just so handy. This will download a file from somewhere.com to your local directory

curl -O http://somewhere.com/somefile.tar.gz

Really handy when you’re administering a remote server and need to pull down files.

Recording Sound in Kubuntu 8.10 (running KDE 4.1)

Sunday, September 14th, 2008

Exciting times ahoy! This weeks mystery was to get sound recording with the minimum of fuss. We’re not sure what soundcard is running inside the Dell Inspiron 1520 which was our test laptop but it seems to report itself as an HDA Intel SigmaTel STAC9205 in the system settings. Anyway, the first thing to do was to apt install audacity which can then be used for testing the recording functionality. Not being sure if the laptops builtin in mic had been detected correctly, we jacked in an external microphone into the mic socket.

This didn’t produce any encouraging results initially when we tried recording in audacity so we opened up the KDE volume controls by clicking the speaker icon on the taskbar and electing to open the mixer. Unfortunately the GUI controls for the mixer doesn’t have the full complement of volume controls so it was the good ol command line to the rescue - typing alsamixer in terminal brings up a nice range of controls. You can navigate between screens of controls with the tab key and jump from control to control using the left/right arrow keys. The trick was to navigate to the two controls marked ‘Capture’ and bump up the volume (they also need to be activated by pressing the spacebar when you’re on the control). Additionally, there were two controls marked ‘Digital’. One of these controlled the volume of the mic (via the up and down arrows) and the other switched between analog and digital mode (again via the up and down arrows). We found that the latter had to be set to ‘Analog I’ for the best result.

Then it was back to audacity to record a bit of chatter - and then lament how weird ones voice sounds when recorded! Now get mixing mon amis!

QUICK UPDATE (14 Sep 08)
One issue that occurred was that after recording a sample, it couldn’t be played back(”Error while opening sound device. Please check the output device settings and the project sample rate.”). Additionally, a second track couldn’t be recorded. The solution to these problems was to open the Preferences dialog and set both the Playback and Record devices to ALSA (default). Reference: http://audacityteam.org/forum/viewtopic.php?f=18&t=3377

Just Diff the Internet

Sunday, June 22nd, 2008

Woke up this morning and found myself dead… Well, more to the point, my Internet connection dead. So being a Nymphobyte - someone feverously attracted to a reliable high bandwidth connection - there was little else to do than ponder the state of broadband in Ireland. Options are limited in the land currently home to the so called ‘Pariahs’ of Europe. Just make our broadband better and we’ll vote Yes! to Lisbon II and even Lisbon III ‘The Search for Spock’. Until then, you’re better off sending your packets of data back and forth via carrier pigeon rather than trying to connect via the empty promises of the current providers.

At least things aren’t as bad as in Sweden, oft thought of as land of the liberal and freedom loving Swedes, where their elected leaders are trying to sell them down the river - forcing a copy of all networked communications to be forwarded on the government so that they can, presumably, check for things like terrorists trying to share the latest episode of Desperate Housewives over Bittorrent. Sweden is now being mentioned in the same breath as China and Saudi Arabia with respect to Internet Freedom. According to an Information Age article even Google, not known to be adverse to collecting data on people, has been heavily critical of the crippling legislation. Blogger Oscar Swartz has a rallying mayday call on his site. Yes, that’s right, even the Scandinavians have given up on civil rights - now we know the world is doomed! They’re kind of like a civil liberties version of those budgies that used to warn of noxious fumes down the mine shafts in the old days - once they go tits up then you know the game is over.

Nope, freedom is not on the menu anywhere this week. An article in The Economist took stock of the scale of civil liberties that have been eroded under the Labour government and the relative apathy that this has been met with by the people. Gordon Brown, despite the having the popularity of Brian Cowan at a Eurocrat orgy, has even managed to push through legislation in Parliament to the effect that one can now be detained for 45 days at a go without charge. That’s over 6 weeks! You could miss the whole European championships if you’re unlucky enough! Which might suit you if you’re a Portuguese or Croatian fan, after their sides painful exists. But 6 weeks! Perhaps Gordon just has a secret repressed side that he didn’t know about - which is subconsciously upset that Ireland is now seen as more Eurosceptic than Britain. Forty five days isn’t so bad though. After all, Tony Blair wanted to lock ‘em up for 90 days without charge. Why not go the whole hog and just lock people up at birth? It saves all that awkward decision making and you wouldn’t even need National Identity Cards anymore. Mind you, who needs ID cards when everyone one has already gotten their own copy of secret government dossiers that they picked up on the Tube on the way to work. Now there’s a government I wouldn’t trust mind my dog for the weekend, never mind my confidential information. And I don’t even own a dog…

It’s been a tough week all right. It’s hard to know how to stay on top of things. My great plan is to do away with RSS feeds and subscriptions and just diff the Internet each morning before going to work. If there was some interesting news found it could be managed using git and deltas emailed to friends to keep them informed. Sure, it would be a lot of data to contend with, but there would be some scant satisfaction knowing that it would make those draconian Swedish government servers that spy on their citizens work that little bit harder!

Mercurial, Python and a Packet of Crisps

Monday, April 7th, 2008

Came across this exciting bit of news on the ol wireless just recently that rails is moving from SVN to Git. Exciting times indeed as more and more developers are realising the merits of distributed source control to manage an ever expanding code base. This Irish Penguin’s been in the fortunate position of working a lot with Mercurial, an alternative to Git, for the last few weeks and these types of tools are just a great way to work.

One of the big pluses is that your code and your repository (the history of all edits you’ve ever made to the code) is all in one directory which makes the process of source control really filesystem based. This is great when you’re learning and just experimenting as you become more familiar with your new favourite toy. If you want to try something out, you just copy the directory somewhere and if it all goes to pot then it’s just a quick copy command to restore it back to its original state!

If you’re a Ruby or Python dev one of the really nice things about Mercurial (also known as hg - after the chemical symbol) is that it’s done in Python, which means that it’s pretty easy to hack a bit of code together if you want to extend functionality. A whole Saturday was lost to the cause of hacking Mercurial in Dublin’s Central Hotel last weekend - as your host recovered from a bout of Extreme Coughing (there are more germs going round here at the moment than sheep in New Zealand!) over a pint of orange and a packet of crisps. Good fun! It was kind of weird though. As soon as urs truly had booted up the laptop, a bunch of folks grabbed seats to the back of the room muttering about Ubuntu cds and wifi. Sounds like Linux is all over Dublin like a rash. A very nice rash of course!

Getting the Huawei E870 to work on Kubuntu (and Mobile Internet from O2)

Wednesday, March 26th, 2008

It’s a shiny express card and it promises Internet free from cables, plugs and sockets but will it work on your pretty Kubuntu laptop? Let’s hope so. This guide worked for me and hopefully it’ll work for you too!

Now before we start let me tell you my setup. I’ve got this working on a Kubuntu based Dell Inspiron using O2 as my network provider. It did not work on a separate Dell Vostro running Ubuntu 7.10 (however I did get it working on a different Kubuntu 7.10 Dell Inspiron laptop). So I’m not sure whether that was a Ubuntu or Vostro thing or just bad luck. Also, note that the below approach worked for me when setting up Huawei’s E220 USB modem too.

In any case, here’s the 6 step plan to happiness
1.) Download the huaweiAktBbo-i386.out file
2.) Create the /etc/chatscripts/huawei-e220.chat file
3.) Create the /etc/ppp/peers/huawei-e220 file
4.) Create the /etc/wvdial-huawei.conf
5.) Edit the /etc/resolv.conf
6.) Create and tailor the /home/username/bin/connectme script (and chmod it!)
7.) Tip of the day - lose the Edge!

1.) Download the huaweiAktBbo-i386.out
This can be done by visiting http://www.kanoistika.sk/bobovsky/archiv/umts/ and downloading the file huaweiAktBbo-i386. If you really want you can also build it from the C source provided (in order to build it you will need to have a C compiler and some basic tools on your system). NB: Copy the huaweiAktBbo-i386.out file to your /home/username/bin directory after downloading. If you don’t have a bin folder under your home directory then create one (’mkdir /home/username/bin’). Also ensure that it is in your $PATH environment variable. Try echo $PATH and if you don’t see it listed add the following line to your /home/username/.bashrc file

export PATH=$PATH:/home/username/bin

To get this change immediately picked up by your shell run the command ’source ~/.bashrc’. This something I didn’t learn for years!!! D’oh!

2.) Create the following /etc/chatscripts/huawei-e220.chat file

TIMEOUT 3
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT DELAYED
"" ATZ
OK ATQ0V1E1S0=0&C1&D2
OK ATDT*99#
CONNECT ""

3.) Create the /etc/ppp/peers/huawei-e220 file

/dev/ttyUSB0
460800
noipdefault
defaultroute
persist
noauth
nodetach
usepeerdns
connect "/usr/sbin/chat -vf /etc/chatscripts/huawei-e220.chat"

4.) Create the /etc/wvdial-huawei.conf

[Dialer Defaults]
Modem = /dev/ttyUSB0
#Baud = 3600000
Baud = 7200000
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 =
Area Code =
Phone = *99#
Username = ppp
Password = ppp
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 0
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1

5.) Edit the /etc/resolv.conf file
Add the following entries at the top of this file (they are O2’s nameservers)

nameserver 62.40.32.33
nameserver 62.40.32.34

6.) Create the and tailor the /home/username/bin/connectme script as follows (and chmod it!)
Note: See step 1 for more instructions if you don’t have a bin folder in your home directory

#!/bin/bash
sudo /home/username/bin/huaweiAktBbo-i386.out # CHANGE THIS TO YOUR 'USERNAME'
sleep 3 # wait for the USB host to settle down...
sudo wvdial --config /etc/wvdial-huawei.conf
#/usr/sbin/pppd call provider

Then just do a ‘chmod u+x /home/username/bin/connectme’ from the command line (to allow you to run ‘connectme’ from the command line directly) and hopefully you should be ready to rock! The next step is to insert your E870 into the express slot. You might start to see Linux picking up the the devices and popping dialogs asking you if you want to mount the device (you should select ‘Cancel’ for them all).Wait about 5 seconds for it to steady itself and then run ‘connectme’ from the command line. You should see

Hladam HUAWEI E220 a prepnem na modem - bbo 06
4 set feature request returned 0
Prepnute-OK, Mas ttyUSB0 ttyUSB1 (cez usbserial vendor=0x12d1 product=0x1003)
pozri /proc/bus/usb/devices
WvDial<*1>: WvDial: Internet dialer version 1.56
WvModem<*1>: Cannot get information for serial port.
WvDial<*1>: Initializing modem.
WvDial<*1>: Sending: ATZ
WvDial Modem<*1>: ATZ
WvDial Modem<*1>: OK
WvDial<*1>: Sending: ATQ0 V1 E1 S0=0 &C1 &D2
WvDial Modem<*1>: ATQ0 V1 E1 S0=0 &C1 &D2
WvDial Modem<*1>: OK
WvDial<*1>: Modem initialized.
WvDial<*1>: Sending: ATDT*99#
WvDial<*1>: Waiting for carrier.
WvDial Modem<*1>: ATDT*99#
WvDial Modem<*1>: CONNECT
WvDial<*1>: Carrier detected.  Starting PPP immediately.
WvDial: Starting pppd at Tue Mar 25 21:22:08 2008
WvDial: Pid of pppd: 11465
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: Using interface ppp0
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: local  IP address 62.40.58.185
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: remote IP address 10.64.64.64
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: primary   DNS address 62.40.32.33
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: secondary DNS address 62.40.32.34
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]

If you want to disconnect from the web simply press Ctrl-C twice to kill it off. The first time you press it, it talks of wanting to exit gracefully - but better to press it a second time and exit effectively ;-)

You’ll see the following

Caught signal 2:  Attempting to exit gracefully...
WvDial<*1>: Terminating on signal 15
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: Connect time 8.6 minutes.
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: pppd: H���h�[06][08]`�[06][08]
WvDial<*1>: Disconnecting at Tue Mar 25 21:30:45 2008

7.) Tip of the day - lose the Edge!
Disclaimer: this is just my opinion as to the performance of the Edge network so O2 lawyers keep your knickers on (however Apple iPhone suckers, enjoy the sheer speed of the Edge network, getting dripfeed broadband at 1500 Euros a year!). In stark contrast though, my experience with the HSDPA network have been good. Yes, as you may have already guessed, the Edge network was not really delivering for me. But a friend of mine showed me how to change your O2 broadband Express card (or USB modem) settings so that it not even bother connecting if it can’t get a proper UTMS or HSDPA signal. For this you need a Windows friend. Install the express card on their machine and from the O2 broadband application and select “Tools->Choose Network Type->3G Only”. This setting directly updates the card so even when you switch back to a using it on a Linux box it will go with 3G only. If I don’t do this I’ve found that it will flip flop between Edge (GPRS) and 3G networks and drive you mad in the process. I found it pretty much impossible to even check my email on Edge.

Special thanks to Andy and Paul on the ILUG mailing lists for their help and also to O2, Vodaphone, Three et al. for providing Mobile Internet via hardware that can actually be used on an Open Source platform such as Linux; as we hopefully move from an era of proprietary lock-in and DRM-based crippleware to software that delivers genuine value for businesses and users. Vodafone have gone as far as having their own Open Source website to help along development at Betavine. Enjoy!

The revolution will not be televised! It will be streamed over TCP/IP…