星期二, 3月 13, 2012

My ubuntu (11.10 Oneiric) on ASUS U41S

I bought a laptop,ASUS U41S, and installed ubuntu 11.10 on it. But found out many issues and record how to fix it listed below. The solution are from my experiences, many links (googling) and references, just integrate all fixes here. Not sure can fit all people using ubuntu on asus.

1. Fan Speed control.
When I power on my laptop with Ubuntu, the fan speed always (or usually) make lots of noises. Then I find a way to make it being quieter, that's lm_sensors. (but maybe still need to refer to power consumption as item 2.)

- Install lm-sensors


2. power consumption (2.5 hrs to 6 hrs)

- Enable ACPI ASPM
edit /etc/default/grub and add pcie_aspm=force
update-grub

#The major eating-power-monster will be the nvidia and unity3D with compiz, so change to 2D first.
- About acpi_call
git clone http://github.com/mkottman/acpi_call.git
cd acpi_call
make
sudo insmod acpi_call.ko # first trying
--> then copy acpi_call.ko to /lib/module/... and depmod -a
./test_off.sh # you can use this script to find out your "parameter" of acpi_call to disable the nvidia h/w

*** build acpi_call in dkms format under 12.10 ***
apt-get install dkms
put acpi_call folder into /usr/src/acpi_call-0.1
modify Makefile and dkms.conf

Makefile
obj-m := acpi_call.o default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules clean: rm acpi_call.mod.o acpi_call.o acpi_call.ko
dkms.conf

PACKAGE_NAME="acpi_call"
PACKAGE_VERSION="0.1"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="acpi_call"
DEST_MODULE_NAME[0]="acpi_call"
MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir PWD=$dkms_tree/acpi_call/0.1/build"
DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
AUTOINSTALL="yes"

build dkms format
sudo dkms add -m acpi_call -v 0.1
sudo dkms build -m acpi_call -v 0.1
sudo dkms install -m acpi_call -v 0.1

(can check the status with "dkms status" command)
and here is the link for reference.
https://wiki.ubuntu.com/Kernel/Dev/DKMSPackaging
http://hybrid-graphics-linux.tuxfamily.org/index.php?title=Acpi_call

---- save these in /etc/rc.local -----
# remove nouveau for nvidia before X
modprobe -r nouveau
# Disable nvidia h/w
modprobe acpi_call
echo "\_SB.PCI0.PEG0.GFX0.DOFF" > /proc/acpi/call
#then reboot, you should have more than 5 hrs power consumption now.

3. Suspend issue (can't fix hibernate yet)
From the solution, looks like the issue caused by usb.
- add the contents below into /etc/pm/sleep.d/20_suspend and chmod to 755
#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug
# tidied by tqzzaa :)

VERSION=1.1
DEV_LIST=/tmp/usb-dev-list
DRIVERS_DIR=/sys/bus/pci/drivers
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
HEX="[[:xdigit:]]"
MAX_BIND_ATTEMPTS=2
BIND_WAIT=0.1

unbindDev() {
echo -n > $DEV_LIST 2>/dev/null
for driver in $DRIVERS; do
DDIR=$DRIVERS_DIR/${driver}_hcd
for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
echo -n "$dev" > $DDIR/unbind
echo "$driver $dev" >> $DEV_LIST
done
done
}

bindDev() {
if [ -s $DEV_LIST ]; then
while read driver dev; do
DDIR=$DRIVERS_DIR/${driver}_hcd
while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
echo -n "$dev" > $DDIR/bind
if [ ! -L "$DDIR/$dev" ]; then
sleep $BIND_WAIT
else
break
fi
MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
done
done < $DEV_LIST
fi
rm $DEV_LIST 2>/dev/null
}

case "$1" in
hibernate|suspend) unbindDev;;
resume|thaw) bindDev;;
esac

星期二, 2月 21, 2012

好玩的,一行列出99乘法表

echo $[{1..9}*{1..9}] | xargs -n9 | column -t

星期四, 1月 12, 2012

Why you cannot make your command or parameter complete by pushing TAB under Ubuntu

Just find out the package name for this function, and keep this info here in case forget this name.
*bash-completion

Who enable this function? The answer is bash script.

1. ~/.bashrc
2. /etc/profile

You can also check which package support this or program it by yourself.
/etc/bash_completion.d

星期一, 5月 09, 2011

Adobe Reader cht fontpack for Ubuntu

- Install adobereader 9 in s/w center
- download the fontpack from [1]
- unpack the fontpack and execute the INSTALL file
- Done

[1] ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.1/misc/

星期一, 7月 26, 2010

How to change the "indicator" default setting, like mail agent

There is no setting option in gconf-editor or panel properties.
But you can just use the file to change the preferred application.

- In /usr/share/indicators/messages/applications/ there are some files, like empathy/evolution/gwibber in my folder by default.
- You can add a "thunderbird" file.
- And add a line in it as "/usr/share/applications/thunderbird.desktop".
- Then~~~you will see the indicator show you "Mozilla Thunderbird" dynamically.

星期五, 7月 23, 2010

Enable/Calibrate touch screen on EeeTop ET1602 for Ubuntu 10.04 (Lucid)

Have a chance to port Lucid on the EeeTop machine. There are some problems in touchscreen and resolution, and here is how to fix it.

1. touchscreen
In Lucid, evdev is the default driver for X input devices, but it's not useful for this type machine. So you need to install the "evtouch" driver, the package name is "xserver-xorg-input-evtouch".

aptitude install xserver-xorg-input-evtouch

Then you need to modify the default xorg.conf (create a new one under /etc/X11/), and below is the details.

--------------------------
Section "ServerLayout"
Identifier "Default Serverlayout"
Screen 0 "Default Screen" 0 0
InputDevice "Touch0"
EndSection


Section "Device"
Identifier "Configured Video Device"
Driver "intel"
Option "monitor-VGA" "VGA"
Option "monitor-VGA1" "VGA1"
Option "NoDCC"
Option "FramebufferCompression" "off"
EndSection


Section "InputDevice"
Identifier "Touch0"
Driver "evtouch"
Option "device" "/dev/input/evtouch"
Option "MinX" "1"
Option "MinY" "1"
Option "MaxX" "4096"
Option "MaxY" "4096"
Option "ReportingMode" "Raw"
Option "Emulate3Buttons" "false"
Option "Emulate3Timeout" "50"
Option "SendCoreEvents" "on"
Option "MoveLimit" "0"
EndSection

Section "Monitor"
Identifier "VGA"
ModeLine "1366x768" 85.600 1366 1430 1542 1798 768 771 777 795 +hsync +vsync
EndSection

Section "Monitor"
Identifier "VGA1"
ModeLine "1366x768" 85.600 1366 1430 1542 1798 768 771 777 795 +hsync +vsync
EndSection

Section "Monitor"
Identifier "Configured Monitor"
ModeLine "1366x768" 85.600 1366 1430 1542 1798 768 771 777 795 +hsync +vsync
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
Subsection "Display"
Modes "1366x768"
EndSubsection
EndSection

--------------------------

And also need to add "69-touchscreen.rules" udev rule under /etc/udev/rules.d
notes: check sysfs by the command
udevadm info -ap /sys/class/input/event8

--------------------------
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="1bfd", ATTRS{idProduct}=="1688", SYMLINK+="input/evtouch"
--------------------------

BTW, explain how I have the right "ModeLine" parameters here.
We can use the "PowerStrip" tool (Windows tool) to have the values.
Below is the link to teach you how to get the right values by PowerStrip.

http://www.x.org/wiki/FAQVideoModes#ObtainingmodelinesfromWindowsprogramPowerStrip

星期一, 3月 15, 2010

Some Linux tips

1. share the shell screen
user a# screen -S test
user b# screen -x test
then both a and b can use the shared shell screen to watch the status.

2. how to show your IP address (a little boring and stupid...^^)
ifconfig | grep "eth0" -A 1|sed '1d'|awk '{print $2}'|awk -F: '{print $2}'

3. how to show your VGA driver name (still need to see /var/log/Xorg.0.log for details)
lspci -v|grep VGA -A 10|grep modules

4. How to clean all gnome panel applet default settings
gconftool-2 --recursive-unset /apps/panel
kill gnome-panel --> it will make gnome-panel refresh again.

-- Need to maintain ---