Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Saturday, April 16, 2011

Controlling the fan of the netgear stora

I recently bought a netgear stora. I like the small form-factor of the device and also the fact that it can be hacked easily and you can put a plain vanilla debian on it. While the fan is not nearly as noisy as the fan of the dns-230 which I owned previously, I still got annoyed. I figured that the two hdds (WD EARS 2TB) don't produce much heat anyway so I decided turn off the fan. This has worked for me for more than two weeks now, and the stora never gets much warmer than room temperature (even under heavy load).

HOWEVER, I TAKE NO RESPONSIBILITY WHATSOEVER IF YOUR HARDDISKS GET FRIED OR YOUR HOUSE BURNS DOWN IN THE PROCESS

Here is, how you can control the fan (you must have debian installed on the stora):
  1. log in as root
  2. install ic2-tools:
    root@pico:~# apt-get install i2c-tools
  3. create two scripts to start and stop the fan:
    echo "i2cset -y 0 0x1b 0x04 0x0b" >/usr/bin/fan_off
  4. echo "i2cset -y 0 0x1b 0x04 0x0a" >/usr/bin/fan_on
    chmod +x /usr/bin/fan_off
  5. chmod +x /usr/bin/fan_on
  6. you can now switch on/off the fan using the commando sudo fan_on / sudo fan_off
  7. enjoy the silence :-)

Friday, April 15, 2011

Accessing VMWare Server 2 with native remote console

  1. Install the firefox plugin via the "console" tab in the webaccess
  2. go to the plugin directory, e.g. /home/chris/.mozilla/firefox/3oj121wq1.default/extensions/VMwareVMRC@vmware.com/plugins
  3. you can run  ./vmware-vmrc -h from here to get the connection dialog that lets you connect to your vmware server
  4. in the field host-name, type in your server-name or ip-address followed by :8333, e.g. server.example.com:8333
  5. Enter your credentials and connect - you'll get a list of the registered vms which you can manage from here
vmware remote console

Friday, March 11, 2011

Preventing OOM killer from terminating your vmware session

The linux-kernel comes with a mechanism (OOM-Killer) that will terminate processes in order to free up memory when it runs out of memory. After upgrading my Ubuntu 10.10 setup to a 2.6.36 kernel, my vmware session repeatedly got terminated, despite plenty of free memory and swap.
In order to prevent this from happening I figured out that you can change the the value of the /proc/[id_of_vmware_vmx_process]/oom_adj to -17.  I have made a small shell script that checks whether the vmware process is running and if this is the case, adjust the oom_adj value:

contents of /usr/bin/vmware-protect-from-oom.sh:

#!/bin/bash
pid=$(pidof vmware-vmx)
if [ $pid > 0 ]; then
sudo echo "-17" > /proc/$pid/oom_adj
fi


In order to run this automatically, add the following line to the end of your root user's cronjob list:  sudo crontab -e):

* * * * * /usr/bin/vmware-protect-from-oom.sh