Category: Unix

Mar 29 2009

HOWTO: Install Watchtower Library on Ubuntu Linux

Updated for Watchtower Library 2008

Install latest wine.

sudo apt-get install wine

As of this writing, I’m using Wine version 1.0.1

1. Pop in the CDROM and double click on Setup.exe icon when the Nautilus window pops up.

2. Run the install as normal. When finished, there should be two icons on your desktop. You can delete the ugly Watchtower Library XXXX.lnk icon. Keep the colorful one.

Your done!

Updated for Watchtower Library 2007

Install latest wine.

sudo apt-get install wine

As of this writing, I’m using Wine version 0.9.46

1. start from scratch (remove ~/.wine directory)

2. run winecfg. Chose “Windwows XP” as windows version. Close app.

3. Pop in the CDROM and double click on Setup.exe icon when the Nautilus window pops up.

4. Run the install as normal. When finished, there should be two icons on your desktop. You can delete the ugly Watchtower Library XXXX.lnk icon. Keep the colorful one.

At this point you could just launch Watchtower Library and it will work. However, if you want the tooltips to work (the floating yellow boxes) you will need to tell wine to use a version of comctl32.dll from an existing Windows installation. Keep going if you want the tooltip functionality, otherwise your done!

5. Copy comctl32.dll from a Windows XP (license is needed for this) :-(
(Note: The comctl32.dll from Windows 2000 works even better.)

cp comctl32.dll ~/.wine/drive_c/windows/system32/

Newer versions of wine include a file called ~/.wine/drive_c/windows/winsxs/manifests/x86_microsoft.windows.
common-controls_6595b64144ccf1df_6.0.0.0_none_deadbeef.manifest
. This file prevents the comctl32.dll that you just copied from loading. I just rename the file to something else like this:

mv ~/.wine/drive_c/windows/winsxs/manifests/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.0.0_none_deadbeef.manifest ~/.wine/drive_c/windows/winsxs/manifests/x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.0.0_none_deadbeef.manifest.bad

6. Run winecfg again.

7. On the “Applications” tab Click “Add Application” and browse to “Program Files\Watchtower\Watchtower Library XXXX\E” and double click on WTLibrary.exe.

8. With WTLibrary.exe highlighted on the “Applications” tab, click on the “Libraries” tab. In the “New Override for Library” box select “comctl32″. In the “Existing Overrides” box select “comctl32″ and click on the edit button. Select “Native then builtin”. Press “OK” until the winecfg box goes away.

9. The “M” and “*” marginal reference special characters do not display in the tooltips. To get this functionality you need to copy these files to the ~/.wine/drive_c/windows/fonts directory. These are fonts released under the GPL (see font information in the ttfs; the fontforge originals are found in the sources subdirectory).

10. Launch Watchtower Library. Everything should be working except that some of the icons will now have a black background. This is an issue with the comctl32.dll. Experiment with other comctl32.dll files from other versions of Windows. If you find one that works better let me know.

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)

Mar 11 2009

Installing Ubuntu on a Dell XPS M1530 - Ubuntu Wiki

via Installing Ubuntu on a Dell XPS M1530 - Ubuntu Wiki.

Feb 03 2009

Google Earth 5.0 Crashes on Ubuntu Linux

It installed okay using the shell script but I get this error when I try to run:

/opt/google-earth/googleearth-bin: relocation error: /usr/lib/i686/cmov/libssl.so.0.9.8: symbol BIO_test_flags, version OPENSSL_0.9.8 not defined in file libcrypto.so.0.9.8 with link time reference.

It opens the splash screen, then the main screen and the startup tip window, which is blank, then it crashes.

I fixed it by renaming /opt/google-earth/libcrypto.so.0.9.8 to /opt/google-earth/libcrypto.so.0.9.8.bak. This forces google-earth to use systems libcrypto.

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.

Dec 26 2008

Quick way to discover who your computer is talking to

If you have Linux, here is a quick way to determine what programs are listening for incoming network connections as well as who your computer is currently connected to.

sudo netstat -plateu
Nov 19 2008

Where’s my /dev/fd0 ?

I just tried to mount a floppy disk on a new Ubuntu Hardy 8.10 installation and found that there was no /dev/fd0 device. The fix was to add the following line to /etc/modules:

floppy

Then reboot. (or type: sudo modprobe floppy)

Nov 10 2008

HOWTO: Get USB working with Virtualbox 2.0 in Ubuntu 8.10

1. Install VirtualBox-2.0

Add repository to /etc/apt/sources.list and install Virtualbox-2.0

echo "deb http://download.virtualbox.org/virtualbox/debian intrepid non-free" | sudo tee -a /etc/apt/sources.list
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O- | sudo apt-key add -
sudo apt-get update && sudo apt-get install virtualbox-2.0

2. Configure Ubuntu for VirtualBox-2.0

Add yourself to the vboxusers group

sudo gpasswd -a `whoami` vboxusers

Startup vboxdrv module on boot by appending it to /etc/modules

echo "vboxdrv" | sudo tee -a /etc/modules

3. Usb Filesystem fix

Get the vboxusers group id

cat /etc/group | grep vboxusers

vboxusers:x:128:spirit

Edit /etc/fstab to add these two lines and replace the devgid with the vboxusers group id

#usbfs for virtualbox
none /proc/bus/usb usbfs devgid=128,devmode=664 0 0

4. Kernel usbcore fix

check your current kernel version

uname -r

2.6.27-7-generic

Get the sources for your kernel and fix usb/core/devio.c

sudo apt-get build-dep linux-source-2.6.27
sudo apt-get install linux-source-2.6.27 build-essential
tar -jxvf /usr/src/linux-source-2.6.27.tar.bz2
cd linux-source-2.6.27/drivers/usb/core
perl -pi.bak -e 's/16384/131072/' devio.c
make -C /lib/modules/`uname -r`/build/ M=`pwd` modules
strip --strip-debug usbcore.ko
sudo install -m644 -b usbcore.ko /lib/modules/`uname -r`/kernel/drivers/usb/core
sudo depmod -ae
sudo update-initramfs -u

Reboot your system and check if vboxdrv is running

lsmod | grep vbox

vboxdrv 72472 0

The VirtualBox manager can be found under Applications/System Tools. You should see the USB options in the settings. You can add the devices you want.

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 06 2008

Ubuntu 8.10 Beta released

The Ubuntu team is pleased to announce the beta release of Ubuntu 8.10 Desktop and Server. Codenamed “Intrepid Ibex”, 8.10 continues Ubuntu’s proud tradition of integrating the latest and greatest open source technologies into a high-quality, easy-to-use Linux distribution.

The final version of Ubuntu 8.10 is expected to be released in October 2008.

Read more »

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 02 2008

HOWTO: Get Rhapsody plugin to work with Ubuntu and Firefox

The Rhapsody.com plugin for firefox kept bombing out during the install. It appears that the installer file does not work with firefox 3. Here’s how I got it to work:

In a terminal type:

wget http://forms.real.com/real/player/download.html?f=unix/rhapx/RhapsodyPlayerEngine_Inst_Linux.xpi
unzip RhapsodyPlayerEngine_Inst_Linux.xpi
sudo mv nprhapengine.so /usr/lib/firefox-addons/plugins
# This next line removes the .xpi file and other files that were extracted that we do not need.
rm -rf install.js META-INF RhapsodyPlayerEngine_Inst_Linux.xpi

Now restart firefox and it should work.

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 30 2008

My Ubuntu

Here are the packages from Ubuntu’s repositories that I like to install on my Ubuntu box:


Intrepid Ibex

sudo apt-get install amarok audacity beagle beagle-backend-evolution build-essential compizconfig-settings-manager cream exiv2 fdupes festival festvox-kallpc16k gnome-commander gnome-ppp gnucash gparted grsync hplip-gui imagemagick jpilot jpilot-plugins k3b lame libimage-exiftool-perl libk3b2-extracodecs libmp3lame0 libsox-fmt-all libvcdinfo0 libxine1-ffmpeg lm-sensors mail-notification mailutils msttcorefonts nautilus-actions nautilus-gksu nautilus-open-terminal ntfsprogs openssh-server pdfedit sensors-applet secpanel smbfs sox sshmenu-gnome ssmtp thunderbird thunderbird-beagle thunderbird-gnome-support ubuntu-restricted-extras vlc wine wipe

acidrip emerald libvlc0 mozilla-plugin-gnash pitivi seahorse


Hardy

sudo apt-get install acidrip amarok audacity beagle beagle-backend-evolution build-essential compizconfig-settings-manager cream emerald exiv2 fdupes festival festvox-kallpc16k gnome-commander gnome-ppp gnucash gparted grsync hplip-gui imagemagick jpilot jpilot-plugins k3b lame libimage-exiftool-perl libk3b2-extracodecs liblame0 libsox-fmt-all libvcdinfo0 libvlc0 lm-sensors mail-notification mailutils mozilla-plugin-gnash msttcorefonts nautilus-actions nautilus-gksu nautilus-open-terminal ntfsprogs openssh-server pdfedit pitivi seahorse sensors-applet secpanel smbfs sox sshmenu-gnome ssmtp thunderbird thunderbird-gnome-support ubuntu-restricted-extras vlc wine wipe

Here are the programs that I install or build from source on my Ubuntu box:

http://earth.google.com/
http://picasa.google.com/linux/
http://www.virtualbox.org/wiki/Downloads
http://www.aczoom.com/tools/cdinsert/#download
   then build http://sourceforge.net/projects/gtkcdlabel/
http://kornelix.squarespace.com/fotox/

Here are the applets that I enable or add to my gnome panel on my Ubuntu box:

Applications/Accessories/Terminal
Applications/Internet/Pidgin
Applications/Internet/Thunderbird
Applications/Office/GnuCash
Applications/Office/Jpilot
Applications/Office/OpenOffice.org Word Processor
Applications/Sound &amp; Video/Amarok
Custom Launcher: secpanel
Hardware Sensors Applet
System Monitor Applet
Weather Applet
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 18 2008

HOWTO: USB Ubuntu 8.04.1 Persistent install from Linux

This tutorial enables you to install, boot and run Ubuntu 8.04.1 (Hardy) from a USB flash drive.
USB Ubuntu 8.04.1 Persistent install from Linux

Read more »

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
Aug 14 2008

PNY NVIDIA GeForce 8500 GT

I just picked up a PNY NVIDIA GeForce 8500 GT PCI Express x16 video card for $60 at buy.com. It has 512 MB of memory, a DVI port, and a VGA port and allows you to run two monitors under Ubuntu 8.04 just fine.

You can either download the restricted nvidia driver from the Ubuntu repositories, or manually download the latest driver from Nvidia’s web site.

You can set it up so that both monitors act as one large desktop, or each monitor as its own X-Server screen by running nvidia-settings.

Aug 05 2008

HOWTO: Enable Compiz Fusion with the VIA Chrome9 HC IGP chipset on Ubuntu (Hardy)

I needed to buy a new motherboard on the cheap side the other day. The board that I got has a VIA chipset on board. (Biostar P4M900-M7 SE Motherboard - v7.0) I was hoping to get 3D graphics going on my Ubuntu Linux box without having to buy a new PCIe video card. I finally got it all going. Here’s how:

The first step was to get the latest VIA driver for Ubuntu. Get the driver here.

You will need to extract the files from the tar file. Then run the installation script ./vinstall. Reboot and you should be running on the new via driver.

I could now run glxinfo and had Direct Rendering enabled. glxgears worked fine. However, I still could not enable the Desktop Effects under System/Preferences/Appearance/Visual Effects.

I came accros this script that runs various compiz checks.

Compiz-Check is a script to test if Compiz is able to run on your system/setup and if not, it will tell you the reason why.

Forlong’s Blog - Compiz-Check.

The script indicated the VIA driver was blacklisted. It offered to remove it from the blacklist which I did. Now all of the desktop effects work. Thank you Compiz-Check!

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.

Jul 21 2008

HOWTO: Enable DHCP and NAT routing on Ubuntu (Hardy) Linux

I had a need to turn my Ubuntu desktop into a NAT router and provide DHCP addresses to my local LAN. The local LAN is on the eth0 interface, and the Internet is on the wlan0 wireless interface.

Here’s how I did it …
Read more »

Jul 17 2008

J-Pilot 1.6.0 released

J-Pilot is a desktop organizer application for PalmOS devices

J-Pilot version 1.6.0 released.
The major improvements are Contacts, and Memos support.
As usual, many many bug fixes and improvements, see the ChangeLog for details.

2008-07-17 update:
This version has a bug that prevents the –enable-alarm-shell-danger configuration flag from working. To workaround the problem try the following steps:

1 run ./configure with whatever options you normally include
2 edit the generated file "config.h"
> Search for ENABLE_ALARM_SHELL_DANGER
> Change the commented line to read '#define ENABLE_ALARM_SHELL_DANGER 1'
> Save and close the file
3 run make normally
Jul 04 2008

HOWTO: Install a TFTP server on Ubuntu Linux

=> Default tftp port : 69
=> Default configuration file : /etc/inetd.conf

How do I set up the tftpd daemon to accept connections from another computer?

The configuration of the vsftpd FTP service (read as daemon ) simply requires three steps.

Step # 1: Install tftpd
Type apt-get command to install tftpd

$ sudo apt-get install tftpd

Step # 2: Create the directory tftpd will use to share files
The default directory is /srv/tftp. This directory does not exist so you need to create it.

$ sudo mkdir -p /srv/tftp

Step # 3: Restart tftpd
To restart tftpd type the command :

$ sudo update-inetd --enable tftpd
Jul 04 2008

HOWTO: Install a FTP server (vsftpd) on Ubuntu Linux

I recommend using vsftpd. It is simple and quite secure FTP server. According to vsftpd man page:

vsftpd is the Very Secure File Transfer Protocol Daemon. The server can be launched via a super-server such as inetd or xinetd. Alternatively, vsftpd can be launched in standalone mode, in which case vsftpd itself will listen on the network.

=> Default ftp port : 21
=> Default configuration file : /etc/vsftpd.conf

How do I set up the vsftpd daemon to accept connections from another computer?

The configuration of the vsftpd FTP service (read as daemon ) simply requires three steps.

Step # 1: Install vsftpd
Type apt-get command to install vsftpd

$ sudo apt-get install vsftpd

Step # 2: Configure /etc/vsftpd.conf
The default vsftpd configuration file is /etc/vsftpd.conf. You need to edit this file using text editor such as vi:

$ sudo vi /etc/vsftpd.conf

Add the following line (uncomment line) to the vsftpd configuration file:

local_enable=YES

Above config directive will allow local users to log in via ftp

If you would like to allow users to upload file, add the following to the file:

write_enable=YES

For security you may restrict local users to their home directories. Add the following to the file:

chroot_local_user=YES

Save and close the file.

Step # 3: Restart vsftpd
To restart vsftpd type the command :

$ sudo /etc/init.d/vsftpd restart
Jul 04 2008

sshmenu-gnome

Here is a great little gnome panel applet for organizing all your ssh sessions.
Ubuntu — Details of package sshmenu-gnome in hardy

sshmenu-gnome puts all your most frequently used SSH connections on a menu in your GNOME panel. Click on a host name to open a new gnome-terminal window with an ssh connection to the selected host. Set up options for port forwarding, etc. using the preferences dialog.

Here is a nice site that will give you an overview of sshmenu.

Jun 25 2008

Creating chroot sftp Jails with Jailkit | Linux Journal

Here’s a great article on how to create Linux jails.

Creating chroot sftp Jails with Jailkit | Linux Journal

A few months back I was given an assignment to create some chroot jails for a group of customers so that they could securely upload files with sftp. The requirement was that the customers needed to be able to upload file, but in a secure and private way. Customer One should not be able to see Customer Two’s files, for example. And neither customer should be able to browse the filesystem of the server.

Read more »

Jun 24 2008

Elastix - The reliable PBX appliance software

I just discovered Elastix, It is an ISO image that installs CentOS, Asterisk, FreePBX, and other goodies to create an instant PBX. Compare it to PBX In A Flash and Trixbox.

Jun 10 2008

HOWTO: Configure Sendmail as a backup mail server

Setting up a backup mail server is very easy. It’s also very important since you do not want to be without mail if your primary mail server goes down. To setup a backup mail server, first setup the MX record for the domain in question so that the backup mail server handles mail second (or third…) for the domain. Once your MX record is in place, you need to configure the backup server.

The first step is to make sure that the host name referenced in the MX record is listed as a local host name, either using the Cw option or the /etc/mail/local-host-names file. As an example, if I setup the MX record so that my backup mail server is mail2.domain.com, I should have Cwmail2.domain.com in my sendmail.mc file or have mail2.domain.com listed in my /etc/mail/local-host-names file. If it is not listed, Sendmail may get confused and bounce mail with the message:

553 MX problem? mail loops back to me

You’ll only see this message when your main mail server goes down. This happens presumably because Sendmail tries to relay mail to the backup mail server as listed in the MX record if it cannot reach the primary mail server. Since the MX record points to a host that is not recognized by Sendmail as a local host, it will keep trying to send the mail to the backup server. As it tries, it finds that the address points to itself, which it believes is not right, creating a loop. By letting Sendmail know that this is indeed another alias for this machine, it will handle the mail properly, queuing it for later delivery to the primary mail server.

It is important that you do not include the top level domain for which you are the backup server in the local-host-names file. Otherwise, your mail server will treat that domain as being local and will try to accept mail (as opposed to relay mail) for that domain. For example, if you include domain.com in your local-host-names file (in addition to mail2.domain.com), your mail server will think that IT is the primary mail server for domain.com and try to deliver messages locally.

The next step is to include domains for which you will be a backup server in the /etc/mail/access file and allow relaying for those domains. Continuing with the example above, your access file might have the following lines:

domain.com RELAY
domain2.com RELAY

On my viaVerio server I run these commands after modifying the config files:

cd /etc/mail
make && make install && restart_sendmail
Jun 04 2008

BUG: Ubuntu Hardy fails to boot after kernel upgrade

Here is the bug report
Bug #236021 in initramfs-tools Ubuntu: “There is no vfat module in the 2.6.24-17 initrd”

If you installed Ubuntu on a Windows computer using the Wubi install (Ubuntu is installed as a Windows application) and updated to the -17 or -18 kernel, you’ll find that you are dropped to an initramfs prompt after rebooting. Here’s how to fix it until initramfs is updated:

Reboot, select Ubuntu and press the ESC key.
Select the -16 kernel and boot.
Open a terminal window and edit line 210 of the /usr/share/initramfs-tools/hook-functions file.

sudo vim /usr/share/initramfs-tools/hook-functions

Change line 210 from:

virtio_pci; do

to:

virtio_pci vfat nls_cp437 nls_iso8859-1; do

Then rebuild initramfs like this:

sudo update-initramfs -u

Reboot and you should be running the new kernel without problems.

Jun 04 2008

Microsoft Free - One year later

Microsoft Free - One year later

All I can say is that for the last year, I have been using Open Source exclusively and I am loving it

May 31 2008

Ubuntu How-To

Here is a good site to get you started with Ubuntu 8.04 (Hardy).
Ubuntu How-To

Ubuntu 8.04 Hardy Heron How-To

May 28 2008

Wizard Boot Camp, Part Six: Daemons & Subshells | Linux Magazine

Wizard Boot Camp, Part Six: Daemons & Subshells | Linux Magazine

Let’s continue our discussion of Linux processes with a look at two unrelated concepts that are both good to understand. First we’ll write a simple daemon process and send signals to it. Then we’ll see how to suspend a child shell — which gives some insight into how shells cope with signals sent to them.

May 28 2008

Sweeten your Vim with Cream

Sweeten your Vim with Cream | Linux Magazine

There has to be some way to ease users into Vim, some way to leverage the power of Vim while accommodating, or even overcoming, the steep learning curve. Fortunately, there is a solution: Cream.

Apr 30 2008

HOWTO: Enable Acer 3624WXMi Wireless LAN card in Ubuntu

Updated for Ubuntu Hardy 8.04

This one is really simple once you know what to do. I installed the beta copy of Ubuntu 8.04 (Hardy) on my Acer 3624 laptop which has a builtin wireless lan adapter. The wireless lan would not work. Looking through /var/log/syslog showed that the firmware was not loading. I did a little research and found that the bcm code for the wireless chipset can not be redistributed on the Ubuntu CD which is why it does not work out of the box. However, if you run the following command from the terminal it will download the code for you.

sudo apt-get install b43-fwcutter

Reboot the laptop. Now when you click on the network icon (next to the clock) you should see a list of available wifi access points. You should also see that the amber wifi light is illuminated on the front of your laptop.

Apr 27 2008

Hands on with Ubuntu 8.04

Desktop Linux for the masses. Who needs Windows anymore?
Hands on with Ubuntu 8.04 :: Linux Format :: The website of the UKs best-selling Linux magazine

Yes, the Hardy Heron is here This is the new Long Term Support LTS release of Ubuntu, and is possibly the most eagerly anticipated distro of all time. Read on for our hands-on look at the new features, with screenshots galore…

Apr 14 2008

Wizard Boot Camp, Part Five: Control Processes Using Signals | Linux Magazine

Here is a good article on processes and signals on a Unix/Linux system. This also shows why sending a ‘kill -9′ to terminate a normal process is a bad idea. It doesn’t give the process a chance to clean up after itself.

Wizard Boot Camp, Part Five: Control Processes Using Signals | Linux Magazine

This month we’ll dig into process control: signals sent to processes and how a shell handles processes, including some details on job control.

Apr 03 2008

The Linux Game Tome

Do you like to play games on your computer? Linux has a never ending supply. Check out this site.
The Linux Game Tome

Apr 01 2008

Apple’s “Time Machine” Now For Linux… Sort Of

There are two candidates for this; FlyBack and TimeVault. Check them out:

flyback - Google Code

Apple’s Time Machine is a great feature in their OS, and Linux has almost all of the required technology already built in to recreate it. This is a simple GUI to make it easy to use.

Website: http://flyback-project.org/

TimeVault - Ubuntu Wiki

TimeVault is a simple front-end for making snapshots of a set of directories. Snapshots are a copy of a directory structure or file at a certain point in time. Restore functionality is integrated into Nautilus - previous versions of a file or directory that has a snapshot can be accessed by examining the properties and selecting the ‘Previous Versions’ tab.

Snapshots are protected from accidental deletion or modification since they are read-only by default. The super-user can delete intermediate snapshots to save space, but files and directories that existed before or after the deletion will still be accessible.

Website: https://launchpad.net/timevault

Apr 01 2008

Tweaking Hidden Ubuntu Settings With Ubuntu Tweak

Tweaking Hidden Ubuntu Settings With Ubuntu Tweak | HowtoForge - Linux Howtos and Tutorials

Ubuntu Tweak is a tool that lets you change hidden Ubuntu settings, for example: hide or change the splash screen, show or hide the Computer, Home, Trash, and Network icons, change Metacity, Nautilus, power management, and security settings, etc. Currently Ubuntu Tweak is available only for the Ubuntu GNOME desktop, i.e., it will not work on Kubuntu or Xubuntu. This short guide shows how to install and use Ubuntu Tweak.

Mar 27 2008

HOWTO: Install Garmin Maps on Ubuntu Gutsy Linux

A good source for free maps for your Garmin GPS can be found at http://mapcenter2.cgpsmapper.com/ Download anyone of the pre-compiled binary maps. These maps will have an .img extension.

Your Gutsy box should automatically see your Garmin when you connect it via a USB cable. A new USB drive will appear on your desktop. Open it. You should see a ‘Garmin” directory.

Rename your downloaded map file to GMAPSUPP.IMG and copy to your Garmin directory.

Unmount your Garmin and power it back on. Once loaded go to the settings tab on the Nuvi and choose Map and then MAP INFO.
Read more »

Mar 19 2008

HOWTO: Mount smbfs/cifs Shares Permanently on Linux

NOTE: Please be aware that smbfs is deprecated in favor of cifs. CIFS Extensions for UNIX is a small set of additions to the SMB protocol which allows the transfer of UNIX style metadata. The specification can be found here. Existing smbfs mounts can easily be converted by changing ’smbfs’ to ‘cifs’ in your /etc/fstab file..

This document provides help on mounting smbfs shares permanently. These can be shares on a Windows computer or on a Linux/UNIX server running Samba.
Read more »

Mar 04 2008

HOWTO: Setup Hamachi VPN on Ubuntu - Updated for GUTSY

This is a How-To for setting up a Hamachi virtual private network on Ubuntu 7.10 (Gutsy).

Hamachi is a zero-config VPN client for Windows and Linux (currently Beta for Mac). It allows you to, very easily, create a virtual private network that can be logged into and accessed for all over the net. It does this by creating IP tunnels to each VPN client, making them directly accessable to all the other clients on the VPN. Hamachi also encrypts the connections it creates to allow for secure access.

Read more »

Feb 06 2008

HOWTO: Play Encrypted (Copyrighted) DVDs in Ubuntu Gutsy

I rented a Disney DVD the other day, popped it into my Linux box to watch it, but could not get the DVD to play. I had previously installed all of the restricted drivers which allowed other DVDs to play, but this one just would not play in anything. Here is a quick HOWTO to get your box to play just about any DVD.

This will add the Medibuntu repository to your repository lists
In a terminal type:

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

Then you have to add the GPG Key to authentic the packages
In a terminal type:

wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -

Now update your system to load the Medibuntu repository into your apt-get sources

sudo apt-get update

Download the DVDs playback packages
In a terminal type:

sudo apt-get install libdvdcss2 libdvdread3

Enjoy!

Jan 04 2008

fotox - Enhance your digital camera photos

I’ve been looking high and low for a good Linux photo program that can stitch together photos to make a panorama image. On the Windows side I had Photostitch which came with my Canon camera. It was quick and easy to use. Now we have Fotox on the Linux side which is even easier to use. I download the source code and typed ‘build’ to make it. Done. Not only does it create panoramas but you can also do many other edits to your photos. Look at the list below.

fotox - kornelix

Fotox is a free open-source Linux program for improving image files made with a digital camera.

The following functions are provided:

* Show thumbnails of image files in a directory, navigate, choose files to view or edit.
* Adjust overexposed or underexposed areas to improve visibility of detail
(change brightness independently for different brightness levels).
* Reduce fog or haze by removing “whiteness” and intensifying colors.
* High dynamic range (HDR) photography: combine an underexposed and overexposed image to improve details visible in both bright and dark areas. Automatic image alignment.
* Photo stitching or panorama: stitch two or more images together to make an ultra-wide image.
Simple image alignment and brightness / color matching.
* Crop an image (choose the area of interest and cut-off the margins).
* Rotate an image by any angle (level a tilted image, or turn in 90 degree steps).
* Resize an image, with convenience buttons for 2/3, 1/2, 1/3 and 1/4 size.
* Red-eye removal.

Dec 06 2007

HOWTO: Create a Linux RAM disk in Ubuntu

Remember the old days of RAM disks? Well. Linux has them too! If you’ve never tried them, a RAM disk is a virtual file system that runs entirely from your PC’s main memory, which means it’s lightning fast to read and write anything you want. How much space you choose to allocate to your RAM disk is down to how much RAM you have and how much you plan to use it - if you have 1GB of RAM, you can easily spare 64MB for a ramdisk; if you have 2GB you can probably spare 256MB, and if your are fortunate enough to have 4GB then you can easily stretch your RAM disk legs with 1GB. Here’s how to setup a 64MB disk - just change the 65536 for the size you want:

sudo mkfs -t ext3 -q /dev/ram1 65536
sudo mkdir -p /ramdisk
sudo mount /dev/ram1 /ramdisk -o defaults,rw

Remember: If your PC gets switched off accidentally it all gets wiped!

Dec 06 2007

HOWTO: Stop disk thrashing in Linux

If you want your disks to run at their full potential, make sure and enable the noatime option in /etc/fstab.

Every time your disk does a read (eg reading a file), it also does a write, to store the information pertaining to when the file was last read. This process is incredibly slow, and you can get a sizable speed boost - usually around 10 percent - with just one simple tweak.

Switch to root, then open up /etc/fstab in your favorite text editor. Look for where your root file system is, and make sure that it uses defaults,noatime for its settings, then save, reboot and let your poor overworked PC perform to its full potential.

Dec 06 2007

HOWTO: Add more functions to Nautilus

Nautilus (file manager in Ubuntu linux) has a surprising amount of power with its extensions, but none are installed by default leaving it looking somewhat bare. That’s easily fixed, though, particularly if you’re using Ubuntu - just apt-get the nautilus-gksu and nautilus-open-terminal extensions, restart Nautilus, enjoy the upgrade.

sudo apt-get install nautilus-gksu nautilus-open-terminal

This will give you a right click option to open a terminal, and if you right click on a file there is an option to open it as an administrator.

Dec 05 2007

APT: Advanced User Tricks

APT is a front end for the Debian and Ubuntu package manager. If you have used debian for any length of time you probably have run the command ‘apt-get install somepackage’ to install some package. If that is all you have used apt for then look at this list for some of the other things you can do with apt.
Read more »

Dec 04 2007

CD/DVD Inserts and Envelopes

Here is a great little program to create CD/DVD inserts for jewel cases and to create CD/DVD envelopes. You will need to compile it from source code but it works great. There is also an online version of cdlabelgen here.

gtkcdlabel

gtkcdlabel is a GUI frontend to cdlabelgen which is a program that can generate a variety of CD tray covers. The code is based on gcombust and gcdlabelgen.

Nov 29 2007

HOWTO: Get a D-Link DWL-G122 D1 USB WiFi Adapter to work on Linux (Ubuntu Gutsy 7.10)

First, you need to install ndiswrapper.

sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9

Locate the USB55N5x.inf and USB55N51.sys files on the D-Link CDROM and change to that directory on the CD. If you don’t have the CD, you can download the drives from here. Install the Windows driver with

sudo ndiswrapper -i USB55N5x.inf

Your version numbers may be different from mine. Adjust the above command accordingly.

This installs the .inf file and required .sys files. Now see if the installation of the Windows driver is “valid” with

ndiswrapper -l

This should report

"driver present, hardware present"

if the driver is installed and if the USB WiFi device is plugged in. If the device is not plugged in then it should report

"driver present"

Now load the ndiswrapper module with

sudo modprobe ndiswrapper

If everything worked properly, this should initialize the ‘wlan0′ wireless device, which can be configured with System/Administration/Networking or with wireless tools, such as ‘iwconfig’, ‘wpa_supplicant’ etc. Gutsy has a nice wifi interface that appears on your Gnome panel where you can select which network to connect to.

If you prefer a different GUI wireless manager then install one or all of these tools like this:

sudo apt-get install wlassistant
sudo apt-get install wifi-radar

wlassistant is a KDE application.

To get Ubuntu to load this driver every time you boot the computer, you need to add this line to /etc/modules:

ndiswrapper
Nov 26 2007

iSCSI for Linux

I’ve been playing a bit with iSCSI. Here is a site for Alpine Linux that I found useful. Although the site is dedicated to Alpine, I applied the principles to an Ubuntu box and got it working.

ISCSI Target and Initiator Configuration - Alpine Linux

Nov 26 2007

HOWTO: Mirror the Ubuntu repository via apt-cacher

At work we use the apt-cacher program to cache our access to the Ubuntu repositories. However, if you have a laptop with some free space, it comes in handy to have the repository locally for when you’re not connected to the net. Here is a debmirror command to create a local mirror of the gutsy repository to /media/disk/gutsy/

(If you have any errors, you may need to update your libcompress-zlib-perl package. One of the versions made for gutsy broke this package for use with debmirror.)

In the command below, ubuntu-apt resolves to the IP address of the machine running my apt-cacher program. 3142 is the port that apt-cacher is listening on. Gutsy is the version being mirrored.

debmirror --nosource -m --passive --host=us.archive.ubuntu.com --root=ubuntu/ --method=http --dist=gutsy,gutsy-security,gutsy-updates --section=main,restricted,universe,multiverse --arch=i386,amd64 /media/disk/gutsy/ --proxy=http://ubuntu-apt:3142/ --ignore-release-gpg --ignore-small-errors