2010年11月7日星期日

Set Git Proxy


## Set a proxy for curl
$ export http_proxy="http://proxy.bupt.edu.cn:8080"
## Get the connect.c file and compile it
$ curl http://www.meadowy.org/~gotoh/ssh/connect.c > connect.c
$ gcc -o connect connect.c
## Write a bash file
$ cd ~/bin
$ vi http-proxy
    #!/bin/sh
    # FileName: http-proxy
    # This connects to an HTTP Proxy using connect.c
    connect -H http://proxy.bupt.edu.cn:8080 $@
$ chmod a+x http-proxy
## Run git config and you should change the name "kernel.org" to your interest site.
$ git config --global core.gitproxy "http-proxy for kernel.org"
## If your proxy needs an auth, write rc file for connect.
$ vi /etc/connectrc
    HTTP_PROXY_USER=useraccount
    HTTP_PROXY_PASSWORD=passwd

网络问题的检查 - Linux Network Check


One day, I encountered a problem that the STB had got the IP address, but it could not access the internet.
So, I decided to check the following:
1. DNS Configuration
cat /etc/resolv.conf

gateway 10.192.208.254
nameserver 10.194.128.15

2. Route Table

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0

You see, the Gateway was wrong. So, I used the command route to add a default gateway.
/sbin/route add default gw 192.168.1.1
3. Ping www.baidu.com. Ok. It worked.

2010年10月7日星期四

多个Gtalk实例同时运行

Gtalk是可以多实例运行的,方法如下:
1. 创建Gtalk的桌面快捷方式
2. 右键选择属性,选择快捷方式标签页
3. 修改Target一栏,如下:
"C:\Program Files\Google\Google Talk\googletalk.exe" /nomutex

2009年12月29日星期二

Public a git repository

Create an empty repository

$ mkdir Andcp_K29

$ cd Andcp_K29

$ git-init-db

Modify .git/info/exclude

$ echo "*.[oa]" >> exclude

$ echo ".svn" >> exclude

$ echo ".repo" >> exclude

Add files to repository

$ git add .

$ git commit -m "Initial repo for example"

Create a public repository

$ mkdir /var/www/html/Andcp_K29.git

$ GIT_DIR=Andcp_K29.git git-init-db

$ git push :/var/www/html/Andcp_K29.git

$ git-daemon --verbose --export-all --enable=receive-pack --base-path=/var/www/html/git &

Run Test

$ git clone git://127.0.0.1/Andcp_K29.git

OK!

2009年12月27日星期日

Config Android Proxy

$ adb shell
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite> INSERT INTO system VALUES(99,’http_proxy', 'wwwgate0.mot.com:1080');
sqlite> exit

2009年12月4日星期五

VLC RTSP Server Config

Step 1:
vlc --ttl 12 -vvv --color -I telnet --telnet-password video --rtsp-host 0.0.0.0:5554
Step 2:
telnet 127.0.0.1 4212
you'll see vlm, run command
>new test vod enabled
>setup test input my_video.mpg
Step 3:
vlc rtsp://127.0.0.1:5554/test

2009年4月20日星期一

ifconfig usage

ifconfig eth0 192.168.1.1/24 (IP Address / NetMask)
route add default gw 192.168.1.1 (Add gateway)
vim /etc/resolv.conf (Add DNS Server)