Wednesday, 18 June 2008

X Error: BadDevice, invalid or uninitialized input device 168

Original source

Seems a lot of users are getting the below errors when running applications from the console:

Code:

X Error: BadDevice, invalid or uninitialized input device 168
Major opcode: 148
Minor opcode: 3
Resource id: 0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 168
Major opcode: 148
Minor opcode: 3
Resource id: 0x0
Failed to open device


To fix this, look for the lines posted below, or similar to, and comment them out of your /etc/X11/xorg.conf file:

Code:

# Section "InputDevice"
# Driver "wacom"
# Identifier "stylus"
# Option "Device" "/dev/wacom" # Change to
# # /dev/input/event
# # for USB
# Option "Type" "stylus"
# Option "ForceDevice" "ISDV4" # Tablet PC ONLY
#EndSection

#Section "InputDevice"
# Driver "wacom"
# Identifier "eraser"
# Option "Device" "/dev/wacom" # Change to
# # /dev/input/event
# # for USB
# Option "Type" "eraser"
# Option "ForceDevice" "ISDV4" # Tablet PC ONLY
#EndSection

#Section "InputDevice"
# Driver "wacom"
# Identifier "cursor"
# Option "Device" "/dev/wacom" # Change to
# # /dev/input/event
# # for USB
# Option "Type" "cursor"
# Option "ForceDevice" "ISDV4" # Tablet PC ONLY
#EndSection


Then also a bit further down in the file you need to look for the below lines, or ones similar to these:

Code:

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
# InputDevice "stylus" "SendCoreEvents"
# InputDevice "cursor" "SendCoreEvents"
# InputDevice "eraser" "SendCoreEvents"
EndSection


**WARNING** If you fail to comment the lines below that are commented out, then X will *NOT* start when you go to restart the X server.

Once you comment those things out then a restart of X is needed. Once X is back up and running again you shouldn't see those errors anymore.

Wednesday, 11 June 2008

NFS installation Guide

A very good and detailed guide is https://help.ubuntu.com/community/SettingUpNFSHowTo

You can set up NFS following the guidance from the link above.

To simplify it, here is the steps:

1. Install NFS using apt-get or Synaptic Package Manager;

2. Add the IP and name of hosts into /etc/hosts;

3. Add the following line to /etc/hosts.deny:
portmap mountd nfsd statd lockd rquotad : ALL

4. Add the following line to /etc/hosts.allow:
portmap mountd nfsd statd lockd rquotad : list of IP addresses

5. Edit /etc/exports and add the shares:
/home 192.168.0.10(rw,sync,no_subtree_check) 192.168.0.11(rw,sync,no_subtree_check)
/usr/local 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)

The above shares /home and /usr/local to two clients with fixed ip addresses. Best used only with machines that have static ip addresses.

6. After setting up /etc/exports, export the shares:
sudo exportfs -ra

7. Restart Services
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-kernel-server restart


8. At NFS client, install portmap and nfs-common;

9. Add the following line to /etc/hosts.deny:
portmap : ALL

10. Add the following line to /etc/hosts.allow:
portmap : NFS server IP address

11. Mount the shared folder by:
sudo mount ServerIP:/folder/already/setup/to/be/shared /home/username/folder/in/your/local/computer

12. In /etc/fstab, add lines for shares such as:
servername:dir /mntpoint nfs rw,hard,intr 0 0

FreeNX

This is a remote desktop for Linux. There is a commercial version from www.nomachine.com and if you like a free version FreeNX is the choice.

Add following lines into /etc/apt/source.list

deb http://mirror.ubuntulinux.nl feisty-seveas freenx
deb-src http://mirror.ubuntulinux.nl feisty-seveas freenx

Add a link to solve the NX colour missing problem,

sudo ln -s /etc/X11/rgb.txt /usr/X11R6/lib/X11/

the nxagent application provided with FreeNX package searches for rgb.txt in an another location.
For more information about FreeNX, please refer to http://wiki.debian.org/freenx

Monday, 9 June 2008

Crontab Fails To Run Shell Script

The shell script runs fine under command window. When it is added into the crontab, it won't run at all.

The problem is that some environment variables won't be recognized in crontab file. To solve this, you can add the full path or add the environment variables into the script directly.

Wednesday, 4 June 2008

Error starting the GNOME Settings Daemon Using NX

Error message turns up when log into Ubuntu using nxclient.

"There was an error starting the GNOME Settings Daemon.

Some things, such as themes, sounds, or background settings may not work correctly.

The last error message was:

Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

GNOME will still try to restart the Settings Daemon next time you log in."

To fix this, at least temporarily, tick the box 'Enable multimedia support' in nxclient configuration.

Reboot Sun Workstation

In work, I have a few old Sun workstations. Some of them have poor HDD.

Sometimes they fail to boot up. Usually the booting stage won't be able to finish, so the screen stops at the middle of booting.

To fix this,

If you have a Sun keyboard, you can press 'Stop' + 'A'.

Then 'ok?' prompt will come up.

Type 'boot -s', so you can boot the system as single user.

Login as root and type 'fsck -y' to check and correct error on the HDD.

If this cannot fix the problem, probably you need to replace the hard drive.