Netgear GS605 v2 is faulty!

I have two of these switches, and I just got stung by a nasty hardware fault that is present in version 2 of this device: when you have two of these devices connected to each other (or just on the same LAN), the throughput for all connections on one of them will drop to a few hundred Kb/s e.g. 400Kb/s! This effectively cripples the LAN which should normally have file transfer speeds of > 25Mb/s.

This has been reported on the Netgear forums here and Netgear have acknowledged the fault. Unfortunately there is no solution other than replace one of the devices with something else (apparently v3 of the GS605 works ok), but I learned a few tricks for how to diagnose network bandwidth issues in the process:

  • Use iperf.exe. This is the standard command line app for testing network bandwidth, and work on both linux and Windows. On linux just sudo apt-get install iperf, on Windows download from here.

    It’s easy to use: on one machine, start a server using:

    iperf -s

    On another start a client duplex test to the server using:

    iperf -c [server ip address] -d

    The results will be printed after a few seconds.

  • Use a good Cat5e or Cat6 ethernet cable. Cables can easily be faulty, check for green lights on your NIC & switch port to indicate 1000Mb/s (gigabit) connection speed.
  • Avoid PCI Gigabit cards (use onboard Gb NIC). PCI but is limited, especially if you have any other devices on the bus.
  • Use a decent file-copy utility. For example, SuperCopier, that instantly shows you your copy speed.

Setting LinearLayout background on activity launch

Just came across an issue where on one device (HTC Desire X) I was unable to set the background resource for the root LinearLayout of my activity’s view, even though it worked fine on multiple other devices. The code I was using:

setContentView(R.layout.background);
LinearLayout appBackground = (LinearLayout)findViewById(R.id.appBackground);
appBackground.setBackgroundResource(someResourceId);

The above code was called from onCreate(), and a call to invalidate() didn’t help. To fix it I had to post a delayed runnable to set the background a little later:

setContentView(R.layout.background);

new Handler().postDelayed(new Runnable() {
  @Override
  public void run() {
    LinearLayout appBackground = (LinearLayout)findViewById(R.id.appBackground);
    appBackground.setBackgroundResource(backgroundResourceId);
  }
}, 200);

Yes it sucks, but it works and the delay is not noticable. Variation between Android devices sucks :S

GVFS folder moved from ~/.gvfs

Network shares were previous mounted under a hidden folder in your home directory called gvfs. In recently distros of Ubuntu and those based on it, such as Mint, this directory has now moved to:

/run/user/[username]/gvfs/

and the name of the folder under there for each share is really complicated, like:

smb-share:domain=yourdomain.com,server=hostname,share=files,user=username

which is really not very nice. So you should make a symlink to it like this:

ln -s "/run/user/[username]/gfvs/smb-share:domain=yourdomain.com,server=hostname,share=files,user=username" ~/files_on_hostname

or something similar.

Missing cursor in SSVNC session on Linux

When I use SSVNC to open a session on a remote linux box, my mouse cursor often appears as a single pixel dot (no arrow) which is extremely difficult to see. I found that to solve it, the easiest thing to do is press F8 after your connection has started, then deselect ‘Cursor Shape’ from the SSVNC popup window that appears, then click the mouse once (within the client window) to get your cursor to switch to an arrow.

Wish I could make it do that by default…

VNC to Linux Mint Mate gives ‘Connection Refused’

After a fresh install of Linux Mint 15 with Mate, and enabling Desktop Sharing, I was getting ‘Connection Refused’ when trying to VNC from other machines. The same steps on Linux Mint 15 with Cinnamon on the same box showed VNC was working and hence the problem was caused by Mate. After some research it appears this is a known issue, but luckily there is an workaround until it is fixed properly – follow the steps here.

It seems like a lot of people are using an alternative VNC server like tightvnc which gives a different desktop to the console, but for some reason I just want to have one desktop, which is the console one, so if i’m working directly on the machine, I can walk away and work remotely picking up where I left off locally.

Mint continues to be my preferred distro, hopefully this issue is resolved in a future update.

HDD reported as full when it’s not – iNodes

Yes, this can happen, as I just found out – there is something called iNodes in the file-system (in my case ext4), with each file on the partition assigned to an iNode. And each partition has a fixed limit on the number of iNodes.

For example, my 50Gb root partition has 3.2 million iNodes, meaning it can have up to 3.2 million files. Sounds like a lot, but due to one particular program (GreyHole, subject of a future post), I ended up with ~ 3 million files in my /var/spool folder. Once my iNode counter reached max, no new file could be created, with programs reporting ‘Out of disk space’. But df showed me I had plenty of disk space. After I figured out it was iNodes I had run out of, rather than bytes, by using:

df -ih

I knew to look for something that was creating a large number of small files, and once I found the folder with ~3 million files, I just had to delete them. Unfortunately, you can’t just do rm * when there is that many files, I used this solution from stack overflow:

find . -name "*" -maxdepth 1 -print0 | xargs -0 rm

And all was well 🙂

Side node: If your root partition fills up, you may be wondering how to actually perform the since your system probably can’t boot. I’m running Fedora and found that I needed to press ‘e’ repeatedly during the boot sequence which would bring me to the GRUB bootloader. Esapce to cancel any changes, then select your kernel and press ‘e’ again to edit. Then add a space and the word ‘single’ (no quotes) to the end of the line and press Enter. Then press ‘b’ to boot that kernel into ‘single user’ mode, which is runlevel 1 (file systems mounted but not network). This will drop you at a command prompt with access to inspect and modify your file system to either free up space or iNodes, which ever you need to do.