Archive

Archive for the ‘Ubuntu’ Category

Trac-BZR: installing on Ubuntu/Debian

September 15th, 2009 admin No comments

A project I’m working on recently switched from Subversion (SVN) to Bazaar (BZR) for its Version Control System (VCS). Of the many things we didn’t like about Subversion (merging, line-ending conflicts, etc..), there were some things we’d grown to like, primarily the mature 3rd party ecosystem and its bread-winner Trac.Thankfully there are projects to extend Trac’s reach to other VCSs.

Of interest to me was trac-bzr. Since Bazzar has the power of Canonical behind it, a cursory glance at the “universe” repository shows a package named “trac-bzr”. However a closer look reveals that this package is quite outdated:

>apt-cache show trac-bzr
Package: trac-bzr
Priority: optional
Section: universe/python
Installed-Size: 156
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Original-Maintainer: Chris Lamb <chris@chris-lamb.co.uk>
Architecture: all
Version: 0.2+bzr31-3
...

This seemed like a bad idea, seeing as the main branch was already at r69.

Here are the instructions on installing the latest version:

1. Make sure you have bzr installed

sudo apt-get install bzr

2. Get the latest version of trac

sudo apt-get install trac

3. Get the latest version of trac-bzr, and put it in a revisioned directory.

bzr export ./trac-bzr-r`bzr revno lp:trac-bzr` lp:trac-bzr

4. Install the plugin

cd trac-bzr-r*
python setup.py install

5. Configure trac to use the plugin as described in the trac-bzr README

Categories: System Admin, Ubuntu Tags:

Getting keyboard volume control working in KDE

September 4th, 2009 admin No comments

I recently switched from Gnome to KDE. One thing I noticed was the my volume up / volume down keys stopped working. The on-screen volume meter showed up, and reflected changes when I hit volume up or down, but it wasn’t changing my sound.

If I had kmixer open, I could see that the keys were manipulating the PCM channel, not the Master or Front channels. A Google search later turned up a ticket on Launchpad. Turns out all you need to do is right click on the volume icon in the system tray and select “Select Master Channel…”.

For me, “PCM” was selected. I changed it to “Master” and viola

Categories: Ubuntu Tags:

Why does my keypad reset my X server?

October 6th, 2008 admin No comments

For a while I’ve had this weird bug on my Ubuntu laptop where, while using an external keyboard, if I hit any key on the numeric keypad the current X server would reset. Incredibly annoying. What’s worse, is that I never really got around to “fixing” the problem, I just trained my right hand to not stray too far to the right. But of course, accidents happen, and this last time of losing work was the final “home loan that brought down the US economy”.

The problem originates somewhere between XGL and using your numeric keypad to control the pointer (known as Mouse Keys).

If you’re sure you don’t need XGL (check your xorg.conf first!), then simply remove it:

sudo apt-get remove xserver-xgl

And disable your Mouse Keys:

  1. System -> Preferences -> Keyboard
  2. Mouse Keys (tab)
  3. Uncheck “Allow to control the pointer using the keyboard”

Now restart your machine, and VoilĂ 

Categories: Ubuntu, Uncategorized Tags:

Specifying a JVM for applications that don’t ask

February 26th, 2008 admin No comments

Some programs (ie. Eclipse) will ask you which JVM you want to use in the event that you have multiple. Other programs will just scrape your PATH for the first Java binary.

Say you want to run Azureus with Java 6 but you don’t want to install the JRE from Ubuntu repositories.

  1. Download the JRE binaries from http://java.sun.com ( or whatever JRE you want )
  2. Download an application that requires a JRE
  3. Run the following in your terminal:
    (PATH=/path/to/your/java/executable:$PATH && \ /path/to/the/app/to/run)
  4. Make sure to wrap you command in parentheses!

What’s happening here is:

  1. You are prepending the location of the new JRE to your current PATH variable
  2. If that was successful, you are executing your application. If not, then your application won’t be started
  3. All of this is done within a set of parentheses. This runs everything in a subshell. When you exit the application, your regular PATH variable is untouched.
Categories: Ubuntu Tags: , , ,

The closest thing to piping a password to SSH

February 26th, 2008 admin No comments

There are a few cases in life where you want to connect to SSH without having to type in the password by hand. Most of the times you can use ssh-keygen and use private (or public) keys.

However, for the 0.5% of the time where you cannot use keys, you can use a little program called expect.

BTW, this does not, and should NEVER work:
echo 'mypassword' | ssh user@server

Installing Expect:
sudo apt-get install expect

Create the expect script:
nano connect.sh

Paste the basic code:

#!/usr/bin/expect
set timeout 60
spawn ssh -l username server
expect "password: $"
send "password\n"
expect "$ $"
interact

Replace ‘username’ and ’server’ on line 3 and ‘password’ on line 5.
The second to last line, ‘expect “$ $”‘ is for a bash shell. Replace the first ‘$’ with whatever your prompt is.

Save ( ctrl + o ) and Exit ( ctrl + x )
Make the script executable
chmod +x connect.sh

Credits

Categories: System Admin, Ubuntu Tags:

Bringing back wireless after suspend in Ubuntu Gusty

February 24th, 2008 admin No comments

It’s true that some features of Linux aren’t quite as reliable as their Windows counterparts. For me one of those “nice to have but not totally necessary” features has been Suspend and Hibernate. In the past, I’ve had experiences where either the OS just hangs or never wakes up. However, my new experience is that (with Ubuntu Gusty (7.10)) everything comes back from Suspend or Hibernate EXCEPT my wireless interface. If you’re like me (and everyone else on the planet) your wireless connection is vital.

After some searching on Ubuntu’s launchpad, I found the answer:

Open /etc/default/acpi-support

sudo nano /etc/default/acpi-support

Add networking to the STOP_SERVICES. For me it was on line 61.

Before

# Add services to this list to stop them before suspend and restart them in
# the resume process.
STOP_SERVICES="mysql"

After

# Add services to this list to stop them before suspend and restart them in
# the resume process.
STOP_SERVICES="mysql networking"

Your wireless should now come back after Suspend / Hibernate.

Categories: Ubuntu Tags: