解决T400在linux下无法待机的问题

这个问题并不是一直存在的,当我从Hardy转战到Arch的时候,突然发现不能suspend了。与其说不能suspend,更准确的说法是成功suspend之后无法唤醒。log一切正常,但屏幕只有黑色的底和一个不能移动的鼠标。若干次试验之后可以确认是xf86-video-intel引起的,但迟迟没有找到解决办法。

今天似乎人品有点爆发,在网上看无关贴的时候看到了这个这个。一试发现果然可以。

#!/bin/sh
# Workaround for concurrency bug in xserver-xorg-video-intel 2:2.4.1-1ubuntu10.
# Save this as /etc/pm/sleep.d/00CPU
# chmod 755

. “${PM_FUNCTIONS}”

case “$1” in
hibernate|suspend)
for i in /sys/devices/system/cpu/cpu*/online ; do
echo 0 >$i
done
;;
thaw|resume)
sleep 10 # run with one core for 10 secs
for i in /sys/devices/system/cpu/cpu*/online ; do
echo 1 >$i
done
;;
*)
;;
esac

fix suspend in ubuntu

My ubuntu freezes a few seconds after resume after a second suspend(not the first suspend, i donna know why). Deeply research in the problem, i find it is caused by wireless driver iwl4965.

$ vim /etc/pm/sleep.d/01iwl4965

#!/bin/bash
case $1 in
hibernate)
rmmod iwl4965;
;;
suspend)
rmmod iwl4965;
;;
thaw)
modprobe iwl4965;
;;
resume)
modprobe iwl4965;
;;
*)
;;
esac

ref: http://en.opensuse.org/Pm-utils

Alt + SysRq + ?

B: Immediately reboot the system, without unmounting partitions or syncing
R: Switch the keyboard from raw mode, the mode used by programs such as X11 and svgalib, to XLATE mode
S: Sync all mounted filesystems

Sync Win Mobile 6.1 With Ubuntu

Three Steps:

Install SynCE:
http://www.synce.org/moin/SynceWithUbuntu

Setup SynCE:
http://www.synce.org/moin/SynceSetup/SyncEngine

Setup OpenSync:
http://www.synce.org/moin/SynceSetup/OpenSync

一些安装笔记:
1. python-opensync要降级,默认是3.6,会出现segment fault
2. 每次要先开 synce-sync-engine, 再用synce-create-partnership “sKh Ubuntu” “Contacts,Calendar,Tasks”新建一个通话(不明原因),再用msynctool –sync synce-sync即可同步
3. 可以同步Contacts,Calendar,Tasks,Files

conky配置备份

截图如下:

.conkyrc代码

# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# – tail of /var/log/messages
# – netstat connections to your computer
#
#

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
#xftfont Lucida Sans Typewriter:size=8
xftfont Manaco:size=10
xftalpha 0.8

# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_hints undecorated,below,skip_taskbar
#background no
background yes

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 1.0

# Minimum size of text area
minimum_size 280 5

maximum_width 400

# Draw shades?
draw_shades yes

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no

uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color white

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 160
gap_y 10

# stuff after ‘TEXT’ will be formatted on screen

override_utf8_locale no

# Possible variables to be used:
# http://conky.sourceforge.net/variables.html

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
# stuff after ‘TEXT’ will be formatted on screen
#${font Grunge:size=12}${time %a %b %d}${alignr -25}${time %k:%M}

TEXT
${color #42AE4A}${alignc}$sysname $kernel $machine – $nodename
${color }${alignc}${time %a, %e %B %G, %H:%M:%S}
${color orange}CPU ${hr 2}$color
${color #42AE4A}UpTime: ${color }$uptime${alignr}${color #42AE4A}Load: ${color }$loadavg
${color #42AE4A}Intel(R) Core(TM)2 Duo CPU P8400 ${color }${freq_dyn_g}GHz
${color #42AE4A}Processes: ${color }$processes ${color #42AE4A}Running: ${color }$running_processes ${color #42AE4A}Temp: ${color }${acpitemp} C
${color #42AE4A}CPU Core 1:${color } ${cpu cpu0}%${alignr}${color #42AE4A}CPU Core 2: ${color } ${cpu cpu1}%
${color #42AE4A}${cpugraph cpu0 20,135 42AE4A eeeeee}${alignr}${cpugraph cpu1 20,135 42AE4A eeeeee}
${color #42AE4A}Highest CPU: ${alignr}PID CPU% MEM%
${color #ddaa00} ${top name 1}${alignr}${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2}${alignr}${top pid 2} ${top cpu 2} ${top mem 2}
${color lightgrey} ${top name 3}${alignr}${top pid 3} ${top cpu 3} ${top mem 3}
${color lightgrey} ${top name 4}${alignr}${top pid 4} ${top cpu 4} ${top mem 4}
${color #42AE4A}Highest MEM: ${alignr}PID CPU% MEM%
${color #ddaa00} ${top_mem name 1}${alignr}${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color lightgrey} ${top_mem name 2}${alignr}${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${color lightgrey} ${top_mem name 3}${alignr}${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color lightgrey} ${top_mem name 4}${alignr}${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${color orange}BATTERY ${hr 2}$color
${color #42AE4A}$battery ${color }$battery_time $alignr $battery_percent%
${color #42AE4A}$battery_bar
${color orange}MEMORY/DISK ${hr 2}$color
${color #42AE4A}MEM ${color } $alignc$mem / $memmax $alignr $memperc%
${color #42AE4A}$membar
${color #42AE4A}/ ${color } $alignc${fs_used /} / ${fs_size /} $alignr ${fs_free_perc /}%
${color #42AE4A}${fs_bar /}
${color #42AE4A}/home $alignc ${color }${fs_used /home} / ${fs_size /home} $alignr ${fs_free_perc /home}%
${color #42AE4A}${fs_bar /home}
${color #42AE4A}swap $alignc ${color }$swap / $swapmax $alignr $swapperc%
${color #42AE4A}${swapbar}
${color orange}NETWORK (${addr wlan0}) ${hr 2}$color
${color #42AE4A}ESSID: ${color }${wireless_essid wlan0}${color }${alignc} ${wireless_bitrate wlan0} $alignr ${wireless_link_qual_perc wlan0}%
${color #42AE4A}${wireless_link_bar wlan0}
${color #42AE4A}Down:${color lightgrey} ${downspeed wlan0} k/s $alignr${color #42AE4A} Up:${color lightgrey} ${upspeed wlan0} k/s
${color #42AE4A}${downspeedgraph wlan0 20,135 42AE4A eeeeee 150} $alignr${color #42AE4A}${upspeedgraph wlan0 20,135 42AE4A eeeeee 50}
${color #42AE4A}Total: ${color lightgrey}${totaldown wlan0}$alignr${color #42AE4A}Total: ${color lightgrey}${totalup wlan0}
${color #42AE4A}Inbound: ${color lightgrey}${tcp_portmon 1 32767 count} ${color #42AE4A}Outbound: ${color lightgrey}${tcp_portmon 32768 61000 count}${alignr}${color #42AE4A}Total: ${color lightgrey}${tcp_portmon 1 65535 count}
${color #42AE4A}Connections ${alignr} Local Service/Port${color lightgrey}
${tcp_portmon 1 61000 rhost 0} ${alignr} ${tcp_portmon 1 61000 rservice 0}
${tcp_portmon 1 61000 rhost 1} ${alignr} ${tcp_portmon 1 61000 rservice 1}
${tcp_portmon 1 61000 rhost 2} ${alignr} ${tcp_portmon 1 61000 rservice 2}
${tcp_portmon 1 61000 rhost 3} ${alignr} ${tcp_portmon 1 61000 rservice 3}
${tcp_portmon 1 61000 rhost 4} ${alignr} ${tcp_portmon 1 61000 rservice 4}
${tcp_portmon 1 61000 rhost 5} ${alignr} ${tcp_portmon 1 61000 rservice 5}
${color orange}SYSTEM LOGS${hr 2}$color
${execi 10 /usr/bin/tail -n 4 /var/log/messages | cut -c 27-}