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...

Thursday, October 16, 2008

context dependency

Key to shaking or forming a habit is the context. Learning is, to a large degree, context dependent. When you remember the loaf of bread you were suppose to buy when you're back on the front steps of your home, it's because that's where you were told to buy it. Context-dependent learning is why it's easy to not utter profanity in a church but much harder to remain pious at a bar; we learned particular behaviours in particular settings and thus work well when the behaviour performed matches the setting.

To study well, do nothing but study at your desk. The minute you become tired, leave and refresh yourself, so that only positive feedback is associated to studying at your desk. The same principle can be applied to up the quality of other behaviours; only eat at the kitchen table to have healthier digestion; don't read, work or exercise on the bed to get a better sleep; allot a room solely for romantic uses and your partner will feel the difference :P

So conversely, the first step to shaking a habit is to take yourself out of the habit's context. You're not likely to become atheist living in a church, nor stay sober if you keep visiting the pub. Pretty intuitive. It's when leaving the context is impossible that it becomes hard... The work-around is to revamp the environment as much as possible, but it's still a matter of starting starting a new behaviour in place of the old habit.

Slow and steady does it.

Lynch R, Leo S, Sowning K. Context dependent learning: its value and impact for workplace education. Education and Training 2006; 48(1): 15-24.

Wednesday, October 15, 2008

kill an old habit

The first computer i laid my hands on was an 386 with a monster yellow-black screen, and the first and only thing i did on it was play TETRIS. I learned how Windows-based computers worked by figuring out how to boot an old PentiumI just right to run DOOM, Wing Commander, and countless other games my folks Easter-Egged in the hard-drive, just slightly too hardware intensive for the old tower. I learned while i played but i didn't stop playing after. Even when i finally gave up the last of my games, time spent on first-person shooters and RPGs were replaced by endless video-feeds, news-feeds, art blogs, science blogs, tech blogs... I tell myself i'm absorbing new information, keeping up with news of the day, and becoming more knowledgeable, but, luckily i suppose, i'm yet unconvinced that mere consumption is in anyway meaningful.

So how do you kill an old habit? High school and much of university has trained me to produce mediocre work in little time, and after near twenty years of gaming and pointless browsing in front of the computer i conditioned myself to near uncontrollably do just that and only that when i'm home. I feel like an addict, watching my life slowly being eaten away, all the while indulging in the cannibalism... I want out!

I want out, and this will be my attempt at producing instead of simply consuming. After you hit your twenties, it's all about trading one addiction for another.