Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Saturday, 18 September 2010

A new look for bawdo.com - soon


Around 5 years ago I wrote www.bawdo.com in PHP, this week I rewrote the site using Ruby on Rails. I have one more thing to do before I make it go live, and that is to migrate old posts over to the new site. Maybe tomorrow :-)



Here is a sneak preview. There are some missing elements such as a way to contact me from the site, my Mystery Tour page, and 150_002 Linux which is so old now it should probably be taken down.



The iPhone version of the site can currently display comments, but I have not hacked up the required form to add a new comment. Leave that for another day.

Saturday, 17 April 2010

Japanese and English Keyboards - fun with evdev

I have been using Japanese keyboards now for many years and always make sure my laptops come with them. I like the layout and have become accustomed to it. However I was recently given a new Kinesis keyboard that has a US keyboard layout.

This new keyboard and nwo that evdev has become the flavour of the month when configuring keyboards under X make me write this post.

evdev and the default fdi keymap
However, the default fdi config does not play so nicely with Japanese keyboards. So here is my fdi keymap:


<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.keyboard">
<merge key="input.x11_driver" type="string">kbd</merge>
<merge key="input.x11_options.XkbRules" type="string">evdev</merge>
<merge key="input.x11_options.XkbLayout" type="string">jp</merge>
<merge key="input.x11_options.XkbModel" type="string">jp106</merge>
<merge key="input.x11_options.XkbOptions" type="string">ctrl:nocaps</merge>
<!-- If we're using Linux, we use evdev by default (falling back to keyboard otherwise). -->
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
string="Linux">
<merge key="input.x11_driver" type="string">evdev</merge>
</match>
</match>
</device>
</deviceinfo>


This works fine. Until you plug in another keyboard other than Japanese.

Keymap switching alias
To switch between Japanese and Keyboard layouts I have created the following aliases.

english='setxkbmap us'
japanese='setxkbmap jp'

This works fine except for the the "|\" key. Switching to English sees this key disappear all together. And if you have an international US keyboard the "|\" International Key becomes an "<>" key. So to fix this I have done the following.

# Create an ~/.Xmodmap file to remap keys 94 and 51 "|\"

keycode 94 = backslash bar
keycode 51 = backslash bar

# Change the above mentioned english alias.

english='setxkbmap us ; xmodmap ~/.Xmodmap'

Sunday, 4 January 2009

OpenSolaris 2008.11 as a DomU running on a Linux Dom0

I'm not going to write yet another tutorial on how to setup OpenSolaris as a DomU running atop a Linux Dom0. What you will find here are my cfg files.

Dom0
  • Xen 3.3
  • Linux xen 2.6.18-xen-r12 x86_64 Dual-Core AMD
DomU
  • SunOS opensolaris-01 5.11 snv_101b i86pc i386 i86pc Solaris
cfg file used during the install

# -*- mode: python; -*-
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'

kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'

memory = "512"
shadow = "2"
name = "opensolaris-01"
vif = ['type=ioemu, bridge=xenbr0']
dhcp = "dhcp"
vcpu="2"
disk = [ 'phy:xenvg/open-sol-01,hda,w','file:/xen/iso/osol-0811.iso,hdc:cdrom,r' ]

boot='d'

usb=0 # No USB support

sdl = 0
vnc = 1
vncpasswd='password'
vnclisten='192.168.1.10' # Replace this with the IP address of Dom0
serial='pty'
stdvga=0

on_poweroff = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'



cfg file used for normal running

# -*- mode: python; -*-
import os, re
arch = os.uname()[4]
if re.search('64', arch):
arch_libdir = 'lib64'
else:
arch_libdir = 'lib'

kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'

memory = "512"
shadow = "8"
name = "opensolaris-01"
vif = ['type=ioemu, bridge=xenbr0']
dhcp = "dhcp"
vcpu="2"
disk = [ 'phy:xenvg/open-sol-01,hda,w','file:/xen/iso/osol-0811.iso,hdc:cdrom,r' ]

boot='c'

usb=0 # No USB support

sdl = 0
vnc = 1
vncpasswd='password'
vnclisten='192.168.1.10'
serial='pty'
stdvga=0

on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'preserve'