Tech stuff and info dump

Ubuntu 10.04 & Synaptic Package Manager 0.63.1: Adding ‘Universe’ repository

July 01st, 2010

To add the ‘Universe’ repository, open Synaptic Package Manager by typing System -> Administration -> Synaptic Package Manager and entering your password in the pop-up window.

In the main Synaptic window, go to Settings -> Repositories and then click the ‘Ubuntu Software’ tab. In the ‘Sources’ pop-up, click the tickbox next to the line that reads ‘Community maintained Open Source software (universe)’.

Click ‘Close’ on the pop-up.

This allows one to download programmes from the ‘Universe’ repository using either Synaptic Package Manager or apt-get install.


Filed under: Installation,Ubuntu 10.04
July 01st, 2010 19:26:09

Ubuntu 10.04: change focus when mouse moves to different window

May 30th, 2010

I like the focus to change when I move my mouse so that I can type in one window whilst having another window on top.

To make this happen in Ubuntu 10.04, go to System -> Preferences -> Windows and click the tickbox next to the statement, “Select windows when the mouse moves over them”.


Filed under: desktop,GNOME,Ubuntu 10.04
May 30th, 2010 16:51:40

Ubuntu 10.04: Get rid of the whizzy desktop-switching slide animation and other graphical effects

May 18th, 2010

I prefer a simple desktop environment free from whizzy graphical effects. In particular, I didn’t like the whooshing between desktops. I think of my desktops as discrete spaces and didn’t want them to appear connected in any way. In particular, I didn’t want to be able to move a window halfway off the left-hand side of the screen and then find it on the desktop to the next desktop over. How disorienting!

To disable the default

Navigate to System -> Preferences -> Appearance
Click on the ‘Visual Effects’ tab
Choose the ‘None’ option
Click ‘Close’

This freed me from all the unwanted effects.

(To disable only the desktop whooshing and not other graphical effects, perhaps it would be worth exploring ubuntu-tweak. After Ubuntu Tweak is installed, it can be accessed via Applications -> System Tools. I suspect playing around with “Compiz Settings” under the ‘Desktop’ heading could help. I may try this if I find a nice feature missing now that I’ve turned off visual effects, but for now, I’m happy.)


Filed under: Customisation,Ubuntu 10.04
May 18th, 2010 17:49:43

Ubuntu 10.04 (Lucid Lynx): simple, step-by-step lamp server installation (linux, apache, mysql, php)

May 13th, 2010

Well, today’s the day for installing a lamp server on my 10.04 machine! Wireless is working just well enough that I’ve not given up and gone running back to 9.04, although there are still some mysteries to figure out where that’s concerned.

It’s worth noting that I’m setting up my server for personal use. I want something that will let me test out webpages that will hosted by other people’s servers. (If you’re setting up an internet-facing server, these instructions will get you started, but more work is needed to keep the server safe from the wild world of the internet. If I come across a good tutorial on such things, I’ll post it.)

Downloading Necessary Packages

Synaptic Package Manager can be opened by going here:

System -> Administration -> Synaptic Package Manager

and entering one’s password.

I used Synaptic Package Manager to download the following packages:

  • php5 (this installs apache2-mpm-prefork, etc.)
  • mysql-server-5.1 (this installs the client and core as well)
  • Optional: phpMyAdmin (a nice GUI for managing MySQL tables)
  • Optional: php5-cli (only needed if you want to run PHP from the command line)

The packages can be found by clicking the Search icon and typing in the package names. When a package name is selected, Synaptic Package Manager kindly prompts one to install all other files required. Once you have chosen all the packages needed, click ‘Apply’ (underneath the green check mark) at the top of the Synaptic Package Manager window.

File Installation

For the most part, Synaptic Package Manager will take care of all the installation. There are a couple things that might need to be done manually, however.

Configuring phpMyAdmin

If you have chosen to install phpMyAdmin, you may get a pop-up window called ‘Configuring phpmyadmin’ with the text “Web server to reconfigure automatically:” and a choice of servers. This is just asking which server you want to be able to run phpMyAdmin. I was given the choice of apache2 and lighttpd. I ticked apache2 and clicked the ‘Forward’ button.

Configuring MySQL

The mysql installation also requires some information. A pop-up window called ‘Configuring mysql-server-5.’ should pop up with the text ‘New password for the MySQL “root” user:’ and a text box.

Make up a password for the root user and enter it into this box. (Write it down – you’ll need it later!) Click ‘Forward’. You’ll be asked to re-enter the password. Do so, and click ‘Forward’ again.

Database for phpMyAdmin

If you’ve chosen to install phpMyAdmin, you’ll get another ‘Configuring phpmyadmin’ pop-up with the text ‘Configure database for phpmyadmin with dbconfig-common?’ and a tickbox. I left this ticked; clicking ‘Help’ explains under what circumstances one wouldn’t want this to happen. Once the selection is made, click ‘Forward’ to continue.

If the box was ticked, you are then prompted for “Password of the database’s administrative user:” and given another text box. Use the MySQL root password that you just made up.

After this, the installation should complete itself without any more human help.

Restarting the Apache server

Before anything can be done, the Apache server will need to be restarted.

Open a terminal (Applications -> Accessories -> Terminal) and, at the command line, type:

sudo apache2ctl restart

The first time I did this, I received this warning:

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

This went away when I did this:

Letting Apache know about localhost

Open a terminal (Applications -> Accessories -> Terminal) and, at the command line, type:

sudo gedit /etc/apache2/apache2.conf

The sudo command gives you root-like powers (needed here to edit this particular file), gedit opens the notepad-like application, and /etc/apache2/apache2.conf is the name of the file being edited.

(If prompted for a password, use the password that is used to log in to Ubuntu.)

This should open a notepad-like window with a lot of stuff.

I added

ServerName localhost

as a separate line at the end of the file and saved the document (File -> Save in gedit).

After saving, restart Apache again by typing

sudo apache2ctl restart

at the command line.

Testing to make sure PHP works

Open a terminal window by going to

Applications -> Accessories -> Terminal

Type this (pressing enter when finished) at the command line:

cd /var/www/

This takes you to the /var/www folder. Then type:

sudo gedit

and press enter. You’ll be prompted for your system password (the one used to log in to Ubuntu). (The ‘gedit’ opens a notepad application; the ‘sudo’ is necessary because if gives you root-like powers which are needed to save a file in the /var/www folder.)

In the notepad application that should have popped up, type the following:

# test.php
<?
phpinfo();
?>

Then go to File -> Save As and enter test.php as the name of the file.

Open a browser (like, say, Firefox at Applications -> Internet -> Firefox Web Browser) and type

http://localhost/test.php

and you should get a page come up with all sorts of useful and interesting information about your Apache server! It works!

(If you get a page that just says “# test.php” then Apache doesn’t know about localhost. Try editing /etc/apache2/apache2.conf and restarting the Apache server as described above.)

Setting up phpMyAdmin

If you’ve opted for phpMyAdmin, there is one quick little thing to do to make it work.

Open a terminal window (Applications -> Accessories -> Terminal) and type:

sudo gedit /etc/apache2/apache2.conf

at the command line prompt. If prompted for a password, use the password for logging in to Ubuntu.

Add this line to the file that has been opened in the notepad-like window:

Include /etc/phpmyadmin/apache.conf

Make sure this is on a line of its own. Save the file (File -> Save), close the gedit window and restart Apache by typing:

sudo apache2ctl restart

at the command line prompt.

Check to make sure phpMyAdmin works

Open your favourite web browser (say, Firefox) and navigate to:

http://localhost/phpmyadmin/

This should bring up a login screen. You can log in to phpMyAdmin by using ‘root’ as the username and the mysql root password set during installation.

The mysql root password can be changed in phpMyAdmin by going to the privilege page and clicking the pencil icon next to each root account. Enter a password in appropriate field of the newly-loaded page.

Once logged in, you can use phpMyAdmin to manage your MySQL databases.

Where Important Things Are

Here’s where to find useful stuff.

The Apache configuration file is located at:

/etc/apache2/apache2.conf

The default web folder is here:

/var/www

Apache error logs are here:

h1

If anything goes horribly wrong, reading these can often be very helpful. (Even if what’s written in the file makes no sense, it’s often quite easy to pop the error message or warning into Google. Very often, there’s someone talking about the problem using real words in the first page of hits.)

Apache access logs live here:

/var/log/apache2/access.log

NB: Both etc and var can be found two levels ‘up’ from the home folder.


Filed under: apache,lamp server,mysql,php,Ubuntu 10.04
May 13th, 2010 12:54:28

Ubuntu 10.04: installing java and the CGoban 3/KGS client

May 10th, 2010

Now to get KGS working on the 10.04 machine….

First, java is needed:

sudo apt-get install openjdk-6-jre

A quick check of java -version tells me I’ve just installed

java version “1.6.0_18”
OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)

Then, I downloaded cgoban.jnlp from the KGS CGoban Download page by clicking the link entitled “CGoban for Java Web Start”.

I put this file on my desktop.

Run cgoban.jnlp by typing

javaws cgoban.jnlp

from the command line or double-clicking or right-clicking the file and choosing “Open with OpenJDK Java 6 Web Start”.

This causes a file called CGoban_3.desktop to appear on the desktop and opens CGoban 3 (which provides an option for connecting to KGS). The first time this runs, a security warning about digital signatures pops up; I ticked the “Always trust content from this publisher” box and clicked “Run”.

After this, CGoban and KGS can be accessed by double-clicking CGoban_3.desktop (or by right-clicking and selecting ‘Open’).

Doing this gave me an warning message:

Untrusted application launcher

The application launcher “CGoban_3.desktop” has not been marked as trusted. If you do not know the source of this file, launching it may be unsafe.

The only option was to ‘Cancel’ the launch.

To allow this to run, right-click CGoban_3.desktop and choose “Properties”. In the “CGoban 3 Properties” pop-up, choose the “Permissions” tab and click the box near the bottom that says “Execute: Allow executing file as program”. (This caused the file to display on my desktop as “CGoban 3” with a KGS go stone logo.)

Double-clicking (or right-clicking and choosing “Open”) now opens CGoban and allows one to connect to KGS.

The cgoban.jnlp file can now be deleted or moved elsewhere.

Note: I get a significant delay between clicking the icon and the CGoban main menu appearing – long enough that I tend to think I haven’t clicked properly or that something is broken. It is a muuuuuch longer delay than the unnoticeable pause I get between clicking and menu coming up in Ubuntu 8.04 with Java 1.5.0_22.


Filed under: cgoban/KGS client,Installation,Ubuntu 10.04
May 10th, 2010 16:49:01

Ubuntu 10.04: turn off automatic screen lock/disable re-login after computer has been idle

May 10th, 2010

Navigate to:

System -> Preferences -> Screensaver

to open the Screensaver Preferences" dialog box.

Uncheck "Lock screen when screensaver is active" at the bottom of the dialog box.


Filed under: Customisation,Ubuntu 10.04
May 10th, 2010 16:19:30

Ubuntu 10.04 – getting xmms to work again

May 09th, 2010

Well, yet again xmms isn’t working. Oh, life is hard when one loves deprecated software!

Now, to make matters worse, some of xmms’ dependencies have been deprecated as well.

Out of sheer perversity, I decided to install all the old schtuff to see if I could get xmms to work.

(I don’t necessarily recommend doing this in general, mind you – I usually try to avoid installing random deprecated things which may have security holes, conflict with everything else installed or generally cause annoyances. However, it was late and I was in a mood. Since installation, Since installation, I’ve had a closer look and I don’t think that adding these deprecated packages should cause any problems for a clean installation of 10.04, but it is possible that they could cause conflicts with other packages one might choose to install. For me, it is definitely worth the risk!)

Here’s what I did to get xmms working:

Went to:

Downloaded and installed:

  • libglib1.2ldbl_1.2.10-19build1_i386.deb

Went to:

Downloaded and installed (in this order):

  • libgtk1.2-common_1.2.10-18.1build2_all.deb
  • libgtk1.2_1.2.10-18.1build2_i386.deb

Went to:

Downloaded and installed:

  • xmms_1.2.10+20070601-1build2_i386.deb

Amazingly, this seemed to work!

…Mostly. I’m now getting some terrible moments where the track repeats until I move the mouse. It sounds rather like a CD does when it gets caught on and plays the same hyper short bit of a track over and over again until someone with Fonz power hits it. There was certainly no such bad behaviour a couple days ago when I was happily xmms-ing away on Jaunty.

Just for kicks, I tried Audacity and, interestingly enough, it seems to be plagued with the same skippy repeaty problem.

I don’t think this skipping is a problem with xmms; I think it’s a problem with something else. If this happens, closing and re-opening xmms sometimes works. If other applications are running that involve audio, try closing them. On one occasion, I had to restart the computer, but after that xmms worked fine.

Not sure what’s going on. Audio is a black art. I’m going to bed.


Filed under: Fixes,Ubuntu 10.04,xmms
May 09th, 2010 03:11:02

Ubuntu 10.04 – Move close/maximise/minimise buttons to the right-hand corner of the window (GNOME desktop environment)

May 09th, 2010

Now that I’ve moved the close button to the right of the maximise and minimise buttons, I want to move all three buttons to the right-hand side of the window.

On the computer I don’t care about messing up, I’m trying ubuntu-tweak which I saw mentioned on the Ubuntu forums.

Here’s what worked for me.

I went to http://ubuntu-tweak.com/ and clicked the big button on the left hand side of the page to download and install the latest version of ubuntu-tweak (version 0.5.4.1). Ubuntu automagically gave me the option to install; it was quite a painless procedure.

Once installed, I could access ubuntu-tweak by navigating to:

Applications -> System Tools -> Ubuntu Tweak.

To move the close/maximise/minimise buttons to the right-hand side of the window in a GNOME desktop environment, find:

Desktop -> Window Manager Settings

on the tree view on the left. Click on:

Window Manager Settings.

There, right at the top, in all its glory, sits

Window Titlebar Button Layout

and the choice of “Place”. Click the radiobutton to select

Right

and viola! Life is a better place in which to live. I feel so much better now.

(This seems to sort out the position of the close button in relation to the maximise/minimise buttons as well, so the previous post is unnecessary.)

Note: I’ve never used ubuntu-tweak before so can’t make any guarantees about its safety, reliability, compatibility, etc. As stated before, I’m trying it out on a computer that I’m happy to mess around with.


Filed under: Customisation,GNOME,Ubuntu 10.04
May 09th, 2010 00:52:54

Ubuntu 10.04 – changing the order of the maximise/minimise/close buttons

May 07th, 2010

Well, I’ve finally started the process of migrating my computers to Ubuntu 10.04. This means several rounds of fixing things. Might as well post it all here as I’ll be doing this at least three more times. >+:Sigh:+< One of the things I wanted to do was put the close button on the right of the maximise and minimise buttons, as they were situated in previous versions of Ubuntu. Note: follow the instructions in the above post to move the buttons to the right hand side of the window and change the order of the buttons so that the close button is on the right of the maximise/minimise buttons. Follow the instructions below to leave the buttons on the left-hand side of the window but to put the close button to the right of the other two.

This site had instructions for changing the order of the buttons:

  • Open the configuration editor (press Alt+F2 and type gconf-editor)
  • In the left-hand tree, find app -> metacity -> general and double-click on the field called button_layout.
  • Change the value field to menu:minimize,maximize,close to move the close button to the right of the minimise and maximise buttons.

Thank you, Codigo Manso!


Filed under: Customisation,GNOME,Ubuntu 10.04
May 07th, 2010 18:52:43