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

IBus

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 http://ftp.us.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://ftp.debian.org/debian 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:

#!/bin/bash
#
# ThinkPad T460s TrackPad/TrackPoint configuration
#
# Required package: xinput
#


# extract device id from xinput output
dev_id=""
function get_dev_id() {
    device_name="$1"
    s=$(xinput | grep "$device_name")
    s="${s#*id=}"
    dev_id="${s%%[!0-9]*}"
}


# 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 , , | Leave a comment

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

$ ssh root@READYNASHOST

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:

...
user:x:1000:1000:your@email.net:/home/user:/bin/bash

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 1.2.3.4 and 1.2.3.5.

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

nameserver 1.2.3.4
nameserver 1.2.3.5

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 1.2.3.4, 1.2.3.5;

Restart the networking service:

$ sudo /etc/init.d/networking restart

Check if the DNS server is used:

$ dig somehost.com
...
;; 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 http://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/8.4.0/amd64/iso-cd/firmware-8.4.0-amd64-netinst.iso

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

TODO

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.

Reference

http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal

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.

Then

 $ 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 , | 7 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/radeonsi_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen ${ORIGIN}/dri/radeonsi_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen /usr/lib/dri/radeonsi_dri.so failed (/usr/lib/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: radeonsi_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: radeonsi
libGL error: dlopen /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen ${ORIGIN}/dri/swrast_dri.so failed (/usr/local/opt/HipChat/bin/..//lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/lib/x86_64-linux-gnu/libLLVM-3.4.so.1))
libGL error: dlopen /usr/lib/dri/swrast_dri.so failed (/usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
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 libstdc++.so libstdc++.so.bk
$ sudo mv libstdc++.so.6 libstdc++.so.6.bk
$ sudo mv libstdc++.so.6.0.18 libstdc++.so.6.0.18.bk
$ sudo cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 .

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 https://github.com/twitter/hadoop-lzo.git
$ cd hadoop-lzo
$ mvn clean test package

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

$ ls target/
...
hadoop-lzo-0.4.20-SNAPSHOT.jar
...

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:

<configuration>

  ... some other properties ...

  <property>
    <name>io.compression.codecs</name>
    <value>                                                                                                                                                                        
      org.apache.hadoop.io.compress.DefaultCodec,                                                                                                                                  
      org.apache.hadoop.io.compress.GzipCodec,                                                                                                                                     
      org.apache.hadoop.io.compress.BZip2Codec,                                                                                                                                    
      org.apache.hadoop.io.compress.DeflateCodec,                                                                                                                                  
      org.apache.hadoop.io.compress.SnappyCodec,                                                                                                                                   
      org.apache.hadoop.io.compress.Lz4Codec,                                                                                                                                      
      com.hadoop.compression.lzo.LzoCodec,                                                                                                                                         
      com.hadoop.compression.lzo.LzopCodec                                                                                                                                         
    </value>
  </property>

  <property>
    <name>io.compression.codec.lzo.class</name>
    <value>com.hadoop.compression.lzo.LzoCodec</value>
  </property>

</configuration>

In mapred-site.xml:

<configuration>

  ... some other properties ...

  <property>
    <name>mapred.map.output.compression.codec</name>
    <value>com.hadoop.compression.lzo.LzoCodec</value>
  </property>

</configuration>
Posted in Uncategorized | Tagged , , | Leave a comment