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

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


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 , | 6 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/

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




In mapred-site.xml:


  ... some other properties ...


Posted in Uncategorized | Tagged , , | Leave a comment

Installing Adobe Reader on Debian/Jessie

Once in a while you need to deal with fancier PDF files which may allow you to type in using forms, but Linux applications like Okular might not be fully capable of handling Adobe’s proprietary features. In such an unfortunate event, you might need to use Adobe Reader.

Go to the FTP download site on Adobe and download the version you wish to install. Here the version 9.x is assumed:

$ wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install libgtk2.0-0:i386 libxml2:i386 libstdc++6:i386
$ sudo dpkg -i AdbeRdr9*.deb

If the installation doesn’t fully complete, you might need to do

$ sudo apt-get -f install

to install the rest of missing packages.

Posted in Uncategorized | Tagged , , | 11 Comments

Using Tor on Debian Jessie

Install the package and start the service:

$ sudo apt-get install tor
$ sudo /etc/init.d/tor start

Check to see if Tor is running:

$ sudo netstat -plant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0*               LISTEN      7766/tor

You should see an entry for Tor.

To simply use this, manually specify SOCKS proxy configuration with localhost:9050. Visit a site like showip.net to check what IP address the remote host is seeing; it should be the exit node of Tor and not the IP address of your host.

For a command-line program, use may use torsocks. For example, if you want to use ping with Tor, do:

$ torsocks ping somedomain.com
Posted in Uncategorized | Tagged , , , | Leave a comment