Monday, November 23, 2009

Install GNOME Do and Docky in Ubuntu

Docky is a dock application for Linux. Until now it has been a part of the fantastic keystroke launcher GNOME Do. Now it is its own separate program. While GNOME Do is already in the Ubuntu repositories, Docky, having just been released on its own, is not. To install the new Docky you will need to add its repositories. First, make a backup of your original repositories list, if you haven't already done so:
$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.orig
Now add these two lines to /etc/apt/sources.list
deb karmic main
deb-src karmic main

Import the key used to sign the packages:
$ sudo apt-key adv --recv-keys --keyserver 3528AE20
Update the package listings:
$ sudo aptitude update
Install GNOME Do and Docky:
$ sudo aptitude -y install gnome-do docky
Both of these new programs can be found under Applications>Accessories.


Wednesday, November 18, 2009

Set path in Unix C shell

In Linux, the default shell is BASH. The C shell is one of the alternatives available and is the default shell in FreeBSD. If you need to manipulate directories in the path environment variable using the C shell, this is how you make changes:
set path = ( $path /location/to/add )
If you want to add more locations you can. If you want to completely override the default path with something completely new then leave off the $path part. Running this command on its own will set the path until you log out. To set it permanently for a given user add that line to that user's ~/.cshrc file.

Thursday, November 5, 2009

Upgrade to the next Ubuntu release

Last week Ubuntu 9.10 was released. For those users who already have Ubuntu installed there are two real options for installing the new version: upgrade or clean install. I prefer the clean install route but if you want to upgrade Ubuntu makes it very easy and gives you two way to do it.

If you want to use the graphical update manager open it by going to System > Administration > Update Manager. Make sure you have any outstanding updates installed and then click the "Upgrade" button.

If you prefer the command line approach or if you are upgrading a server it is still pretty easy. First make sure you have all your outstanding updates installed:
$ sudo aptitude update && sudo aptitude -y full upgrade
Next you have to install the updater package:
$ sudo aptitude -y install update-manager-core
Now run the command to begin the upgrade process:
$ sudo do-release-upgrade
Now just follow the instructions to upgrade your system. When you finish you will have to restart to make the changes take effect. To check which version of Ubuntu you are running you can use this command:
$ cat /etc/lsb-release

Reset sound settings in Ubuntu

Ever messed around with the settings on your computer and not been able to get them back to what they used to be? I have. Most recently I have played around with my sound settings in Ubuntu and then wanted to revert back to the original settings but I had made too many changes to be able to. In the end its sometimes just easiest to completely remove the existing configuration and install the default settings anew. Run this command:
$ sudo aptitude -y purge alsa-base && sudo aptitude -y install ubuntu-desktop
When you purge the ALSA settings it will also remove the meta-package ubuntu-desktop. That is okay. It will not remove any actual packages other than alsa-base. To reinstall the default sound settings all you have to do is reinstall the ubuntu-desktop meta-package and it will install all of its missing dependencies, one of which is alsa-base.

Terminate a a frozen SSH session

As a frequent user of SSH I will regularly forget about an open session, put my laptop to sleep and when I open it back up find myself with a frozen Terminal session. This is an annoyance that I have always just solved by closing that session. Well it turns out there is a cleaner solution to this problem. When you find yourself with a frozen SSH session, enter these keystrokes to close the frozen connection:
Thanks to Command Line Fu user n20 for pointing this out.

Sunday, November 1, 2009

Lock down the IR receiver on your Mac for added security

All MacBooks, MacBook Pros, Mac Minis, and iMacs come with an infrared, or IR, receiver which allows them to be controlled via an Apple Remote. This makes it really easy to interact with various media applications from across the room. You an play, pause and adjust the volume. You can also start and control the Front Row application with the remote or navigate through presentations with PowerPoint or Keynote.

These are all good things from a usability standpoint. However, from a security standpoint they present something of a concern. First of all, Apple Remotes are an accessory that users have to pay for. This has been the situation for some time now. When users choose not to buy a remote they likely forget all about the fact that there is an IR receiver on their computer. The other issue is that all Apple Remotes will work with all Apple hardware products, not just the product it was sold with.

In the real world what does this mean? It means that I can sit in a lecture hall during a class and, using my Apple Remote, play around with the media applications on the Macs belonging to the people sitting in front of me. As a sort of social and security experiment I have started doing this in my classes. So far, no one has taken the effort to lock down their Mac's IR receiver to prevent this sort of activity.

There are two ways to lock it down. The first way is to completely disable the IR receiver. The other way is to "pair" your Mac to a specific remote. By pairing, you can still use your remote to control your presentations or media applications and you can rest assured that no one else will be able to do the same thing with their remote.

Open up System Preferences and click on the Security button:

If the lock at the bottom left of the window is locked (which it should be!) click it and enter your password to unlock it. You can click the "Pair..." button to setup pairing with your Apple Remote.

You have to point the remote at the IR receiver on your Mac and hold down the "next" and "menu" buttons simultaneously on the remote. After a few seconds an indicator will flash on the screen telling you that you have successfully paired your remote with your Mac. If you have a remote I would highly recommend pairing it. If you either don't have a remote or if you never use it, then I would highly recommend disabling the IR receiver. You can do that by checking the box next to the "Pair..." button. I have my Mac paired with my remote and unless I am going to be using my remote for something I like to keep the IR receiver disabled.