Tuesday, July 23, 2013

Compile Vim and MC in Solaris 10 Sparc

If you don't have root privileges you can't install binary package vim and mc provided by sunfreeware.com etc. But if you have compiler (gcc) installed in your system, compiling is the only choice.

Here is my system:
> uname -a
SunOS myserver 5.10 Generic_144488-04 sun4u sparc SUNW,SPARC-Enterprise
> gcc -v
Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs
Configured with: /sfw10/builds/build/sfw10-patch/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
> mkdir -p $HOME/local

Friday, July 5, 2013

Asus N46VZ on Xubuntu 12.04 64 bit

1. Laptop randomly freeze.
It is because a problem in kernel 3.2 with Intel Ivy Bridge Integrated HD 4000 Graphics. It's fix by kernel 3.3, so please upgrade kernel to quantal or raring kernel.
$ sudo apt-get install linux-generic-lts-raring

2. Brightness key not works
Fn+F5 (BrightnessDown) and Fn+F6 (BrightnessUp) not works, it fix by add "acpi_osi=!Windows 2012" in kernel parameter:
$ vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="acpi_osi=\"!Windows 2012\""

3. Wireless key not works
Fn+Fn (Wireless Toggle) fix by adding following kernel parameter:
$ vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="pciehp.pciehp_force=1 pciehp.pciehp_poll=1 acpi_osi=\"!Windows 2012\""

4. Keyboard backlight key
Please use this tutorial. then add following line at the and of /etc/rc.local:
chmod 777 /sys/class/leds/asus::kbd_backlight/brightness

Add those scripts to Xfce keyboard shortcut in Setting Manager > Keyboard > Application Shortcuts:

5. Touchpad toggle not works
Use the following script then to to keyboard shortcut as step 4
~$ cat touchpad_toggle.sh 
#!/bin/bash
res=$(synclient -l | grep TouchpadOff | cut -d '=' -f2)
if [ $res -eq ' 0' ]; then
    synclient TouchpadOff=1
    kill -9 `pidof syndaemon`
elif [ ${res} -eq ' 1' ]; then
    synclient TouchpadOff=0
    syndaemon -i .4 -k -d
fi

syndaemon is for disable touchpad while typing.

6. Set "3 finger click as middle click" and "disable touchpad while typing" on auto startup apps.
Copy following script:
~$ cat touchpad_settings.sh 
#!/bin/bash
# 3 finger click as middle click
synclient TapButton3=2
synclient ClickFinger3=2

# disable touchpad while typing
kill -9 `pidof syndaemon`
syndaemon -i .4 -k -d

Then add in autostart applications in Xfce. Setting Manager > Session and Startup > Application Autostart

7. Install VGA Hybrid Driver using bumblebee

$ sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
$ sudo add-apt-repository ppa:bumblebee/stable
$ sudo apt-get update
$ sudo apt-get install bumblebee bumblebee-nvidia virtualgl linux-headers-generic-lts-raring

Reboot