存档

2010年9月 的存档

change linux swap size

2010年9月25日 评论已被关闭
cat /proc/swaps
free -m
dd if=/dev/zero of=swapfile bs=1M count=8192
swapoff -a
mkswap swapfile
swapon swapfile
cat /etc/fstab
/usr/swapfile swap    swap    defaults        0       0
分类: linux 标签:

推荐几个milestone可用的工具

2010年9月14日 评论已被关闭

com.handcent.nextsms-1.apk   send chinese sms

FMRadio_milestone.apk           FMRadio for milestone 

 

分类: live 标签:

use openvpn client in ubuntu

2010年9月10日 评论已被关闭

#install openvpn and resovconf
$sudo apt-get install openvpn
$sudo apt-get install resovconf

$sudo cat client.conf.mytest
client
;dev tap
dev tun
;dev-node MyTap
proto tcp
;proto udp
remote your-vpn-domain 1001
remote your-vpn-domain 1002
remote-random
resolv-retry infinite
nobind
;user nobody
;group nogroup
persist-key
persist-tun
;http-proxy-retry # retry on connection failures
;http-proxy [proxy server] [proxy port #]
;mute-replay-warnings
ca /home/2hei.net/.vpn/ca.crt
cert /home/2hei.net/.vpn/client.crt
key /home/2hei.net/.vpn/client.key
ns-cert-type server
;tls-auth ta.key 1
;cipher x
comp-lzo
verb 3
;mute 20
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

#start openvpn
$sudo openvpn –script-security 3 –config /home/2hei.net/.vpn/client.conf.mytest

分类: OpenSource 标签:

a script of awk array – just mark

2010年9月6日 评论已被关闭

Just mark it. 🙂

#!/bin/sh
awk -F”_t_7_Y_” ‘{if($1==1) {printf $2; for(i=3;i<=NF;i++) if(i==NF) print $i;else printf $i}}’ temp1  > 1.txt
awk -F”_t_7_Y_” ‘{if($1==2) if($2 in S22){S22[$2]=$2;S23[$2]=$3″ “S23[$2];N2[$2]++}else {S22[$2]=$2;S23[$2]=$3;N2[$2]=1;} if($1==3) if($2 in S32){S32[$2]=$2;S33[$2]=$3″ “S33[$2];N3[$2]++}else {S32[$2]=$2;S33[$2]=$3;N3[$2]=1;} if($1==4) if($2 in S42){S42[$2]=$2;S43[$2]=$3″ “S43[$2];N4[$2]++}else {S42[$2]=$2;S43[$2]=$3;N4[$2]=1;} }END{for(i in S22) print S22[i],N2[i],S23[i]>>”2.txt”;for(i in S32) print S32[i],N3[i],S33[i]>>”3.txt”; for(i in S42) print S42[i],N4[i],S43[i]>>”4.txt”;}‘ temp1

awk ‘NR==FNR {for(i=2;i<=NF;i++) S[$1]=S[$1]” “$i;}NR>FNR{print $0” “S[$1]}’ 2.txt 1.txt > t1.txt
awk ‘NR==FNR {for(i=2;i<=NF;i++) S[$1]=S[$1]” “$i;}NR>FNR{print $0” “S[$1]}’ 3.txt t1.txt > t2.txt
awk ‘NR==FNR {for(i=2;i<=NF;i++) S[$1]=S[$1]” “$i;}NR>FNR{print $0” “S[$1]}’ 4.txt t2.txt > final.txt

分类: shell 标签: