Archive

Posts Tagged ‘linux’

SVN : Preparing for branching/ Merging process

February 3, 2011 5 comments

Preparing your repository for branching and merging can turn into a headache when you do it for the first time. This is a small .. may be obvious .. note to everybody who can get some help

My setup

  • SVN Server hosted on linux
  • Tortoise SVN as client being used from windows

If you perform following checks before getting into the process of branching and merging, you are going to save a lot of time and efforts trying to figure out errors messages and causes

  1. Make sure your SVN Server version is above 1.5. If not, UPGRADE. In my case it was 1.4.2 and I upgraded it to 1.6.* from Collabnet
  2. Make sure your SVN Repository version is upgraded. You can find that out by using following commands
    cd /path/to/repo/reponame
    cd db
    cat format
    

    i.e. changing to repo/directory/db and looking at contents of format file. For 1.4.*, format file showed 2, which should be 4 for it to be a 1.6.* repository. I had to upgrade the repository version by using
    svnadmin upgrade path/to/repo/reponame
    
  3. Make sure your SVN Client is equipped to handle features offered by the upgraded SVN Server. I just downloaded version of tortoise svn made for 1.6 version

After these checks, you can choose the model you want to opt for your process and get started.

In my case, I chose mainline development happening in trunk, creating branches after each phase release. Every-time a bug is fixed in a branch, its committed to its corresponding branch. Then from trunk, using TortoiseSVN’s “reintegrate a branch” option, I choose repository URL of branch and follow through steps to finish the merge. It works wonders !

Related posts

Categories: Linux, SVN

linux: handy commands

March 18, 2009 Leave a comment
  1. copy files from one linux server to another through shell
    $ scp user@from_computer:dir/filename user@to_computer:dir/filename
  2. open shell to another linux machine from one through shell
    $ ssh user@to_computer
  3. Prints the owner of every file or directory in the current directory. The AWK syntax is simply “print the 3rd field in every line of data”
    ls -l | awk '{print $3}'
  4. To get the owner of only one file (filename):
    ls -l | grep filename | awk '{print $3}'
  5. To compress a folder:
    zip -r target.zip folder/
  6. User creation
    useradd username
  7. Change user password
    passwd username
  8. Add user to a group
    usermod -g grpname username
  9. Import SQL script to an empty mysql database
    mysql -u root -p database_name < script_file.sql
  10. Unfreeze vi editor in terminal window when frozen because of ctrl+S action
    press ctrl+q
  11. Reboot linux server remotely
    sudo reboot
  12. Shut down linux server remotely
    sudo shutdown -h now
  13. Kill a process
    top
    type k to kill a process. You will be prompted for the PID of the task, and the signal to send to it. For a normal kill, send signal 15. For a sure, but rather abrupt, kill, send signal 9. The default signal, as with kill(1), is 15, SIGTERM. This command is not available in secure mode.
    
  14. To close port – 80 in following example
    fuser -k 80/tcp
  15. To display linux distribution
    cat /etc/issue
Categories: Linux

linux how to: replicate svn repository

February 28, 2009 4 comments

Task at hand:

I have a repository on one of the linux server. As a part of upgradation process, we decided to move the SVN server to a newer better linux infrastructure. Task at hand is to replicate the svn repositories on new server.

Solution:

  1. Create dump for existing repository
    svnadmin dump /path/to/repo > /path/to/dump/folder/myrepo.dump

    This command creates a .dump file and shows the revisions being dumped as it progresses

  2. Transfer the dump file to new server. This can be accomplished through SSH / FTP connection or a simple scp command as:
  3. scp /path/to/dump/folder/myrepo.dump user@new_server:/path/to/dump/folder/myrepo.dump
  4. Log into new server and switch to the directory where you want to place your replicated svn repository. Then, create an empty svn repository
    svnadmin create myrepo
  5. Load empty reposity with dump file
    svnadmin load myrepo < /path/to/dump/folder/myrepo.dump
  6. Define group ownership and permission
    chown -R :all myrepo
    chmod -R 770 myrepo
    

Related posts

Categories: SVN

IIS SSL and linux openSSL

January 19, 2009 Leave a comment

I have a .NET web service that I want to be accessed over https rather than http. Problem is HOW !!

Solution:

  1. Activate SSL on web server (IIS)
  2. Specify the file for which SSL is required
    • Through inetmgr, browse to the file (in my case the .asmx file). Right click -> Properties -> File Security -> Secure Communications -> Edit
    • Check Require SSL Channel (SSL)
    • RequireSSL

And you should be done.

Related useful article:
CONSUMING WEBSERVICES OVER HTTPS (SSL)

Categories: IIS

How to make SVN remember password

December 6, 2008 11 comments

Who is this post for?

This post is for anyone who wants a step by step guide to accomplish any of the following

  1. Make a SVN client like tortoise svn remember password
  2. Make linux server remember your password when logging through putty

Tools you need:

  • Putty
  • Puttygen

What you need to do:

  1. Using putty – login to linux server. change directory to ~/.ssh/ by typing following command
    cd ~/.ssh
  2. Type command
    ssh-keygen -b 1024 -t dsa 

    and press enter. Do not enter a passphrase. Hit enter when prompted for one. Same for the filename. default filename = id_dsa and id_dsa.pub. id_dsa is the private key file and id_dsa.pub is the public key file.

  3. type command
    cat ~/.ssh/id_dsa.pub

    Copy the output to the clipboard by selecting the output by mouse.

  4. Type command
    vi ~/.ssh/authorized_keys

    Hit i to enter Insert mode and then paste your public key (if there is already a key in this file, move to the bottom before pasting). Hit the ESC key to leave Insert mode and type :wq and hit enter to save and exit vi editor.

  5. Using ftp download your key files – both private and public
  6. In order to use the private key we get from the server, we have to convert it to a putty format. This is because the private key file format is not specified by some standard body. We can accomplish this using puttygen. Open Puttygen
  7. In the tree structure on left, choose conversion -> import key -> choose the private key file downloaded from ftp
  8. Choose to save private key. Choose path and save the file as anything.ppk
  9. Run Putty. Specify parameters
    • Session->HostName: Hostname or IP Adress of your server
    • Session->Protocol: SSH
    • Session->Saved Sessions: MyConnection
    • SSH->Prefered SSH Protocol version: 2
    • SSH->Auth->Private Key file for auth: $PATH$mykey.PKK (replace $PATH$ with real path to the mykey.PKK file)
  10. Go back to Session tab and hit “save” button. You will see “MyConnection” in the list of available connections.
  11. Next click “open” and you should see a telnet login prompt. Use “myuser” as username (without double quotes of course) and if everything is OK, you don’t have to provide a password to your system. If the system still requires a password, something went wrong.
  12. Now that linux server and putty manage to remember your password, you need an application client to use it. In this case it is SVN client e.g. tortoise svn. Go to TortoiseSVN->RepoBrowser and specify a URL like this:
    svn+ssh://myuser@MyConnection/usr/local/repos

    …where MyConnection is the putty session name and /usr/local/repos is my svn repository on linux server

And you are done …

Related posts

Categories: Linux, SVN
Follow

Get every new post delivered to your Inbox.