GRUB Menu – Putting Windows Back on List

The Problem – upgraded Ubuntu kernel and the GRUB menu no longer had a line for starting Windows.

Solution tried: Opened menu.lst for editing using command:

sudo /boot/grub/menu.lst

and added the following section (+ reset default – NB zero-based so item 1 is 0 etc)

title Windows 95/98/NT/2000
root (hd0,0)
makeactive
chainloader +1

Nope – hd0,0 not correct on the dual boot kids computer.

OK ran the following command to see what partitions there were:

sudo fdisk -l

(NB that is an L not an i)

This returned something roughly like:

/dev/sda2
/dev/sda3
/dev/sda4
/dev/sda5

where the sda4 was the Windows partition. So I changed (hd0,0) to (hd0,3) and dual booting worked again.

And to prevent Ubuntu from wiping the Windows entry again I only put Windows under the Debian automagical line.

Slow query yet indexed – collation mismatch on index?

I had a simple query with 3 tables linked with one inner and one left join. Ran indescribably slowly – unless I changed the left join to an inner join (which I didn’t want to do). Yet all the links were indexed. EXPLAIN showed that the indexes were not being used. Why? Answer – one indexed field had a collation of utf8 and the other of latin1. Aligned that and everything worked nice and fast. Was there any indication from the output of EXPLAIN that this was the issue? No! Anyway, the syntax is DEFAULT CHARSET = latin1 or whatever after the ENGINE = part.

ACTA Concerns

The Anti-Counterfeiting Trade Agreement (ACTA) is currently being negotiated under the radar. See:

There are some major concerns about existing rights being signed away. The InternetNZ submission also makes numerous excellent points about TPMs (Technological Protection Measures). The major risk is that the interests of major multinationals will be allowed to outweigh the interests of citizens in a secretive, anti-democratic process.

Resistance is building thankfully, including international support for an open letter:

Signatories of the letter include everyone from the EFF to the Australian National University to the Canadian Internet Policy & Public Interest Clinic to Korea’s Christian Media Network to the Dutch Consumentenbond to Thailand’s Drug Study Group (DSG) to the Ecologist Collective from Guadalajara, México to the Egyptian Initiative for Personal Rights http://arstechnica.com/news.ars/post/20080916-100-groups-demand-to-see-secret-anticounterfeiting-treaty.html

Posted in IP

Fix for Firefox 3 Annoyance

Firefox 3 is great overall, even (especially) the Awesome Bar, but there is one annoyance. If you accidentally untick “Do not ask next time” when closing Firefox with multiple tabs open (e.g. by clicking anywhere above the buttons you do want – an easy mistake), it won’t ask you to “Save and Quit” again. The ability to Save and Quit is one of the great new things Firefox 3 has introduced.

Fortunately, you can recover. But only if you know what has happened and what to do.

Tools>Options>Main>Startup>When Firefox starts – Set to Home Page
Make sure Tools>Options>Main>Startup>Tabs Warn me when closing multiple tabs – TICK

Hasta La Vista Vista – Hello Ubuntu Hardy Heron

A friend was very dissatisfied with Vista on his new Compaq Presario C700 Notebook PC with 2GHz and 1Gb RAM.
Tux love
Wireless was Atheros AR5007 802.11b/g which is the same as in my Acer Aspire 4315. So I knew I could get that to work one way or another.

Step 1 – Tested using live CD. Check touchpad and mouse (cordless) works plus sound etc.
Step 2 – Total clean install using entire hard drive. Hasta la Vista Vista!
Step 3 – Get wireless working

Thanks to http://ubuntuforums.org/showpost.php?p=5146927&postcount=8

sudo aptitude update
sudo apt-get install build-essential
If you have problems with the last step, and you are asked to insert a CD, comment out the CD line in /etc/apt/sources.list
sudo gedit /etc/apt/sources.list
e.g. add # in front of line like deb cdrom:[Ubuntu 8.04 _Hardy Heron_ – Release i386 (20080422.2)]/ hardy main restricted
wget http://snapshots.madwifi.org/special/madwifi-nr-r3366+ar5007.tar.gz
tar xvf madwifi-nr-r3366+ar5007.tar.gz
cd madwifi-nr-r3366+ar5007/
sudo make
sudo make install
sudo modprobe ath_pci
If you change to the 2.6.26 kernel, you will need to blacklist ath5k (until they finally make it work reliably with ath 5007, in which case, forget the mad wifi drivers altogether).
sudo gedit /etc/modprobe.d/blacklist
add line: blacklist ath5k

System>Administration>Hardware Drivers – disable both wireless drivers. We are using the ones we installed from mad wifi.

sudo reboot

NB if you upgrade your installation and it changes the kernel you will need to follow the instructions here: Restoring Madwifi on Acer Aspire 4315 after Kernel Update

Step 4 – Get youtube, cds. DVDs working.

Medibuntu is your friend (media buntu). https://help.ubuntu.com/community/Medibuntu

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list

sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

Add ability to view DVDs
sudo apt-get install libdvdcss2

The grab all the other stuff you need:
sudo apt-get install w32codecs

Open www.youtube.com and you will be prompted to install flash. Use adobe’s for now.

Step 5 – get Ekiga (VOIP softphone) account, download all other desired apps e.g. Inkscape (make your own clipart), KolourPaint (simple drawing), Thunderbird + Lightning extension (email plus calendar), Scribus (Desktop Publishing), VLC (media playing), Keep (backups).

[Extra – as at 14/9/2008] Can add rmvb support as per http://www.simplehelp.net/2007/07/27/how-to-play-rmvb-files-in-ubuntu/. Add compiz configuration manager and try out the rotating cube etc. Check the screensavers are OK with the video card/compiz combination.

Reset MySQL password in Ubuntu

A fresh install didn’t seem to let me set/reset the password and for some reason I couldn’t get in. So thanks to: http://ubuntu.flowconsult.at/en/mysql-set-change-reset-root-password/ for the answer (which worked in Hardy):

1. Stop the MySQL Server

sudo /etc/init.d/mysql stop

2. Start the mysqld configuration.

sudo mysqld –skip-grant-tables &

3. Login to MySQL as root.

mysql -u root mysql

4. Replace YOURNEWPASSWORD with your new password!

UPDATE user SET Password=PASSWORD(‘YOURNEWPASSWORD’) WHERE User=’root’; FLUSH PRIVILEGES; exit;

Note: This method is not regarded as the securest way of resetting the password. However it works.

Restoring Madwifi on Acer Aspire 4315 after Kernel Update

Thanks first to: Link at http://www.ubuntugeek.com/

Make sure you are using the latest wifi drivers:

http://snapshots.madwifi.org/special/

If so, you just need to get to the directory you have the madwifi-nr-r3366+ar5007 (or similar) file in:

e.g. cd ~/Desktop/storage/madwifi-nr-r3366+ar5007 in my case

Then:

sudo make

sudo make install

sudo modprobe ath_pci

sudo reboot

If not, you must do the following first:

wget http://snapshots.madwifi.org/special/madwifi-nr-r3366+ar5007.tar.gz

tar xfz madwifi-nr-r3366+ar5007.tar.gz

Hardy and Compiz on a cheap Acer Aspire 4315

I did a fresh install of Hardy onto my Acer Aspire 4315 notebook (which had Gutsy pre-installed by the vendor Dick Smith Electronics). With a bit of help from a good friend I managed to replace the proprietary wireless drivers with madwifi ones*. I decided to see if the more complex compiz effects would work for me – and I was delighted when most of them did**. Fantastic – and all possible with a fraction of the hardware required for Vista (my notebook is only a 1.86GHz Celeron with 1Gb of RAM). Ubuntu is where the WOW begins.

[Update – use sudo apt-get install ubuntu-restricted-extras to do everything in one go]

The general codecs issue was easily dealt with once I added medibuntu as a repository as per https://help.ubuntu.com/community/Medibuntu.

Basically:

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install libdvdcss2
sudo apt-get install w32codecs

and you’re good to go playing DVDs etc.

To get youtube working I just let it prompt me for the codecs and they worked just fine.

Some extra touches to make the system easier to use: system>preferences>keyboard shortcuts and remap the special “e” key to the left of the keyboard to mute.
http://www.linuxquestions.org/questions/linux-laptop-and-handheld-25/…
…acer-blame-limitation-of-linux-for-four-key-flaws-in-their-ubuntu-laptop.-632342/

It might be best to avoid remapping the wireless key for anything – I think it still works to enable/disable wireless at a hardware level. See http://ubuntuforums.org/showpost.php?p=4804137&postcount=30. You can see it changing the contents of /proc/acpi/acer/wireless from 1 to 0 etc (NB to refresh in nautilus to see effect).

[Update for Intrepid onwards – install SHMconfig https://help.ubuntu.com/community/SynapticsTouchpad#shmconfig]

I wanted the touchpad disabled on boot so I added a new session under system>preferences>sessions with the command synclient TouchpadOff=1. I also added the line
Option “SHMConfig” “on”
in /etc/X11/xorg.conf as follows:

Section “InputDevice”
Identifier “Synaptics Touchpad”
Driver “synaptics”
Option “SendCoreEvents” “true”
Option “Device” “/dev/psaux”
Option “Protocol” “auto-dev”
Option “HorizEdgeScroll” “0”
Option “SHMConfig” “on”
EndSection

http://ubuntu.wordpress.com/2006/03/24/disable-synaptics-touchpad/

But how to get it back again when I don’t have a mouse? I went applications>system tools>configuration editor then apps>metacity>global_keybindings and bound run_command_1 to Alt t
Then under apps>metacity>keybinding_commands set command_1 to synclient TouchpadOff=1. Now I can enable the touchpad by pressing Alt t.

And I have just discovered that there is a webpage devoted entirely to this model notebook with Ubuntu. http://www.hbclinux.net.nz/acer4315.html

* madwifi-nr-r3366+ar5007 for those interested. Check out http://ubuntuforums.org/showthread.php?t=662877
The change away from proprietary drivers may have been what restored the functionality of restart.

Power management in Linux seems to be perennially problematic if you use a closed binary driver, and Ubuntu was, unfortunately, no exception. The desktop machines suspended and hibernated fine as long as you weren’t using proprietary video drivers, and the VAIO (with its Intel 915 controller) had a lightning-fast suspend/resume cycle. The Thinkpad also balked when using proprietary drivers.
http://www.informationweek.com/shared/printableArticle.jhtml?articleID=207200145

** NB to get cube effects working, set the workspace preferences to 4 cols and 1 row. To configure compiz, run the following:
sudo apt-get install compizconfig-settings-manager To get cairo dock working go to http://developer.berlios.de/project/showfiles.php?group_id=8724&release_id=13311 and install the appropriate deb. Then run cairo-dock (e.g. Alt F2) – see http://thedailyubuntu.blogspot.com/2008/02/cairo-dock-animated-launch-bar-for_03.html