Replacing Panasonic Toughbook CF-W4 keyboard

Photo on 2-23-13 at 10.03 PM

Disclaimer: I will be not responsible for any damage caused by following the instruction in this blog entry. You are your own.

As World Computer Exchange’s work, I had an opportunity to repair Toughbook W4’s keyboard. I eBayed a replacement.

This is how the keyboard was bad. “R” key top was coming off, and “F” was sticky. I suspect the laptop did a face plant, damaing “R” and “F” key.

As any repair, remove the laptop from power source. Unplug power adapter and battery. Then, let the fun begin. Actually, you have to remove the battery in order to remove the keyboard.

001-removalHere is the things you want to remove. A clip and 4 screws are holding down half the keyboard.

As you can see, the clip is in the battery bay. 4 screws are Phillips #00. Be sure to use a good one, since you really don’t want to damage. Now, going to the front. These two front screws in blue — NO NEED TO REMOVE, but you could. It might make shifting the keyboard at the end a little bit easier, but not by much. (Well, I removed them since I did not know better.)


At this point, the keyboard is held down by double-sided tape in 3 locations and two craws on the right side of keyboard.

So, you need to be brave to ply off the double sided tapes. It does not require a lot of force but it is rather held down pretty well. Please be carefully forceful to ply off the keyboard from the top cover.toughbook-w4-ply-off You can use a small flat head screw driver sticking into the top right side. Behind it, there is a thin strip of double side tape, about 2-3 mm x 100 mm.

There are also small piece of double side tapes under “P” key and “down arrow” key.

After plying off the upper side double site tape, you kind of need to shift the whole key toward “ESC” key, because there are two clips holding down the keyboard at the right side of toughbook-w4-clipskeyboard. After removing the keyboard, you can clearly see these two as in the picture here. So you need to slide the whole keyboard just a little to the left. It’s very difficult to do when the tapes are holding down. So, all 3 locations of tape needs to kind of come off. However, if you have no intention of saving the keyboard, you’d rather pull the keyboard in the very middle to save the clips here.

Now, the keyboard should come off. Very careful. The ribbon cable is hooked up, and you want to not break the connector.

toughbook-w4-keyboard-off toughbook-w4-connectortoughbook-w4-disengage

The keyboard connector is behind the thin metal thing that has 2 joints. You can gently move it up. When you peek in, you can see the center notch in the keyboard connector. The whole upper side slides out about 2mm or so. With a small flat head screwdriver, using the notch, you can push it out. Once it moves out a little, you can use the flat head to move them. Once the connector becomes disengaged like the picture on the above right, the cable should come out with any resistance. You are now half way home.


Obviously, I don’t have the same double side tape to replace, so I used a double-sided scrapbooking tape. I assume it is less acidic and pretty sticky, and thin. I put it on a scrap plexiglass so that I can cut precisely to the original shape. If you have a real glass, it would make things even easier. You cut it the shape with a knife. I decided to put the 3 pieces to the laptop side, not keyboard side.

Only thing left is to reverse the steps. You slide in the ribbon cable to the connector, and close the connector. You don’t need a lot of force but firm. Pushing it in the finger is just fine. No need for the screw driver.

Put in the keyboard from “ESC” side in the air, slide just a little so that the two clips on the right side catches the keyboard. Also, the bottom sides have a couple of tabs that catches the case. Take time and be patient. The left top side is all secured by the clip and 4 screws. So, use the flexibility of keyboard and push it toward right bottom, while making sure the space bar side’s tab goes in.

Once everything is in place, you press down the keyboard so that the double side tapes sticks, and then the 4 screws and the clip.

Now, you are done! Good luck.

It took me less than an hour. I first thought the right side has something mechanical thing holding down, but it turns out they are all tapes.  When you know the damaged one is going to be thrown away, you can be a little brave.

— Tai


When Linux Mint AMD Catalyst Control Center (Administrative) is not starting

That means, “/usr/bin/amdxdg-su” is not detecting the desktop environment correctly.

You can fix it by hacking the /usr/bin/amdxdg-su, like follows:
Open up the “/usr/bin/amdxdg-su” in your text editor of choice.

    if   [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
    elif [ -x /usr/bin/gksu ]; then DE=gnome;
    elif [ -x /usr/bin/kdesu ]; then DE=kde;
    elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' > /dev/null 2>&1 ; then DE=xfce;

Open up the “/usr/bin/amdxdg-su” in your text editor of choice, look for detectDE() and make it look like one above.
This fixed one for me.

To be honest, detectDE() is lousy. It knows gksu and kdesu commands exist, yet, the way to detect the desktop environment is to check the environ variables which may or may not exist in every version.
Mint’s MDM apparently uses something different for the environment variable. It is probably sufficient to check the gksu or kdesu exists.

Alternatively, you can set KDE_FULL_SESSION=true or GNOME_DESKTOP_SESSION_ID=ANYTHING in $HOME/.xsession.
So the content of $HOME/.xsession would be


This populates the GNOME_DESKTOP_SESSION_ID when XFree86 session starts so that

    elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;

part of detectDE() thinks it’s a Gnome session. This is a hack.


Allowing VNC access from Linux to MacOS X

(Originally posted 2010-05-08)

After googling same topic several times, it’s better to write down. This is how you set a password for the VNC access for MacOS X from “regular” VNC client. By default, the screen sharing does per user authentication and does not let me take over the screen with a master password. This allows me to do so.

/System/Library/CoreServices/RemoteManagement/ -configure -activate -access -on -clientopts -setvnclegacy -vnclegacy yes -setvncpw -vncpw your-VNC-Password -restart -agent

Credit goes to:

Sharing Canon PIXMA 9000ii with CUPS on Linux and print from MacOS X

(This blog was originally published on 2012-12-08.)

I figured out setting up Canon PIXMA Pro 9000ii with CUPS on Linux so that it is shared on the network, chiefly from my Mac.
The end result is not quiet satisfying but at least I can say that I can print something from my Mac to the printer connected on Linux machine.

My old Canon i960 photo printer developed a serious case of printer head clogging after being completely ignored for good 2 years. (UPDATE: The printer has been deconstructed.)
I wish I could report that I was successful unclogging it, but no.
I tried Windex + alcohol, and then an eBay item to unclog. Neither resulted successful.

I went eBay again to look for the printer head, and reconditioned one for $50 from China, and $100 new.
Then I bought a wide format printer PIXMA 9000ii for $150, a great deal, though it will make me cry every time I replace the ink cartridges.

The printer happens to be right next to my DreamPlug email server. (I compiled the kernel myself, and running Debian Wheezy)
So, instead of running a long USB cable to my Mac, I wanted the DreamPlug to be the print server for the new printer.

I googled it, and came out negative. That means, I gotta set it up by self. I tried a few things, and tonight, I was able to print over the network, but the result is not very satisfying.

Here is the steps I did. As usual, I did not record every step so, it’s off top of my head.

I must mention that my DreamPlug is running Debian Squeeze.
I also compiled the kernel while ago, so it’s not the stock kernel.

$ cat /etc/debian_version 

You do

$ sudo aptitude install cups 

Here is what I have now.

$ uname -a
Linux scarabee #3 PREEMPT Sat Oct 29 15:59:34 EDT 2011 armv5tel GNU/Linux
$ dpkg -l | grep -i cups
ii  cups              1.4.4-7+squeeze1     Common UNIX Printing System(™) - server
ii  cups-bsd          1.4.4-7+squeeze1     Common UNIX Printing System(™) - BSD commands
ii  cups-client       1.4.4-7+squeeze1     Common UNIX Printing System(™) - client programs (SysV)
ii  cups-common       1.4.4-7+squeeze1     Common UNIX Printing System(™) - common files
ii  cups-driver-gutenprint           5.2.9-1              transitional dummy package for gutenprint printer driver
ii  cups-ppdc         1.4.4-7+squeeze1     Common UNIX Printing System(™) - PPD manipulation utilities
ii  ghostscript-cups  8.71~dfsg2-9         The GPL Ghostscript PostScript/PDF interpreter - CUPS filters
ii  libcups2          1.4.4-7+squeeze1     Common UNIX Printing System(™) - Core library
ii  libcupscgi1       1.4.4-7+squeeze1     Common UNIX Printing System(™) - CGI library
ii  libcupsdriver1    1.4.4-7+squeeze1     Common UNIX Printing System(™) - Driver library
ii  libcupsimage2     1.4.4-7+squeeze1     Common UNIX Printing System(™) - Raster image library
ii  libcupsmime1      1.4.4-7+squeeze1     Common UNIX Printing System(™) - MIME library
ii  libcupsppdc1      1.4.4-7+squeeze1     Common UNIX Printing System(™) - PPD manipulation library
ii  printer-driver-gutenprint        5.2.9-1              printer drivers for CUPS
ii  python-cups       1.9.48-1             Python bindings for CUPS

When I installed the CUPS with “squeeze”, it did not have the entry for PIXMA Pro 9000 Mark II because it’s based on GutenPrint 5.2.6. After googling, and looking at the CUPS web site, what I need is version 5.2.9 of Gutenprint driver which added the support for this printer albeit it’s not polished.
The package is available in “Wheezy” (aka testing branch.) So, I added the testing to the /etc/apt/sources.list. Here is the contents.

$ cat /etc/apt/sources.list
deb squeeze main contrib non-free
deb squeeze/updates main contrib non-free
deb wheezy main contrib non-free

Then, you do

$ sudo apt-get update
$ sudo aptitude versions cups-driver-gutenprint
i A 5.2.6-1                 stable                  500 
p A 5.2.9-1                 testing                 500 
$ sudo apt-get install cups-driver-gutenprint=5.2.9

That should install the wheezy version of GutenPrint 5.2.9 Once the packages are installed, you can remove the wheezy entry from sources.list, and re-update to not see the wheezy.

Next is to go into the CUPS admin page. This is already set up, and since I’m lazy, I’m not going back and take step-by-step screen shots, but I go though the “modify”.


First you need to add the printer. You should see “USB” printer in next screen. Just follow the conventional “Add Printer”. If you have the 5.2.9 GutenPrint, you should be able to choose the PIXMA Pro9000mk2 driver. Once done, your print queue would look like next one. I picked a very non creative queue name “canon_pixma_9000ii”. You can use any name you want. You need to remember it when you set up the Mac side.


Lastly, you need to do the sharing setup.


Now, you are done on Linux server side.

Time to print a test page!

Sorry for the poor image. I took it with my iPad.


OK. Now, using the printer from Mac. From the System Pref, Printer & Scanner, Add Printer.

You should use the Linux machine name rather than This is just a demonstration.
The queue name is actually not “canon_pixma_9000ii” but “printers/canon_pixma_9000ii”. This “printers/” part took me quite some time to figure out because there is very little info out there.
If it’s not right, you’d get an error message when you press “Add” button. If so, press cancel, go back, and type in the correct name. If it’s right, the dialog should accept it.


I’ve printed a page or two so far. It does print, but there is something wrong with the driver. Most likely the driver is not quite right but better than not being able to print at all. Once the driver matures, it might get better. Cross your fingers.

xorg.conf for SD11G5 / Intel GMA for non laptop

(This is an old blog entry, ported from 2008-10-08. I need this information now.)

When you use the Intel’s GMA for X11, and you don’t have a built-in LCD like laptop, but you want to use VGA output, xorg.conf is a bit tricky.

I had to google for quite some time to find out necessary ingradients to use VGA output for SD11G5. Though xorg.conf is for FreeBSD, Linux machines’ setup should not be much different.

First, I have a 1280×1024 LCD for VGA connection. I could use DVI output but I only have a VGA KVM. When FreeBSD starts, VGA connection does work, but as soon as X server stats with “intel” driver, it switches over to DVI.

The intel driver for X supports 4 output devices (for mine at least). VGA, LVDS, TMDS-1, and TV.  If I don’t do anything, LVDS (laptop’s display) and TMDS-1 gets the output, and VGA is not. Since LVDS does not exist, I have to tell X server to ignore LVDS.  This isn’t quite straightforward.

Forllowing is a working xorg.conf for me.

Section "Files"
    RgbPath     "/usr/X11R6/lib/X11/rgb"
    FontPath    "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath    "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath    "/usr/X11R6/lib/X11/fonts/OTF/"
    FontPath    "/usr/X11R6/lib/X11/fonts/TTF/"
    FontPath    "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath    "/usr/X11R6/lib/X11/fonts/bitstream-vera/"
    FontPath    "/usr/X11R6/lib/X11/fonts/cyrillic/"
    FontPath    "/usr/X11R6/lib/X11/fonts/encodings/"
    FontPath    "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath    "/usr/X11R6/lib/X11/fonts/util/"
    FontPath    "/usr/X11R6/lib/X11/fonts/local/"

Section "Module"
    Load    "dbe"
    Load    "extmod"
    Load    "type1"
    Load    "freetype"

Section "ServerFlags"
    Option    "BlankTime"        "5"
    Option    "StandbyTime"    "10"
    Option    "SuspendTime"    "20"
    Option    "OffTime"        "30"

Section "InputDevice"
     Identifier    "Keyboard1"
     Driver    "keyboard"
     Option    "XkbOptions"    "ctrl:nocaps,altwin:meta_win"
     Option    "XkbModel"    "pc101"
     Option "XkbLayout"     "us"
     Option    "AutoRepeat"    "500 5"

Section "InputDevice"
    Identifier    "Mouse1"
    Driver    "mouse"
    Option    "Device"    "/dev/sysmouse"
    Option    "Protocol"    "Auto"
    Option "ZAxisMapping" "4 5"

Section "Monitor"
    Identifier "SyncMaster191T"
    VendorName "Samsung"
    ModelName  "SyncMaster191T"
#    HorizSync 63.8
#    VertRefresh 60
    Option "dpms"

Section "Monitor"
    Identifier "imaginary_lvds"
    VendorName "lala"
    ModelName  "land"
    Option  "Ignore" "true"

Section "Device"
    Identifier    "intel_gma"
    Driver    "intel"
    BusID    "PCI:0:2:0"
    Screen  0
    Option    "PciRetry"    "on"
    Option    "HWCursor"    "on"
    Option  "Monitor-LVDS"  "imaginary_lvds"
    Option  "Monitor-VGA"   "SyncMaster191T"

Section "Screen"
    Identifier "Screen_Intel_SyncMaster191T"
    Device    "intel_gma"
    Monitor "SyncMaster191T"
    DefaultDepth 24

    Subsection "Display"
        Depth 24
        Modes "1280x1024"

    Subsection "Display"
        Depth 16
        Modes "1280x1024"

Section "ServerLayout"
    Identifier    "Main Layout"
    Screen        0 "Screen_Intel_SyncMaster191T" 0 0
    InputDevice    "Mouse1"    "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"

Section "DRI"
    Mode 0666

First, I created an imaginary laptop display called “imaginary_lvds”. and give an option “ignore” “true” so that the intel driver ignores this monitor when connected.

In the “Device” section for “intel” driver, you need to specify option “Monitor-LVDS” “imaginary_lvds” so that the intel driver knows that there is a LVDS device designated and the monitor device is actually ignored.

(II) intel(0): Output configuration:
(II) intel(0):   Pipe A is on
(II) intel(0):   Display plane A is now enabled and connected to pipe A.
(II) intel(0):   Pipe B is on
(II) intel(0):   Display plane B is now enabled and connected to pipe B.
(II) intel(0):   Output VGA is connected to pipe A
(II) intel(0):   Output TMDS-1 is connected to pipe B
(II) intel(0):   Output TV is connected to pipe none

When successful,the output configuration ignores LVDS and gives VGA and TMDS-1 the output pipe (whatever that is.)  As you can imagine, if you need TV output, you probably need kill VGA or TMDS-1 in the same fashion.