MonthJanuary 2015

Installing Epson WF-3520 Printer on Ubuntu

Just had an issue where I couldn’t set up my printer (connected on the network) on my Ubuntu machine because I didn’t have the drivers.  The automatic printer set up would keep crashing half way through.

This post from hits this issue right on the head:

I thought I’d leave a post here, just so I know where to find it again in case I forget.

Time required for badblocks -svn for 1.8TB drive under RAID0

I was curious to see if I had any bad sectors on a set of drives (3x640GB = 1.8TB) I’ve owned since 2010, so I ran “badblocks -svn” on that drive and it took a little over three days to complete.

Some info about the drive setup:

  • 3x 640GB Western Digital Caviar Black
  • SATA 3.0 Gb/s
  • RAID0

Some info on the badblocks command specifically:

  • s – shows scan progress (percent completion)
  • v – verbose mode
  • n – non-destructive read-write mode and requires the drive to not be mounted (more info about the test mode below)
    1. block is first read
    2. test pattern then written into that block
    3. test pattern then read from that block
    4. compare the results from 2-3 to see if they’re the same
    5. put back the original block

Hopefully, this gives a reference for others who want to run this test so that they have an idea at least for how long the test would take.  For a less thorough, but faster test, one can opt to do a non-destructive read test (leave out the “n” option) and it also does not care whether the disk is mounted or not.

Groovy/Grails unable to resolve class – even if the class is in the same package

The Problem

Every now and then I get this annoying problem in GGTS (Grails/Groovy Tool Suite – Version 3.6.2.RELEASE at the time of this writing), where the IDE just complains about how it can’t resolve a class.  The weird thing is that the file that the IDE is complaining about is in the same package as the class that I’m trying to use.  It built before, and the source hadn’t changed – so clearly this should not be happening.

The Fix

Hitting the Clean button on the Eclipse side (Project -> Clean) seems to make the errors go away.

This apparently has been a problem since June 2010 (forum post reference here), so I’m surprised that it is still an issue in the current version.

Disabling Mouse Acceleration in Ubuntu

I’ve been quite accustomed to disabling mouse acceleration on my Windows machine (thanks to playing massive amounts of Counter-Strike back in the day), but now that I’ve started to use Linux a bit more, I’ve found that disabling mouse acceleration was not as easy as in Windows.


I’ve managed to produce a script to disable mouse acceleration (works for me on Ubuntu 14.04).  However, this script needs to be run every time the computer boots because the settings don’t stay.  Here is the script:

#wait for the desktop to settle
sleep 5

#gets the hardware id's of all mice plugged into the system
hardwareIds=$(xinput | grep -i mouse | awk '{print substr($(NF-3),4)}')

#turn off mouse acceleration
for i in $hardwareIds
xinput set-prop ${i} 'Device Accel Profile' -1
xinput set-prop ${i} 'Device Accel Velocity Scaling' 1


The script works by extracting the hardware id’s of the mice that are connected to the system and then applying properties to them that disable mouse acceleration for that device.  The extraction of the mouse hardware id’s are done with this:

#gets the hardware id's of all mice plugged into the system
hardwareIds=$(xinput | grep -i mouse | awk '{print substr($(NF-3),4)}')

Calling xinput in the Terminal will list all the connected input devices, which is grepped (case insensitively) for the word “mouse”, which gives something like this on my machine:

⎜ ↳ Logitech G500s Laser Gaming Mouse id=14 [slave pointer (2)]
⎜ ↳ Logitech G500s Laser Gaming Mouse id=15 [slave pointer (2)]

The call to awk extracts the hardware id from those two lines (14, 15 in the above case) and stores them in an array that is iterated through when setting the mouse properties.


This is the website that showed me how to disable mouse acceleration to begin with:

Resolving dd-wrt bug that prevented computers on a LAN with wired connection from talking/pinging/communicating with each other

I just had a problem where the computers in my house that were all using a wired connection could not talk to each other.  Computers on wired connections could not ping, and ping kept giving an error saying “destination host unreachable”.  I found the solution in a very hard to find forum post on the dd-wrt forums.

This specific instance of the problem affects users of the dd-wrt firmware.  In my case, I am using build 24461 of the firmware.  The solution is to run the following commands on the router (either with ssh or telnet):

swconfig dev eth0 set enable_vlan 1
swconfig dev eth0 set apply

I’ve since put this in the startup commands that the router will execute, so these settings will stay even after a router reboot.

For some routers, it might be eth1 instead of eth0.  It depends on which network interface is assigned to the WAN.  This can be check in the router page under Setup > Networking.

Link to forum post:

© 2018 Henry Poon's Blog

Theme by Anders NorénUp ↑