This is the technical scribble pad of Kit Sunde, a freelance software developer doing web things. I'm for hire: kitsunde@gmail.com

Posts Tagged: Ubuntu

Text

I previously wrote how to do this under Maverick. Another Ubuntu release is out with OpenJDK, here’s how to replace it with Oracles JDK:

sudo add-apt-repository "deb http://archive.canonical.com/ natty partner"
sudo apt-get update

sudo apt-get install sun-java6-bin sun-java6-jdk sun-java6-jre sun-java6-plugin

sudo update-java-alternatives -s java-6-sun

Text

With node.js 0.4.5 out it’s well over due to get aptitude to keep up with the updates:

sudo add-apt-repository ppa:jerome-etienne/neoip

sudo apt-get update

sudo apt-get install nodejs

Text

During installation of OpenCart you are required to have certain PHP extensions active one of them is cURL, if it’s not then install it like so:

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

Then we need to restart apache

apache2ctrl restart

Refresh the page if you are still on it and it should be working. I think OpenCart could offer up a more pleasant installation process by offering suggestions in the installation process itself on how to go about fixing minor issues like this.

Text

Google has a new policy for the chrome extension gallery where screenshots need to be 400x275 (or some larger multiple of that). I soon found out that ImageMagick -came to the rescue again with the extent command which when scaling a picture to a larger size will add padding to the image (you can use -gravity to decide where). So I ended up with this for producing the screenshot of an appropriate size:

Text

The most convenient way of scaling images in Ubuntu I’ve found this far is using ImageMagick.

Or perhaps more interestingly Paint is one of the few things I miss from windows. Firing up GIMP to do basic Image editing is a bit of a bother, and you keep forgetting what the command line tool names are.

Text

If you are inputting the SSH password in the keyring password box when connecting to a server and the input box displays:

Enter passphrase for key as [user] on [server]

It means that it’s asking for a ssh-key passphrase rather than the servers ssh password. If you choose to input nothing it instead gives you the option for the servers ssh password that reads:

Enter password for ssh as [user] on [server]

Text

I’ve had issues with empathy where it would refuse to connect (even try) to MSN. In older versions of Empathy (whichever version was included with Lucid Lynx) you would.

killall telepathy-butterfly

However this is not longer possible, instead you need to do this.

ps -ef | grep telepathy

Which lists all the telepathy processes.

celc 2000 1 0 17:20 ? 00:00:00 /usr/lib/telepathy/mission-control-5
celc 2010 1 0 17:20 ? 00:00:00 /usr/lib/telepathy/telepathy-haze
celc 2012 1 0 17:20 ? 00:00:00 /usr/lib/telepathy/telepathy-logger
celc 2098 1 0 17:20 ? 00:00:01 /usr/lib/telepathy/telepathy-gabble
celc 2100 1 0 17:20 ? 00:00:05 /usr/bin/python /usr/lib/telepathy/telepathy-butterfly
celc 2529 2315 0 17:39 pts/0 00:00:00 grep —color=auto telepathy

Find the butterfly one and smash it, in this case:

kill -9 2100

Now MSN should be able to connect again.

Text

In Lucid Lynx at least there isn’t an obvious or easy way to have different layouts on different keyboards. I recently bought a keyboard with a US layout (instead of Swedish like my netbook keyboard) because my netbook keyboard was messing up and thus needed them to work independently.

If you use:

setxkbmap -device [device_number] [layout]

Like so:

setxkbmap -device 1 us

Changing the device number until you find the right keyboard, and of course making sure you only change the layout of the device that you need to be different. :)

Do anyone know how to detect which devices are keyboards?

Text

The issue at first seemed to be that something that had to do with SSL wasn’t working, except that I’d strangely get brief moments where it would work. Like the number of unread emails in my Gmail showed up or when Dropbox suddenly connected. The bug is posted in launchpad but has been marked as expired due to a lack of interest. The solution offered by Christian Kroll was to set the MTU of the USB ethernet device to 1394.

To achieve that solution go to system then network connections next you need to edit the connection your phone is connected too. For me it was Auto eth1, and you can find yours by hovering over the network connection icon. Press edit on the right connection and you should be at an edit tab with an MTU box that says Automatic, type 1394 into it and press apply. Your connection will be disconnected but you can simply restart the sharing from your phone and it should work.

Keep in mind that if you use a different USB port next time, you’ll have to do the same thing for that port as well.

Text

When the apache error.log spits out that it can’t find htdocs it’s because it can’t find a DocumentRoot. You can fix this by adding a DocumentRoot to /etc/apache2/apache2.conf

Like so:

# Sets the DocumentRoot
DocumentRoot /var/www
Source: ubuntuforums.org