Prathmesh Kallurkar


  • Home
  • Academia
  • Research
  • Publications
  • Resume
  • Random
  • Personal
  • Contact




  1. Proxy sharing using SSH tunelling
  2. Using multiple versions of gcc at the same time
  3. Setting up wifi in Dell Laptop for Ubuntu 11.04/10
  4. Using GNU screen to run your programs on server
  5. Using Skype behind proxy
  6. Connecting qemu guest to real network using bridge

Proxy Sharing Using SSH Tunelling

Many a times, we are working on internet behind a proxy server and have download limit that expires faster than we expect/want it to.
Students generally resort to sharing proxy passwords among themselves. While this is ok, it creates a lot of security and other problems.
Here is a way for a student to access another's proxy without sharing the password.
 
Consider a scenario where personA is connected to proxy and personB wants to connect to it using personA's connection.
Since A is logged into the proxy, http, https, ftp and socks connection to proxy-server must be available on local port.
We will consider a scenario for http_proxy of IIT Delhi.
The proxy-server's ip is 10.10.78.62 and the http_proxy is available on port 3128.  Lets call them proxy_server and http_port respectively
 
At A :
  1.   Connect to Proxy
At B:
  1. ssh -L $my_http_port:$proxy_server:$http_port userA@userA_IP
  2. Cool. Proxy tunnel has been setup for http.
  3. Point your firefox to use the port $my_http_port on localhost for http_proxy.
You are done.
The funda behind this is :
At B, you are mapping a localport 19000(any unused port should work) to point to 10.10.78.62's (proxy ip) 3128 port (http) using userA@userA_IP as an intermediate.

Using multiple versions of gcc at the same time

Chances are that many programs compiled for gcc 4.6 may not work for gcc 4.7.
Hence you must keep both and at the same time make the link to gcc4.7 vary according to the situation.
You can edit your gcc file to be a shell script :
#!/bin/sh
if [ -n "$GCC_SIX" ];
then
  exec
/usr/bin /gcc-4.6 "$@"
else
  exec
/usr/bin/gcc-4.7 "$@"
fi
Now, whenever you find a program not working on gcc4.7 just set an environment variable and you have switched to gcc4.6

for the current execution. Notice that for a multi-user system, this can prove to be a life saver.


Setting up wifi in Dell Laptop for Ubuntu 11.04/10
To be added later.

Using GNU screen to run your programs on server
To be added later.

Using Skype behind proxy
To be added later.

Connecting qemu guest to real network using bridge

There are literally dozen or more methods available on the internet for bridging qemu guest to the real network.
But sadly, most of them are too complicated or too stupid to work.
Below are simple steps for bridging a qemu guest to the host network.
  1. Release ip address on the host (dhcpcd -k eth0)
  2. Make sure eth0 is refreshed (ip link set eth0 down) (ip link set eth0 up)
  3. Create a bridge (brctl addbr bridge)
  4. Connect eth0 to bridge (brctl addif bridge eth0)
  5. Start ip-stack on bridge. (dhcpcd -n bridge)

Now, when qemu uses tap device, we should attach this device to bridge.
Add this line to /etc/qemu-ifup
brctl addif bridge $1
Here $1 is the name of the tap device that qemu uses for guest

When the guest is powered off, qemu should remove the interface of tap device from bridge.
Add this line to /etc/qemu-ifdown
brctl delif bridge $1

For connecting qemu guest to the bridge, just tell qemu to configure guest's network using the tap device.
sudo qemu-system-i386 -enable-kvm -net tap,vlan=0,ifname=tap0 -net nic,vlan=0 -hda ~/Data/OS_DiskImages/ubuntu11.10/disk.qcow2

Here  is a link to all the three scripts.
  1. Starting bridge
  2. qemu-ifup script
  3. qemu-ifdown script

© 2012 Prathmesh      Design by styleshout

CSS | XHTML | Home | Sitemap | RSS Feed