How to Set to The Best Mouse Sensitivity for Apple Magic Mouse

I couldn’t find my best touch with the Mouse Sensitivity setting for Magic Mouse in System Preference. Ended up I decided to write the configuration directly to the system config file. I find the value -31000 fit me the best. To set the sensitivity, follow the steps below.

  • Open Terminal, it can be found at Application -> Utilities
  • Enter line below
  • defaults write .GlobalPreferences com.apple.mouse.scaling -31000

There is another application can do more setting on Magic Mouse. It’s called Magic Prefs. Download link is here.

How to Change Timezone in FreeBSD

By default, FreeBSD is configured with UTC timezone. In order to localize your timezone, follow the steps below.

  • 1. cd /usr/share/zoneinfo
  • 2. cp Asia/Hong_Kong /etc/localtime

Now the local time zone has been configure, lets get the updated time and date from ntp server.

  • 1. ntpdate 0.asia.pool.ntp.org

Fixed Cacti Spine 0.8.7g Problem on FreeBSD

On latest release of Cacti Spine 0.8.7g, it has new Multi threaded host polling feature. After upgrade Cacti Spine from version 0.8.7e to 0.8.7g, the graphing stopped working on FreeBSD 8.1 box. When we check the process with “top” command, it seems like spine process is hang and it utilizes 100% of CPU usage.

While doing verbose logging on spine, we saw the message “Spine Timed Out While Processing Hosts Internal” freezing until it reaches the script time out at 40 seconds. The logs didn’t provide much info and the actual fixes are available at Cacti Official Spine Patches website. After apply the patches, Spine 0.8.7g is working on the FreeBSD’s box. Most of our packages installation are through FreeBSD ports, I guess that we have to check on Cacti’s Official website to look for patches. Or the maintainer should grab the latest patches and update from FreeBSD ports :)

If Spine installation is from FreeBSD ports. Here is the step by step to fixed Spine 0.8.7g problem.

  • Go to /usr/ports/net-mgmt/cacti-spine/
  • Perform make clean to wipe off previous compiled files
  • Do make extract to extract the source files
  • On current directory, go to work/cacti-spine-0.8.7g/
  • Download the latest patch from Cacti’s website and apply the patches
  • Make to build the app from patches
  • Make deinstall to uninstall current cacti
  • and finally make install to install patched spine into binary folder.

shell> cd /usr/ports/net-mgmt/cacti-spine/
shell> make clean
shell> make extract
shell> cd work/cacti-spine-0.8.7g/
shell> wget http://www.cacti.net/downloads/spine/patches/0.8.7g/unified_issues.patch
shell> patch -p1 -N < unified_issues.patch
shell> make
shell> make deinstall
shell> make install

How to Lock Your Machine and Display Application Screen

We have a couple monitoring applications running on our Linux desktop. To monitor server health, graph utilization through various network monitoring systems. Usually monitoring application required authentication and it will be a security issue if you left your Linux desktop unlock.

But if you lock your Linux desktop, the screen will goes blank and you can’t monitor what is projected on your screen. There is a way to do it with screen saver lock, where you can lock your Linux desktop and at the same time to display when application is running on your monitoring screen.

Lock Your Machine with xlock

First, install xlock in your Linux desktop


shell> sudo apt-get install xlock

After xlock has been install, create a file name lockscreen, chmod to 777 and paste the line below in the file


# /usr/bin/xlock -mode image -geometry 0x0 -timeout 1
shell> vi lockscreen
shell> chmod 755 lockscreen

xlock is screen saver lock, but it can disable the screen saver screen by setting display with “-geometry 0×0″.

You can also bind your keyboard short cut key to launch the lockscreen script through System > Preferences > Keyboard Shortcuts.

How to Enable Suidperl in FreeBSD

Enable Suidperl In FreeBSD

Due to security issues, by default Perl installation in FreeBSD does not compiles with SUIDPERL. There are 2 ways to enable SUIDPERL in FreeBSD.

First, it make it a “global” configuration in /etc/make.conf, so whenever there is port upgrade for Perl, it will compile with Suidperl. Edit the file /etc/make.conf and put ENABLE_SUIDPERL=true.

Second method and invoke ENABLE_SUIDPERL when run make command on Perl installation.


shell> cd /usr/ports/lang/perl
shell> make -DENABLE_SUIDPERL install

By default suidperl executable file is located at /usr/bin/suidperl, you might want to symlink to /usr/local/bin/suidperl


shell> ln -s /usr/bin/suidperl /usr/local/bin/suidperl