Mar 11 2009

HOWTO: Enable Eject button on Dell XPS M1530 in Ubuntu

Simply add this to /etc/sysctl.conf:

# Unlock the CDROM eject button
dev.cdrom.lock=0

You have to restart for it to take effect.

Mar 11 2009

HOWTO: Enable finger print reader on Dell XPS M1530 in Ubuntu

To enable the finger print reader on a Dell XPS M1530 in Ubuntu 8.10 follow these steps:

After installing from the normal repositories coming with Ubuntu 8.10, you would have to press enter after sweeping finger. (This bug: https://bugs.launchpad.net/ubuntu/+source/thinkfinger/+bug/256429) Therefore Jon Oberheide made an update that can be found here: https://launchpad.net/~jon-oberheide/+archive

Add the PPA repositories to your source.list (/etc/apt/source.list):

deb http://ppa.launchpad.net/jon-oberheide/ubuntu intrepid main
deb-src http://ppa.launchpad.net/jon-oberheide/ubuntu intrepid main

Update installer:

$ sudo apt-get update

And install:

$ sudo apt-get install thinkfinger-tools

Now the driver is installed and should be working. You can try it with

tf-tool --acquire
tf-tool --verify

This will ask you to swipe your finger three times and save the fingerprint to ~/.thinkfinger.bir

Now we need to configure PAM to use finger print reader to authenticate.
Open /etc/pam.d/common-auth:

sudo /etc/pam.d/common-auth

On Ubuntu 8.10 - Intrepid Ibex you should just edit the section of the file that contains the pam_unix.so line so it looks like this:

....
# here are the per-package modules (the "Primary" block)
auth	sufficient	pam_thinkfinger.so
auth	[success=1 default=ignore]	pam_unix.so try_first_pass nullok_secure
# here's the fallback if no module succeeds
....

Save the file and reboot. You should now see the option to “Swipe your finger” at login and when issuing sudo commands.

Mar 11 2009

HOWTO: Fix lame touchpad speed on Dell XPS M1530 in Ubuntu

Ubuntu 8.10 Intrepid Ibex

New Xserver in Ubuntu 8.10 requires changing settings via HAL instead of xorg.conf file. To change touchpad’s settings in HAL you have to create new .fdi file:

gksudo gedit /etc/hal/fdi/policy/xps-touchpad.fdi

and fill it with:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
 <device>
  <match key="input.x11_driver" string="synaptics">
   <merge key="input.x11_options.LeftEdge" type="string">120</merge>
   <merge key="input.x11_options.RightEdge" type="string">830</merge>
   <merge key="input.x11_options.TopEdge" type="string">120</merge>
   <merge key="input.x11_options.BottomEdge" type="string">650</merge>
   <merge key="input.x11_options.FingerLow" type="string">14</merge>
   <merge key="input.x11_options.FingerHigh" type="string">15</merge>
   <merge key="input.x11_options.MaxTapTime" type="string">180</merge>
   <merge key="input.x11_options.MaxTapMove" type="string">110</merge>
   <merge key="input.x11_options.ClickTime" type="string">0</merge>
   <merge key="input.x11_options.EmulateMidButtonTime" type="string">75</merge>
   <merge key="input.x11_options.VertScrollDelta" type="string">10</merge>
   <merge key="input.x11_options.HorizScrollDelta" type="string">0</merge>
   <merge key="input.x11_options.MinSpeed" type="string">0.45</merge>
   <merge key="input.x11_options.MaxSpeed" type="string">0.95</merge>
   <merge key="input.x11_options.AccelFactor" type="string">0.06</merge>
   <merge key="input.x11_options.EdgeMotionMinSpeed" type="string">200</merge>
   <merge key="input.x11_options.EdgeMotionMaxSpeed" type="string">200</merge>
   <merge key="input.x11_options.UpDownScrolling" type="string">1</merge>
   <merge key="input.x11_options.CircularScrolling" type="string">0</merge>
   <merge key="input.x11_options.SHMConfig" type="string">true</merge>
  </match>
 </device>
</deviceinfo>

then:

sudo /etc/init.d/hal restart

and restart Xserver (Ctrl+Alt+Backspace)

Dec 31 2008

HP OfficeJet 6310 not printing with Ubuntu

I hooked up an HP OfficeJet 6310 printer to my Ubuntu 8.10 desktop but could not find a 6300 series driver. The solution was to use the HP OfficeJet 7110 cups+Gutenprint driver.

Nov 06 2008

DVD Drive stopped working after upgrading to Ubuntu 8.10

I decided to upgrade one of my computers to Ubuntu 8.10 Intrepid Ibex. I downloaded the iso, popped it into my DVD/Burner and rebooted. Halfway through the boot it bombed out. So I tried it again, this time popping the CD in my DVD/Reader. Success. It booted fine and I installed Intrepid onto by hard drive.

But, now after booting Intrepid my DVD/Burner (Panasonic LF-D521) no longer works. When I pop in a CD I get this error in ‘dmesg’: COMMUNICATION CRC ERROR (ULTRA-DMA/32). If I boot the 8.04 Hardy CD everything works again. So It’s an OS problem. True, but read on …

Searching the net on this error showed many Windows users having the same error too. One person said they had an old CD drive attached as a secondary drive on the same cable as their brand new fancy burner. They removed it and the Burner began working again. Well, I have an old DVD Reader attached as a secondary drive. I shut down the computer, disconnected the old drive, rebooted, and guess what? My DVD/Burner is now working again!

Update: 2008-11-06
I swapped out the old Samsung DVD/Reader (SD-612) with a newer Samsung DVD/Reader (NEC DV-5800A) and now both my DVD/Burner and DVD/Reader work.

Oct 28 2008

HOWTO: Copying a Filesystem between Computers

If you need to transfer an entire filesystem from one machine to another, for example, when you get a new computer, do the following steps.

1) Boot both PCs with any Linux live CD (for example, Knoppix), and make sure they can access each other via the network.

2) On the source machine, mount the partition containing the filesystem to be copied, and start the transfer using netcat and tar:

cd /mnt/sda1
tar -czpsf - . | pv -b | nc -l 3333

3) On the destination machine, mount the partition to receive the filesystem, and start the process:

cd /mnt/sda1
nc 192.168.10.101 3333 | pv -b | tar -xzpsf -

The nc (netcat) command is used for any kind of TCP connections between two hosts. The pv (progress viewer) command is used to display the progress of the transfer. tar is used to archive the files on the source machine and un-archive them on the destination.

Oct 25 2008

Everything you Need to Know about Ubuntu 8.10 - Intrepid Ibex

Ubuntu 8.10, named Intrepid Ibex, is scheduled for release next week, so we figured it’s time to run down the checklist of improvements, fixes, and enhancements since Hardy Heron came out earlier this year.

Everything you Need to Know about Ubuntu 8.10 - Intrepid Ibex | Maximum PC.

Oct 05 2008

A complete zenity dialog examples 1 » Linux by Examples

Have you ever needed to display information or get information from the user from within one of your scripts? There is a slick little utility for Gnome systems called ‘zenity‘ that will do the trick. (zenity for gnome, kdialog for KDE, xmessage for other windows managers) Here is a link to a site that has some zenity examples for you to try.

We have introduce how to make use of GUI dialog box in Using GUI dialog box, where we give an example of how zenity create a question dialog box. Besides question dialog box, zenity can create more than that, such as calendar, entry, error, info, file selection, list, notification, progress, warning, scale and text info. In this tutorial, we would like to illustrate how to create every single zenity dialog by examples.

A complete zenity dialog examples 1 » Linux by Examples.

Oct 04 2008

Canon MF4150 Printer Driver for Linux

I recently setup an Ubuntu desktop at a community center. They had a donated Canon MF4150 multifunction laser printer, scanner, and FAX that they wanted to use as the printer. (I just needed to get the printer portion working; not the scanner or FAX.)

Ubuntu 8.04 did not have a driver for the MF4150. Canon makes a driver for Debian/Ubuntu but does not offer it via their USA web site. However, if you go to their Australian web site you can download the driver. Their are two .deb files in the tar file that you download. Install both of them. You should now have the MF4100 Series driver listed when you go to install printers.

This got the printer working but the scanner still did not work.

Ok after digging around for a while, I’ve managed to get my scanner to work when connected to USB.
Read more »

Oct 01 2008

Grsync rsync GUI interface frontend

Here’s a nice little program to setup rsync jobs using a GUI. It is also available from the Ubuntu software repository.

Grsync is a GUI (Graphical User Interface) for rsync, the commandline directory synchronization tool. It makes use of the GTK libraries and is released under the GPL license, so it is opensource. It doesn’t support all of rsync features, but can be effectively used to synchronize local directories and supports remote targets in a limited way (read: manual). For example some people use grsync to synchronize their music collection with removable devices or to backup personal files to a networked drive.

OPByte Software: Grsync rsync GUI interface frontend.

Sep 25 2008

HOWTO: Shutdown and reboot without sudo password

If you are gnome user, you probably enjoy shutdown with just a click on the dialog. In order to shutdown from the command line, you are requested to be either root or use sudo, such as

sudo shutdown -h now

With sudo, you need to type your password. Sometimes it will be more convenient if we are able to shutdown without sudo. Is it possible?

The answer is yes, there are two ways.

1. Adding suid mode to /sbin/shutdown
2. Modify /etc/sudoers with visudo

1. Adding suid mode to /sbin/shutdown

By adding suid mode to the shutdown command, you are allowing a regular user to run the shutdown command as root.

sudo chmod u+s /sbin/shutdown

Now you can run shutdown without needing sudo.

2. Modify /etc/sudoers with visudo

This seems to be the proper way to allow a command to run as root from specified users without needing to type a password.

sudo visudo

By running visudo, it edits /etc/sudoers.

Adding the line below to that file, assume myuser is the user that you want to allow to run the shutdown command without a password.

myuser ALL = NOPASSWD: /sbin/shutdown

For ubuntu, usually the default user is in the %admin group. Therefore, you can also allow all users from the %admin group to shutdown without a password.

%admin ALL = NOPASSWD: /sbin/shutdown

In fact, you still need sudo to shutdown, but this time you do not need to specify a password.

sudo shutdown -h now

You can also reboot the system by using the shutdown command too.

sudo shutdown -r now
Sep 12 2008

Share a Keyboard/Mouse Between Multiple Computers With x2x

Here is a great article from Linux Journal.

If you have multiple computers on your desktop there are a number of scenarios for using them:

* The brute force way: get a big desk and a swivel chair and spin back and forth between keyboards/mice
* Use VNC or rdesktop to control secondary computers from your primary computer. The main problem with this is that you lose all the screen real estate on your secondary computers and end up with their desktops showing in a window on your primary computer.
* Get a KVM to allow you to switch one keyboard/mouse between multiple computers.
The normal usage of a KVM is to switch your monitor as well as your keyboard and mouse, but that’s not required. KVM’s often seem like a great solution for many peripheral sharing problems, but they’re a bit of a hit-or-miss. They often have switching problems, system boot problems, video quality problems, and if you use multiple monitors a KVM to switch multiple monitors between systems gets pretty expensive.
* Use x2x, the solution we’ll examine here, to share the keyboard and mouse between systems.

There are two ways to run x2x on Linux, the easiest is to use ssh with X forwarding enabled and ssh from the primary system to the secondary system and run x2x on the secondary system:

primary $ ssh -X secondary x2x -east -to :0

The -X option tells ssh to enable X forwarding. The “x2x …” tells ssh to run x2x on the remote system (secondary) rather than running the shell. The “-east” option tells x2x where one system is relative to the other: to the east or west (-west).

The primary system is the system whose keyboard and mouse you are actually using. The secondary system is the one that is going to share the primary system’s keyboard and mouse.

Now, if you move the mouse on the primary system over to the edge where the secondary system is the mouse pointer should move from the primary screen to the secondary screen and from now on any mouse movement should be passed to the secondary system and anything you type on the keyboard should be sent to the secondary system. If this doesn’t work try moving the mouse to the other side of the screen, if that works then restart the command using “-west” rather than “-east”.

The other method of running x2x on a Linux system is to run it directly on the primary system and tell it to connect to the X server on the secondary system:

primary $ x2x -to secondary:0.0 -east

The reason this is not the easy method is that you also need to enable remote X access on the secondary system using xhost:

secondary $ xhost primary

and you also need to open TCP port 6000 on both systems. The easiest way of doing this is going to depend on your distro.

The main advantage of the second method is that copy/paste will now work between systems.

Getting x2x to work on a Windoze system takes a bit more work, mostly because first you have to install Cygwin. Although, if you’re a Linux fan you should already have it installed, it’s the only way to make Windoze bearable. When you’re installing Cygwin make sure x2x is selected in the list of available packages.

Using x2x with Cygwin has a couple of restrictions/problems:

* You can’t use the ssh connection method.
* You have to use the Windoze system as the primary system (i.e. you have to use the keyboard and mouse on the Windoze system).
* If you have multiple displays on your Windoze system you’ll probably experience mouse problems when you return the mouse from a secondary display. The only workaround is to move the mouse very very slowly when you’re about to move off a secondary display onto the primary display.

When using x2x on Windoze run the following command from a shell prompt:

windoze $ x2x -fromwin -to secondary:0.0 -east

Generally speaking x2x works very well both on Linux and on Windoze. Every once in a while you may get a bit of mouse flakiness when you move a window on a secondary display. Also once in a while, when using the shift key you may get the unshifted character on the secondary system if you type too fast. But in most instances you won’t notice any difference between typing/mousing on the primary system and on the secondary system.

p.s. If you have a problem where you get a “>” when you type “< " you need to find a newer version of x2x. This is long-standing bug that was recently fixed.

Aug 21 2008

FreeNX - Next Generation Remote Display

Optimize remote X sessions with NX. NX will also let you run remote X sessions from a Windows machine.

Next Generation Remote Display

NX is an exciting new technology for remote display. It provides near local speed application responsiveness over high latency, low bandwidth links. The core libraries for NX are provided by NoMachine under the GPL. FreeNX is a GPL implementation of the NX Server.

FreeNX - the free NX.

Video: http://www.youtube.com/watch?v=EUWMdgN51oQ

Aug 20 2008

nodoze - prepares websites built using Microsoft Windows for unix servers

This is a slick little perl script to move sites from a Windows web server to a Unix web server.

When websites are built on computers running Microsoft Windows, the case of file and directory names is often ignored. Other “widowsizms” are also introduced such as ending files with .htm instead of .html. This causes BIG problems if the site is served under unix.

nodoze is a “quick and dirty” Perl program to repair these websites so that they will work properly on a unix server.

nodoze - prepares websites built using Microsoft Windows for unix servers

Aug 14 2008

Unix ‘ln’ tip

Links are commonly used to point from one filesystem location to another. They also have a more surprising use: to make a program that does several things, deciding what to do by checking the name it was called with. Here’s an example: a single program in /usr/bin that sets, shows, and removes at jobs:

$ ls -l at*
-rwsr-sr-x 1 ... at
lrwxrwxrwx 1 ... atq -> at
lrwxrwxrwx 1 ... atrm -> at

These are simple to write as shell scripts. The script simply needs to test its name:

myname=${0##*/}  # Program name without path
case "$myname" in
at) ... ;;
atq) ... ;;
atrm) ... ;;
*) echo "$0 ERROR: ..." 1>&2; exit 1 ;;
esac
Jul 29 2008

HOWTO: Convert Filenames to Lowercase

Back in the good old days, there was an operating system that didn’t seem to think NAME and name were different. The result was that sometimes when you transfered files from a floppy disk (remember them?) created on that Dumb Old System, you would clutter your directory with uppercase filenames. As us UNIX old-timers learned a nifty trick to get directory names to sort before filenames in the output of the ls command (namely, start directory names with an uppercase letter), having filenames with uppercase letters was irritating.
After using the mv command all too many times and typing things like mv FILE.TXT file.txt, I wrote this script. I was thinking I could put a new coat of paint on it but, in reality, it does the job and is easy to understand. (The line numbers are there, of course, just for reference.)

.
    1   #!/bin/sh
    2   # lowerit
    3   # convert all file names in the current directory to lower case
    4   # only operates on plain files--does not change the name of directories
    5   # will ask for verification before overwriting an existing file
    6   for x in `ls`
    7     do
    8     if [ ! -f $x ]; then
    9       continue
   10       fi
   11     lc=`echo $x  | tr '[A-Z]' '[a-z]'`
   12     if [ $lc != $x ]; then
   13       mv -i $x $lc
   14     fi
   15     done

Line 6 starts a loop (which ends with line 15). The ls command returns a list of filenames which are sequentially assigned to the shell variable x. The if test (lines 8 through 10) checks to see if the current filename is that of a plain file. If not, the remainder of the statements in the current loop iteration are skipped.

If line 11 is to be executed we know that we have an ordinary file. Using tr we convert the filename to lowercase and assign the new name to the shell variable lc. Line 12 then checks to see if the lowercase version of the name differs from the original. If it does, line 13 is executed to change the name of the original file to the new lowercase name. The -i option causes the mv to prompt for confirmation if executing the command would overwrite an existing filename.