Thursday, November 29, 2012

Ruby require_relative Backwards Compatibility

The following snippet can be used when using require_relative within ruby to ensure it is backwards compatible with older versions which do not contain require_relative:
# workaround to allow require_relative in ruby < 1.9.2 unless Kernel.respond_to?(:require_relative) module Kernel def require_relative(path) require File.join(File.dirname(caller[0]), path.to_str) end end end

Saturday, June 23, 2012

Upgrading to Ubuntu 12.04

Here are a few notes regarding upgrading to Ubuntu 12.04:
  • Use a separate user for running the upgrade (I've had problems in the past whereby user settings were somehow modified and I was unable to restore them and had to resort to deleting and re-creating my user)
  • Remember to show the terminal during the installation, as it prompts for input sometimes
  •  Following the installation, you may encounter this bug relating to permissions on ~/.config/nautilus-actions. The simple fix is to run the following:
    chmod u+r ~/.config/nautilus-actions

Monday, June 11, 2012

Ubuntu on Mac Grey Screen on Boot

Some time ago, I posted what I believed was a fix for my Mac hanging on boot before booting Ubuntu. Unfortunately, this did not completely resolve the problem and I still occasionally experience problems. However, I am happy to say that I have found a solution which is yet to fail!

Next time you encounter the Mac sitting on the grey boot screen rather than booting Ubuntu, plug something into one of the USB drives (I normally plug in my usb thumb drive or a usb mouse). I don't know exactly what the Mac is trying to do when it waits on this screen rather than booting Ubuntu, but plugging something into a USB drive seems to make it break out of its looping state and start booting Ubuntu.

Saturday, February 25, 2012

Skype webcam on 64 bit ubuntu

After a bit of searching, I think I've got to the bottom of my built in isight camera not working with skype. The problem was that I didn't have the 32 bit libraries installed. To resolve, perform the following:
  1. sudo apt-get install lib32v4l-0 libv4l-0
  2. Create a wrapper script within ~/bin/skype_wrapper/skype_wrapper.sh for starting skype containing the following:
  3. #!/usr/bin/env bash LD_PRELOAD=/usr/lib32/libv4l/v4l1compat.so skype
  4. Within a terminal, run the following:
  5. chmod +x ~/bin/skype_wrapper/skype_wrapper.sh
  6. You can then start skype by running the following from a terminal:
  7. ~/bin/skype_wrapper/skype_wrapper.sh

Add Missing apt-get Public Key

After updating your list of software sources within update manager, you may receive the following message:

'The action would require the installation of packages from non-authenticated sources'

To resolve, perform the following:
  1. Open a terminal and run:
  2. sudo apt-get update
  3. Then take note of all the numbers (keys) after ‘NO_PUBKEY’
  4. W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX
  5. Run the following for each missing public key:
  6. sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com XXXXXXXXXXXXXXXX
  7. Finally, run the following:
  8. sudo apt-get update
After this, you should be able to install the update through update manager without any problems

Saturday, December 17, 2011

Prevent Speaker Static in Ubuntu on Mac

One of the minor problems I've had since making the switch to ubuntu on a mac has been the static noises coming from the speakers. It's not loud and if there is any ambient noise around, it is almost impossible to hear, however after a bit of googling, I came across this post which suggests a fix which worked for me. In summary:
  1. Run the following from a terminal to create an init script:
  2. echo -e '#!/bin/bash\nrmmod snd-hda-intel\nmodprobe snd-hda-intel' | sudo tee /etc/init.d/soundrestart
  3. Make the script executable by running:
  4. sudo chmod +x /etc/init.d/soundrestart
  5. Set the init script to run early in the startup sequence
  6. sudo update-rc.d soundrestart start 10 2 3 4 5 .
You will need to restart for the changes to take effect. Should this not resolve your problem, it can be reverted by running the following from the terminal: sudo update-rc.d -f soundrestart remove && sudo rm /etc/init.d/soundrestart

Saturday, November 12, 2011

Ubuntu 11.10 on Mac - Take 2

I've now finished setting up my ubuntu installation on my MacBook Pro 2,2. A few tips to keep in mind are as follows:
  • Use Partition Editor from within the ubuntu live disk to set the partion table to be dos prior to installation, otherwise you will encounter an error during installation when trying to install GRUB
  • To reduce the time the system spends on the grey screen before booting ubuntu, insert the mac os x install disk, open a terminal and type the following: bless --device /dev/disk0s1 --setBoot --legacy
  • To remove the red light from the headphone jack: amixer set IEC958 off
  • Keep in mind that if trying to copy files from your Time Machine disk, you might not be able to read some folders. I got around this by using a friend's mac to copy the folders from my Time Machine disk to a FAT formatted disk which ubuntu could read
From the ubuntu software centre, I installed the following:
  • BackInTime as my backup program
  • Gvim
  • VLC
  • rcs
  • texworks and texlive-latex-extra
I've found that the trackpad is not as sensitive as in mac os x but I'm getting used to it. The only other issue is that following a restart, bluetooth enables itself again. It's not a show-stopper but more of an annoyance. I will post an update if/when I discover a fix