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.