jejer@wordpress Anything Worth Doing is Worth Doing Well

10Apr/11Off

ubuntu10.10启用thinkpad小红点(trackpoint)的中键滚动功能

来自网络

新建文件20-thinkpad.conf并编辑:
sudo gedit /usr/share/X11/xorg.conf.d/20-thinkpad.conf
填入:
Section "InputClass"
	Identifier "Trackpoint Wheel Emulation"
	MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint"
	MatchDevicePath "/dev/input/event*"
	Option "EmulateWheel" "true"
	Option "EmulateWheelButton" "2"
	Option "Emulate3Buttons" "false"
	Option "XAxisMapping" "6 7"
	Option "YAxisMapping" "4 5"
EndSection

保存重启X11即可 快捷键 右ALT+PrintScreen+K (注意保存桌面工作)

15Mar/10Off

在ubuntu上实施西厢计划

准备:在ubuntu software center安装

  • autoconf
  • automake
  • libtool
  • iptables dev

终端执行 sudo passwd root 给root设置密码后su切换到root

安装

  • 解压缩 tar -xf 下载下来的tar
  • ./autogen.sh
  • CFLAGS="-O3" ./configure --prefix=/usr
  • make
  • make install

配置

  • 进到extensions目录 cp *.so /lib/xtables
# cd examples
# ipset -R < YOUTUBE
# ipset -R < GOOGLE
# ipset -R < NOCLIP
# iptables -A INPUT -p tcp --sport 80 --tcp-flags FIN,SYN,RST,ACK SYN,ACK -m state --state ESTABLISHED -m set --match-set NOCLIP src -j ZHANG
# iptables -A INPUT -p tcp --sport 80 -m state --state ESTABLISHED -m gfw -j LOG --log-level info --log-prefix "gfw: "
# iptables -A INPUT -p udp --sport 53 -m state --state ESTABLISHED -m gfw -j DROP
# echo nameserver 8.8.8.8 > /etc/resolv.conf

丢弃GFW包by marvelliu iptables -I INPUT -p tcp --sport 80 -m state --state ESTABLISHED -m gfw  -j DROP 

嗯,但是我测试失败了. 不知道是不是和linksys无线路由器有关,tomato的固件.
丢掉gfw包也不行

终端测试结果:
jejer@jejer-laptop:~$ nslookup youtube.com
Server:        8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:    youtube.com
Address: 74.125.45.100
Name:    youtube.com
Address: 74.125.67.100
Name:    youtube.com
Address: 74.125.127.100

jejer@jejer-laptop:~$ ping youtube.com
PING youtube.com (74.125.45.100) 56(84) bytes of data.
64 bytes from yx-in-f100.1e100.net (74.125.45.100): icmp_seq=1 ttl=42 time=336 ms
64 bytes from yx-in-f100.1e100.net (74.125.45.100): icmp_seq=2 ttl=42 time=336 ms
64 bytes from yx-in-f100.1e100.net (74.125.45.100): icmp_seq=4 ttl=42 time=339 ms
64 bytes from yx-in-f100.1e100.net (74.125.45.100): icmp_seq=5 ttl=42 time=336 ms
64 bytes from yx-in-f100.1e100.net (74.125.45.100): icmp_seq=6 ttl=42 time=336 ms
^C
--- youtube.com ping statistics ---
6 packets transmitted, 5 received, 16% packet loss, time 5011ms
rtt min/avg/max/mdev = 336.119/336.838/339.027/1.158 ms