Thursday, October 16, 2008

subversion

[QUICK REF]

svn import -m "initial import" module svn+ssh://user@server/home/svn/repos/module/

svn co svn+ssh://user@server/home/svn/repos/module/ module

Refer this article to install subversion on Ubuntu and set up Apache to get web access to the repository. Following is a summary of the commands.
(using aptitude is better than apt-get because the former keeps a track of dependencies during uninstall time, and records a log)

installing subversion
sudo apt-get update
sudo apt-get install subversion

creating the repository
cd /var
sudo mkdir svn
sudo svnadmin create /var/svn/repos

add svn as a user
sudo adduser svn
sudo chown -R svn.svn svn

let a user access svn (add to svn group)
sudo vigr
admin:x:110:user_name
svn:x:1001:user_name

SSH access
sudo apt-get install openssh-server
svn co svn+ssh://username@machinename/var/svn/repos

chmod 0700 .ssh
chmod 0600 .ssh/authorized_keys2

Set up Apache Web Access to the repository
sudo apt-get install libapache2-svn
cd /etc/apache2/sites-enabled
sudo vi 000-default

<Location /svn> 
DAV svn
SVNPath /var/svn/repos
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/passwords
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
<Location\>   
sudo /etc/init.d/apache2 force-reload

Add the following to the Location directive above to secure the repository.
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/passwords
Require valid-user

set up BASIC authentication as follows.
sudo htpasswd -cb /etc/apache2/passwords USERNAME PASSWD

sudo /etc/init.d/apache2 force-reload

To see whats on SVN do a list:
svn list svn+ssh://user@server/home/svn/repos

Tortoise SVN
This tool provides a shell script in Windows explorer so that we can easily
checkout, import, or update a folder with an SVN repository in a remote machine.
I will describe how to use Tortoise with svn+ssh on Windows using Putty.

download and install tortoise from here.
http://tortoisesvn.tigris.org/
Installation is fairly simple. Requires a restart on Xp after installation.
Create a tunnel using putty.
First create a key using putty keygen. You can either convert an existing private
key or create a private/public key pair from the scratch by doodling some random
movements. Now load the private key by double clicking. This should load they key
to putty agent and the agent should appear as an icon in the Windows system tray.
Now open putty and create an SSH connection to the remote server as follows:
Give the HOST name (alternatively the IP), specify a name in the saved sessions box,
in the connection->Data provide your username in the "Auto-login username".
Now save the session, load it and open it. Now right click on any windows explorer
window (in a directory) and in the pop-up menu select TortoiseSVN->Repo-broweser and
type the following the url box:
svn+ssh://username@server/home/svn/repos

This will show you all the modules uploaded to the SVN server.
If you are in Linux, then when you try to use svn+ssh then it will always ask you to
type your password. To avoid doing this add your id_dsa.pub and/or id_rsa.pub public
keys to authorized_keys and authorized_keys2 files by doing
cat id_rsa.pub >> authorized_keys2


No comments:

Post a Comment

Continuously monitor GPU usage

 For nvidia GPUs do the follwing: nvidia-smi -l 1