Thursday, November 13, 2008

seamless linux on a thinkpad

I just finished compiling a custom kernel from the latest stable version 2.6.27.4 (tutorial to come) to go with the kde flavor of ubuntu 8.04 on my ThinkPad x61s, which, is really not nearly as hard i thought it'd be. With the configurations set just right, everything works smoothly, no bugs, no annoyances, no compromises.
Fixed:
  • Docking and undocking from the ultrabase on the fly
  • Instead of only seeing 3Gb, 4Gb of RAM now registers correctly
  • Optimization for Core 2 Duo CPU
Switching to linux has enabled me to learn a great deal on how the computer works. Though i'm in no way tech-savy, the linux comunity is so vast and helpful that googling and piecing tutorials and recomandations together was all that was needed to solve most problems. Now with this latest update, i can safely say i won't be tweaking this thinkpad for a long while, a hobby i'll miss while enjoying my open-source-run-and-smooth-as-all-hell notebook.

Wednesday, November 5, 2008

kubuntu intrepid ibex (8.10), impressions of KDE 4.1

Audacious and fearless is an apt description of the Intrepid release for kubuntu. The KDE flavor of ubuntu 8.10 feels like a beta release, largely because of the immaturity of KDE 4.1. Here's my take on kubuntu 8.10, tested on a Thinkpad x61s with ultrabase dock:

I chose to upgrade from 8.04to 8.10 online instead of a fresh install in an attempt to keep as much of the personalized settings that sold KDE for me as possible. And, that's the first thing i found lacking from the new Plasmid desktop management system in KDE 4.1. Without a doubt Plasmid looks smooth and flashy coupled with the new Oxygen theme in 4.1, yet runs beautifully even on integrated graphics, but i found customizing the "plasmoids" limited and very buggy. The number of plasmoids to choose from were decent but few, the large yet hollow and spacious layout of the KDE menu overwhelmed my 12" laptop screen, and Plasmid crashed 2 times in less than 2 hours of use. There is also added needs to click and select for menus to open, and a select/deselect option in Dolphin that i found took away from the original usibility and simplicity.

KDE 4.1 aside, 8.10 solved two key issues in hardware support for me; external monitors and internal screens can now be configured on the fly and docking/undocking is now bug free. However, the middle mouse button still required additional configuration, this time in Hal and not xorg.conf.

I realize it comes down to personal preference, but i when i first booted into KDE 3.5 on kubuntu edgy i had no regrets leaving windows or gnome behind. KDE 4.1 on the other hand shows promise, yet leaves much to be missed and more to be desired. I just switched back to a backup of hardy, the added hardware support did not match up to the lost usability of KDE 3.5, but even if i had the time to get used to and to play around with KDE 4.1, i would install Compiz/fusion over Plasmid for the standard effects i rely on.

Now if only i can get Intrepid to run KDE 3.5........

Thursday, October 30, 2008

siver coin ring part I

Inspired by the spirit of Make:, blind love, and a shallow pocket, i made a silver ring out of a 1907 Canadian quarter for my girlfriend this past summer. 1907 because it is an even century before i met her. At the same time, i got my hands on a 1907 silver 50 that i was going to shape into a matching ring for myself, but realized after the first ring was finished that a 50 would be too large for a single ring (cursed by the Asian gene of the slender southern variety, my ring finger would fit a size 8 comfortably, which would amount to sizing the 50 to nearly 3/4" in span). It seems only natural then to make 2 rings out of the 50, a feat i'll attempt over the next few months in my spare time.

Before that though, here's how i made the first ring:

I started with a Canadian 1907 quarter (has to predate 1960s to insure it's ~90+% silver since nickle is too brittle)














Next, using a small hammer and mini anvil-vice screwed to my desk, i started tapping away at the edges while rotating the ring. The coin began to lose it's grooves, then widen after a half hour.











After 2-3 hours of careful tapping, i was able to size the ring down without too much twist, and proceeded to add a shiny bevel to the edge by very carefully tapping on an angle and gently run a cloth over it with silver polish.











Next is the part i differ from the typical coin ring. Instead of boring out the center with a dremel, i took a regular low-speed power drill to the ring and drilled holed around the center with the ring on a padded vice. I wanted to keep the inscription of the date and make use of it later.











All that left after this is to sand the middle inner face of the ring smooth with a dremel bit, and to find something i can do with the center piece.

The finished product, on a chain and over silver shavings, with a heart-shaped accessory baring the inscription of how much this coin was worth a century ago...

Tuesday, October 28, 2008

kubuntu 8.04 hardy input method fix

All in all my experience on hardy has been great, and i'll be seriously considering to stick with hardy when intrepid is released in a couple of days. Here is, though, a couple more issues, software in nature, i had to sort out for the box to run smoothly in kubuntu 8.04:

SCIM
- this is always a pain to set up, especially in KDE, but i finally stumbled on a good fix that dealt with all the problems in one fell swoop
- first install Chinese support (Gnome: System => Administration => Language Support, KDE 3+: System Settings => Regional & Language => Install New Language)
- im-switch to scim for input (switching to "scim-bridge" for some odd reason lags input when switching focuses
$ locale|grep 'LANG='                  # to see current locale
$ im-switch -z (your_locale) -s scim
- add your locale as a supported locale to ~/.scim/global and /etc/scim/global (editing ~/.scim/global should be enough) by creating the file if necessary and adding the to following line:
/SupportedUnicodeLocales = en_US.UTF-8,(your_locale)
- now this is as far as we follow the official tutorials, the next step solves using scim in firefox, and other apps compiled with their on QT such as Skype, aMsn, and MythTV
- replace /etc/X11/xinit/xinput.d/scim and /etc/X11/xinit/xinput.d/default with the following:
XIM=SCIM
XIM_PROGRAM=/usr/bin/scim
XIM_ARGS="-d"
GTK_IM_MODULE="scim"
QT_IM_MODULE="scim"
DEPENDS="scim,scim-anthy|scim-canna|scim-chewing|scim-pinyin|scim-hangle|scim-prime|scim-skk|scim-tables-additional|scim-m17n|scim-uim|scim-tables-ja|scim-tables-ko|scim-tables-zh"
- again, avoiding scim-bridge solve a lot of problems for me. The original suggestion to keep the GTK_ and QT_IM_MODULEs to xim also lagged input.
- restart, and enjoy multilangual typing

SCIM in CROSSOVER OFFICE
- yes, i gave up tweaking wine and bought into CodeWeaver's crossover software... now this is and will remain the only non-windows proprietary software on my system... it feels like i sold out...
- as a punishment to shelling out for software, getting scim to work in CrossOver office (MS office 2000) this has been a pain up where the sun don't shine for the longest time. To work around CodeWeaver's lack of support for scim input, we will change the default language it boots up in
- edit ~/.cxoffice/default/cxbottle.conf and add the following under [EnvironmentalVariables]:
LANG = zh_TW.UTF8 # or choice of non-english input method
- simple as that, next to make sure you can see the floating input window, deselect Embed Preedit String into client window in SCIM Setup => Global Setup => Options

Sunday, October 26, 2008

my hands smell like pumpkins

kubuntu 8.04 hardy on thinkpad x61s

With 4 days to go until Ibex release, this post may be a little more than a reminder for myself if i need to reinstall. But for those who prefer stability over the latest, here's how i got my Thinkpad to run like the wind on Kubuntu (running kernel 2.6.24-21-generic):


WHAT WORKED OUT OF THE BOX
- SD card reader
- VGA, Ethernet, and USB ports
- Trackpoint
- Internal microphone, headphone and speaker jacks
- Sleep, Hibernate
- Fn+F3 (power), Fn+F4 (sleep), Fn+F12 (hibernate),
- Fn+Home (brightness up), Fn+End (brightness down),
- Fn+ PgUp (keyboard light), Fn+ScrLK (num lock),
- Fn+F5 (turns bluetooth off only),
- Fn+arrow keys (works in Amarok)
- Wireless, Bluetooth
- Docking with Ultrabase X6
- Ultrabase VGA, Ethernet, and USB ports
- Ultrabase headphone and microphone jacks
- Booting (and installing) through slim-bay DVD drive

WHAT I CAN'T GET WORKING

- Undocking when booted while docked to the Ultrabase

NOT TESTED
- Firewire ports
- PCMCIA slot
- Dial-up modem jacks
- Other video out slots on the ultrabase

BEFORE WE START, here's the sources.list i relied on:
# deb cdrom:[Kubuntu 8.04.1 _Hardy Heron_ - Release i386 (20080702.1)]/ hardy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
## UBUNTU
deb http://ca.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy main restricted
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
deb http://ca.archive.ubuntu.com/ubuntu/ hardy universe
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy universe
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb http://ca.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security main restricted
deb http://security.ubuntu.com/ubuntu hardy-security universe
deb-src http://security.ubuntu.com/ubuntu hardy-security universe
deb http://security.ubuntu.com/ubuntu hardy-security multiverse
deb-src http://security.ubuntu.com/ubuntu hardy-security multiverse
## BACKPORTS
deb http://ca.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
## MEDIUBUNTU
## wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
## wget -q http://playonlinux.botux.net/pol.gpg -O- | sudo apt-key add -
deb http://packages.medibuntu.org/ hardy free non-free
deb http://packages.medibuntu.org/ feisty free non-free
deb http://playonlinux.botux.net/ hardy main

ThinkVantage KEY & Fn+Space
- add the following lines to /etc/init.d/rc.local
setkeycodes e017 148 # for ThinkVantage
setkeycodes 0082 192 # for Fn+Space
- use any hotkey manager to tag on a function

MENU KEY

- edit /etc/X11/xkb/symbols/"keyboard layout"
- add in xkb_symbols "basic" after name[Group1]= "keyboard layout":
key  {         [ Menu           ]       };

MIDDLE BUTTON SCROLL
- comment out or replace the "Configure Mouse" and "Synaptics Touchpad" InputDevice sections in /etc/X11/xorg.conf with the following:
Section "InputDevice"
Driver "mouse"
Identifier "mouse[1]"
Option "Buttons" "5"
Option "Device" "/dev/input/mice"
Option "EmulateWheel" "on"
Option "EmulateWheelButton" "2"
Option "InputFashion" "Mouse"
Option "Name" "IBM;TPPS/2 TrackPoint"
Option "Protocol" "explorerps/2"
Option "Vendor" "Sysp"
Option "EmulateWheel" "on"
Option "EmulateWheelButton" "2"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
Option "ZAxisMapping" "4 5"
Option "CorePointer"
EndSection
- remember to replace InputDevice "Synaptics Touchpad" with InputDevice "mouse[1]" under Section "ServerLayout" !

WIRELESS INDICATOR LED
- a problem with intel's iwl4965 driver, addressed in linux backport modules
$ sudo apt-get install linux-backports-modules-hardy
- only problem is that the LED is restricted to flashing a boring 2Hz when upload/downloading
-Ubuntu Archives

FINGERPRINT READER
- first install the necessary drivers and tools from thinkfinger (.30) and enable it in pam configurations
$ sudo apt-get install thinkfinger-tools libpam-thinkfinger libthinkfinger0
$ sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable
- restart the computer
- register and verify the fingerprints

$ sudo tf-tool --acquire
$ sudo tf-tool --verify
- lastly, edit /etc/pam.d/common-auth and add the following line above everything else to enable fingerprint authentication for logins and su
$ auth  sufficient pam_thinkfinger.so
- pam_thinkfinger actually does not work under kdm/kde due to an issue with kdesktop_lock. It is possible to work around it but the simplest way is to go with fprint or switch to gdm.
-edubuntu wiki

EXTERNAL MONITOR & Fn+F7 VIDEO OUTPUT TOGGLE
- this is tricky business, but after piecing multiple fixes together, my set up works great if i leave X to find the external monitor and only tweak with it after startup. It'll be easy also to modify it further and statically set the video output modes to fit your monitors. This is what made it for me, to be able to switch between screen layouts effortlessly.... sweet!
- first, add a subsection in xorg.conf under
Section "Screen" so it looks like the following:
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Depth 24
Virtual 2048 1050
EndSubSection
EndSection
- the Virtual screen resolution forms the screen space to manipulate the monitor space on, and should not be greater than 2048 x 2048 to keep 3D acceleration running in x61's dingy internal graphics card.
- use xrandr to tweak the monitors:
$ xrandr -q                                  ## view connected displays' information
$ xrandr --output VGA --auto --right-of LVDS ## place VGA output on the right side of laptop LCD
$ xrandr --output VGA --off ## turn VGA output off
$ xrandr --man ## for the complete list of functions
- now to toggle between output using Fn+F7, first create /usr/local/sbin/toggle-display.sh
- (dumbed down to fit my screens):
#!/bin/bash
# Modified from: http://www.thinkwiki.org/wiki/Sample_Fn-F7_script
# /etc/acpi/events/ibm-videobtn
#
# External output may be "VGA" or "VGA-0" or "DVI-0" or "TMDS-1"
EXTERNAL_OUTPUT="VGA"
INTERNAL_OUTPUT="LVDS"

function screen_external(){
xrandr --output $INTERNAL_OUTPUT --off
xrandr --output $EXTERNAL_OUTPUT --auto
}
function screen_internal(){
xrandr --output $EXTERNAL_OUTPUT --off
xrandr --output $INTERNAL_OUTPUT --mode 1024x768 --pos 0x0 #re-centers
}
function screen_both(){
xrandr --output $INTERNAL_OUTPUT --mode 1024x768 --pos 0x0
xrandr --output $EXTERNAL_OUTPUT --mode 1680x1050 --pos 368x0 #to fit 2048x2048
}

function screen_toggle(){
# Figure out current state
INTERNAL_STATE=$(xrandr | grep ^$INTERNAL_OUTPUT | grep con | sed "s/.*connected //" | sed "s/(.*//")
EXTERNAL_STATE=$(xrandr | grep ^$EXTERNAL_OUTPUT | grep con | sed "s/.*connected //" | sed "s/(.*//")
if [ -z "$INTERNAL_STATE" ]; then
STATE="external"
elif [ -z "$EXTERNAL_STATE" ]; then
STATE="internal"
else
INTERNAL_STATE=$(echo $INTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
EXTERNAL_STATE=$(echo $EXTERNAL_STATE | sed "s/[0-9]*x[0-9]*//")
if [ "$INTERNAL_STATE" = "$EXTERNAL_STATE" ]; then
STATE="mirror"
else
STATE="both"
fi
fi
case "$STATE" in
internal)
screen_external
;;
external)
screen_both
;;
both)
screen_internal
;;
*)
screen_internal
;;
esac
}

# based on /etc/acpi/screenblank.sh (Ubuntu 7.10)
# . /usr/share/acpi-support/power-funcs # for getXuser
getXuser() {
user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
if [ x"$user" = x"" ]; then
user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
fi
if [ x"$user" != x"" ]; then
userhome=`getent passwd $user | cut -d: -f6`
export XAUTHORITY=$userhome/.Xauthority
else
export XAUTHORITY=""
fi
}
# end of getXuser from /usr/share/acpi-support/power-funcs
#
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
screen_toggle
fi
done
- to make it executable:
$ sudo chmod 755 /usr/local/sbin/toggle-display.sh
- edit and point /etc/acpi/events/ibm-videobtn to the script
# /etc/acpi/events/ibm-videobtn
# This is called when the user presses the video button. It is currently
# a placeholder.
event=ibm/hotkey HKEY 00000080 00001007
action=/usr/local/sbin/toggle-display.sh
- restart acpi
$ sudo /etc/init.d/acpid restart

Saturday, October 18, 2008

a series of broken events

This month hasn't been a good one for my gadgets... first my computer earphones short circuited and took out a few ranges of my hearing with it, then my cellphone head-set gets snagged by the car door and rips in two, and as if that wasn't careless enough, i stepped on my thinkpad x60s and cracked the LCD screen. And just now, my camera suddenly stopped working. It sounds like the motor to the zoom lens is jammed on something.

Total amount of damages assuming i replace everything = (cue cheap dramatic midi music) ~$1600.00 CAD (now cue puzzlement). It turns out that to purchase a new laptop, one grade higher than what i is around $1200, while buying a LCD screen from Lenovo to replace my broken one is a whopping $1300 not including tax... Where is my mini screw driver...