Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, November 23, 2009

Change Proxy Settings on linux using shell commands

You can change the proxy settings for current session by executing following command. Which changes the environment variable "http_proxy". If you want, you can do it for ftp as well (ftp_proxy).
export http_proxy="http://NewProxy_address:Port"

Assume my proxy run on 192.168.0.1 machine on port 808, then this settings will be
export http_proxy="http://192.168.0.1:808"

Personal Experience


Recently, I installed Ubuntu server 8.04 and while the installation I set proxy settings wrong manner. In that case, installation guide give the format of "http://[[[user]:[passowrd]@serverIP]:[port]]" to enter proxy settings. Since I was using my proxy server in a windows machine, I had problem of giving username@server:port format. I gave it http://janaka@192.168.0.1:808, but it is only necessary to give http://192.168.0.1:808. So I needed to permanently change it. If you only used above command, it will not be there when you reboot the linux os. Because it is just changing the current environmental variable "http_proxy".
Using following changes you could permanently change the settings.
If you wanted to add it for any user add export http_proxy="http://192.168.0.1:808" on ~/.bashrc file.
 vi ~/.bashrc

If you want to do it for current user, add export http_proxy="http://192.168.0.1:808" on /etc/rc.local.
vi /etc/rc.local
The File will look like below.
And then change the execution bit to execute this script while loading.
chmod u+x /etc/rc.local

Now it should be working.

Sunday, November 15, 2009

Windows TortoiseGit client for a linux Gitosis server

Tortoise git is really nice Graphical tool to handle git repository. You need to download TortoiseGit from here. First of all as we discussed earlier you need to install msysgit first. Then install the Tortoisegit and install it. While installing it Select open ssh client option for authentication method.
And completely install it and restart your computer. First of all you should add the msysgit path for this system. Tortoisegit gets the git options from msysgit. Right click on your desktop and go to settings,Set the path to the bin of the msysgit. Now setting your authentication on the server should be set. For that TortoiseGit has shipped putty Keygen for generate keys. But in this case, since we are connecting with a linux server the private keys which generate by putty key gen won't be recognize by the server. Since that you will not recognized correctly at the server end. To avoid this inconvenience you can create ssh keys through ssh-keygen. On your command prompt.

Do not use puttyGen in this case to create key pairs.

Go to your account on the windows os(i.e. C:\Documents and Settings\Janaka), check whether there is a folder called ".ssh" if not, create it using command prompts "mkdir .ssh" command. This is the place we keep your key pairs. keys you generated (id_rsa.pub, id_rsa) copy to this folder. Now follow the usual users adding mechanism on git server.Click here for more info.
Now you can go to any location on your computer and right click select option git clone... or git zync you will receive following screen. Put the remote URL as to your git repository. git@192.168.4.90:my_first_repo It will import the repository to your local folder. Like wise all the operations can be done through GUI. You don't have to type git commands on doing this.
Any comments........???