Using Japanese on Debian Jessie

The goal here is to make the English-based system capable of Japanese input, not to make the whole environment based on Japanese.

First, set up locales:

$ sudo dpkg-reconfigure locales

In addition to the English locale (en_US.UTF-8), include Japanese locales (ja_JP.EUC-JP and ja_JP.UTF-8). However, set the default locale for the system to en_US.UTF-8 if you prefer to be mostly in the English environment.

Install im-config:

$ sudo aptitude install im-config

Install fonts that include Japanese characters, e.g.,

$ sudo aptitude install fonts-droid


Install and configure IBus-related packages:

$ sudo aptitude install ibus ibus-clutter ibus-mozc
$ sudo aptitude install ibus-qt4  # or ibus-gtk3 for Gnome
$ im-config

Select “No” to the last question from im-config.

Run the IBus setup program:

$ ibus-setup

If asked, start ibus-daemon.

Under the Input Method tab, add -> Japanese -> Mozc.

Under IBus Preferences, configure things to your liking. For example, I prefer making Ctrl + Space (as opposed to Shift + Space) trigger the switch between input modes. The IBus icon also shows up in the system tray, from which various settings can be changed with right click.

Logout the KDE sesssion, restart X session, and login again.

Posted in Uncategorized | Tagged , | Leave a comment

Installing Debian/Jessie on ThinkPad T460s

This is a Debian/Jessie installation instruction on ThinkPad T460s (product ID: 20F9CTO1WW).

First, update BIOS on Windows if necessary, since that kind of task is unfortunately typically much easier on it. Also make sure to create a recovery media for Windows 10.

Disable Secure Boot in BIOS.

Boot from the netinst (with firmware) install media. Use wired network while installing. Wireless does not work out of the box.

Boot from the install USB media. Follow the standard Debian installer instruction:

  • Language: English
  • Country: United States
  • Keymap to use: American English
  • Primary network interface: wlan0
  • Wireless network: (your choice)
  • Hostname: (your choice)
  • Domain name: (your choice)
  • Root password: (your choice)
  • Full name for the new user: (your choice)
  • Username for your account: (your choice)
  • Choose a password for the new user:
  • Re-enter password to verify: (your choice)
  • Select your time zone: (your choice)
  • Partitioning method: Manual

Here is my partitioning scheme:

1 /boot/efi  300 MB EFI System Partition (bootable, EFI System partitoin)
2 /boot      250 MB ext4
3 /          100 GB ext4
4 /usr/local  50 GB ext4
6 /home      338 GB ext4
5 SWAP        24 GB
  • Write changes to disks: yes
  • Debian archive mirror country: (your choice)
  • Debian archive mirror: (your choice)
  • HTTP proxy information: (your choice)
  • Participate in the package usage survey: (your choice)
  • Choose software to install: (your choice; recommended to install Windows manager with Wifi support)

If asked during installation, force UEFI installation: Yes (on the SSD, not USB device from which the installer is running).

After the first reboot, log in as root and do the following:

It would be convenient to add your regular user account to sudo group:

# apt-get install sudo
# adduser <username> sudo

Intel Wireless 8260

Wireless does not work out of box. Upgrade kernel and install firmware. Add contrib and non-free, as well as backports to /etc/apt/sources.list, which should have lines similar to this:

deb jessie main contrib non-free
deb-src jessie main contrib non-free

deb jessie/updates main contrib non-free
deb-src jessie/updates main contrib non-free

deb jessie-backports main contrib non-free

Then upgrade the kernel and video driver and install updated firmware:

# apt-get update
# apt-get install -t jessie-backports linux-image-4.5.0-0.bpo.1-amd64
# apt-get install -t jessie-backports firmware-linux-nonfree
# apt-get install -t jessie-backports firmware-iwlwifi
# apt-get install -t jessie-backports xserver-xorg-video-intel

Reboot and wireless should be working.

TrackPoint scrolling and disabling TrackPad

Install xinput:

$ sudo apt-get install xinput

Create ~/.xsessionrc file with the following content:

# ThinkPad T460s TrackPad/TrackPoint configuration
# Required package: xinput

# extract device id from xinput output
function get_dev_id() {
    s=$(xinput | grep "$device_name")

# TrackPoint
get_dev_id "TPPS/2 IBM TrackPoint"

xinput --set-prop --type=int --format=8 "$dev_id" "Evdev Wheel Emulation" 1
xinput --set-prop --type=int --format=8 "$dev_id" "Evdev Wheel Emulation Button" 2
xinput --set-prop --type=int --format=8 "$dev_id" "Evdev Wheel Emulation Axes" 6 7 4 5
xinput --set-prop --type=float "$dev_id" "Device Accel Constant Deceleration" 0.25
xinput --set-prop --type=float "$dev_id" "Device Accel Adaptive Deceleration" 1.0
xinput --set-prop --type=float "$dev_id" "Device Accel Velocity Scaling" 12.5

# TrackPad
get_dev_id "PS/2 Synaptics TouchPad"

# disable TrackPad if desired
xinput --set-prop --type=int "$dev_id" "Device Enabled" 0

Source this file explicitly

$ . ~/.xsessionrc

or upon the next boot, TrackPoint should be fully working.

Posted in Uncategorized | Tagged , , | 2 Comments

Logitech Wireless Trackball M570 on Debian/Jessie

I’ve started using a trackball instead of mouse, as my desktop space is pretty limited to fit even a tiny mouse pad. I have been a fan of Logitech mouse with that super-fast scroll wheel. Through I knew Logitech M570 does not come with that type scroll wheel, I went with Logitech anyways.

The trackball feels typically Logitech-ish in my hand, but the lack of fast scroll makes it significantly less ergonomic with the need to repeatedly move the middle finger in awkward ways.

Fortunately, the trackball can be configured to double as a scroll wheel and it can do horizontal scrolling which the default scroll wheel does not even support.

First, install xinput:

$ sudo apt-get install xinput

and insert the following code somewhere in ~/.xsessionrc:

After sourcing ~/.xsessionrc, rolling the trackball while holding down the middle button (i.g., pressing down the scroll wheel) scrolls the view.

The speed of scroll can be adjusted by Evdev Wheel Emulation Inertia. Setting it to a larger value makes the page scroll slower.

Posted in Uncategorized | Tagged , , | 2 Comments

Netgear ReadyNAS and Linux

I am now using the NetGear ReadyNAS RN31200 mostly for backup purposes. I have not configured RAID, and for a while I just plan to use this as a replacement for USB hard drives, which means I simply want to sync files on my main Linux machine and the ReadyNAS via rsync.

First, configure ReadyNAS for use normally, following the instruction given by the manufacturer.

Through the ReadyNAS admin interface (i.e., visit https://READYNASHOST with a browser), create a normal user (Accounts -> Users -> New User) and a group (Accounts -> Groups -> New Group). The username and group should be named similarly to the ones used on my Linux host. Look up in /etc/passwd (where each line looks like username:password:uid:gid:info:home_dir:shell for each user on the host) and /etc/group (groupname:password:gid:group_list) and take notes of uid and gid and use the same values on ReadyNAS.

Enable ssh on ReadyNAS (System -> Settings -> Services and enable SSH service).

Log in to the ReadyNAS via ssh. (It is confusing, but the admin password for the ReadyNAS admin interface is the root password for ssh.)


On the NAS, see if the user and group have been properly created:

nas# cat /etc/passwd
nas# cat /etc/group

In order to use rsync as a normal, non-root user, /etc/passwd needs to be edited (vi is installed on the NAS; if another text editor is preferred, install via apt-get), so that the normal user’s shell points to /bin/bash and not /bin/false:


After this, you should be able to ssh into the NAS as the normal user with password.

Now using rsync is done on my main Linux machine as in:

$ rsync -av somelocalfile user@READYNASHOST:/data/someshare

in which where /data/someshare has already been created through the ReadyNAS admin interface.

That’s it!

Note: The ReadyNAS OS seems to be based on a Debian-like OS, so all the normal Linux configuration tips apply, e.g., setting up password-less login with RSA keys.

Posted in Uncategorized | Tagged , , | 1 Comment

Numba on Debian/Jessie

$ sudo pip install enum34
$ sudo pip install numba

If the use of numba complains of llvmlite not being installed, you may need additional packages:

$ sudo aptitude install llvm-dev libedit-dev
$ sudo pip install llvmlite
$ sudo pip install funcsigs
Posted in Uncategorized | Leave a comment

Using DNS Servers in Debian/Jessie

Say you want to use DNS servers and

In /etc/resolve.conf, have the following line:


and make sure there are no dns-nameservers lines in /etc/network/interfaces.

In /etc/dhcp/dhclient.conf, have the following line:

supersede domain-name-servers,;

Restart the networking service:

$ sudo /etc/init.d/networking restart

Check if the DNS server is used:

$ dig
;; SERVER: (should see the DNS server here)
Posted in Uncategorized | 2 Comments

Creating a Debian Bootable USB Stick with Non-Free Firmware

Debian installation on new hardware can be a hassle when it depends on non-free firmware support. A typical workaround is to use a Debian install image which includes non-free drivers, which is available here: Unofficial non-free images including firmware packages. Choose the right image for the kind of USB media you wish to create.

For this post, I chose (amd64 Jessie 8.4.0 netinst + non-free):

$ wget

Find a USB stick (which you do not mind formatting entirely; all existing contents will be wiped out with this method), connect it to a working Linux box, and find the device pointer to the stick:

$ sudo fdisk -l
... (other devices) ...

Disk /dev/sde: 14.9 GiB, 16008609792 bytes, 31266816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x156252ec

Device     Boot Start     End Sectors  Size Id Type
/dev/sde1  *        0 7800959 7800960  3.7G  0 Empty
/dev/sde2       20368   21199     832  416K ef EFI (FAT-12/16/32)

... (other devices) ...

We see that the USB stick is attached at /dev/sde in this case (IMPORTANT: this will certainly be different for you; really do make sure the device is the USB stick you would not mind being wiped out).

Then create a bootable installation stick:

$ sudo dd if=firmware-8.4.0-amd64-netinst.iso of=/dev/sde bs=4M
$ sudo sync


There appears to be issue writing to USB from isohybrid .iso image, from which I have not been able to create a proper bootable image. Check on this and update the post.


Posted in Uncategorized | Tagged , , | Leave a comment

Install Google Chrome on Debian Jessie

Download a DEB file for the version of Chrome you want from here.


 $ sudo aptitude install gconf-service libgconf-2-4 libnspr4 libnss3 libpango1.0-0 libappindicator1 libcurl3
$ sudo dpkg -i google-chrome-stable_current_amd64.deb
Posted in Uncategorized | Tagged , | 8 Comments

Installing HipChat on Debian Jessie

I simply download HipChat from the official repository and follow the installation instruction there, but when I launch the application, I get the following error:

$ hipchat
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/ failed (/usr/local/opt/HipChat/bin/..//lib/ version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/
libGL error: dlopen ${ORIGIN}/dri/ failed (/usr/local/opt/HipChat/bin/..//lib/ version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/
libGL error: dlopen /usr/lib/dri/ failed (/usr/lib/dri/ cannot open shared object file: No such file or directory)
libGL error: unable to load driver:
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/ failed (/usr/local/opt/HipChat/bin/..//lib/ version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/
libGL error: dlopen ${ORIGIN}/dri/ failed (/usr/local/opt/HipChat/bin/..//lib/ version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/
libGL error: dlopen /usr/lib/dri/ failed (/usr/lib/dri/ cannot open shared object file: No such file or directory)
libGL error: unable to load driver:
libGL error: failed to load driver: swrast

The program gets stuck there until it is killed.

It is not elegant, but HipChat isn’t a very essential application for me, so I simply bandage this by replacing the libstdc++ that comes with HipChat with the one from Debian:

$ cd /opt/HipChat/lib
$ sudo mv
$ sudo mv
$ sudo mv
$ sudo cp /usr/lib/x86_64-linux-gnu/ .

Now HipChat should launch normally.

Posted in Uncategorized | Tagged , | 1 Comment

Installing Hadoop-LZO on Debian Jessie

JDK 1.6 or later is need to be already installed for this to work.

Install a few packages:

$ aptitude install liblzo2-dev maven git

To see where the LZO library is installed, get a list of files installed:

$ dpkg-query -L liblzo2-dev
... list of paths ...

In my box, the include and library paths are /usr/include/lzo and /usr/lib/x86_64-linux-gnu, respectively. (These paths should be recognized without doing anything, but if specifically pointing to them is necessary upon build with mvn later, try:

$ C_INCLUDE_PATH=/usr/include/lzo \
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu \
  mvn clean test

for example.)

Get the source from the Hadoop-LZO github repo:

$ git clone
$ cd hadoop-lzo
$ mvn clean test package

If the build is successful, the JAR should be found under target:

$ ls target/

Typically, the JAR thus created should be installed in $HADOOP_HOME/share/hadoop/common/lib, and the following properties need to be added to configuration files under $HADOOP_HOME/etc/hadoop.

In core-site.xml:


  ... some other properties ...

    <value>                                                                                                                                                                     ,                                                                                                                               ,                                                                                                                                  ,                                                                                                                                 ,                                                                                                                               ,                                                                                                                                ,                                                                                                                                      



In mapred-site.xml:


  ... some other properties ...


Posted in Uncategorized | Tagged , , | Leave a comment