CREATING SSH KEY PAIRS

Creating ssh key pairs is very important specially when you are working on a opensource project.If your SSH server is visible over the Internet, you should use public key authentication instead of passwords if at all possible.

With public key authentication, every computer has a public and a private “key” (a large number with particular mathematical properties). The private key is kept on the computer you log in from, while the public key is stored on the .ssh/authorized_keys file on all the computers you want to log in to. When you log in to a computer, the SSH server uses the public key to “lock” messages in a way that can only be “unlocked” by your private key – this means that even the most resourceful attacker can’t snoop on, or interfere with, your session. As an extra security measure, most SSH programs store the private key in a passphrase-protected format, so that if your computer is stolen or broken in to, you should have enough time to disable your old public key before they break the passphrase and start using your key. Wikipedia has a more detailed explanation of how keys work

STEPS FOR CREATING SSH KEY PAIRS :
  • First decide if you will be using SSH1 or SSH2 (or both). Most likely you’ll want to stick with SSH1 (until OpenSSH is installed at PPPL, or until SSH2 is installed, etc).
  • To generate public/private keypair for SSH1: 

        $ ssh-keygen       This will generate ~/.ssh/identity and ~/.ssh/identity.pub.

  • Do this on each machine you want to access (to/from) using ssh (only need to do this once on the PPPL unix cluster)
  • Take all of the identity.pub files (which contain a public key on one line) and create an ~/.ssh/authorized_keys file by placing the contents of each separate identity.pub file on a single line of the ~/.ssh/authorized_keys file (then place on all sshable hosts).
  • For SSH2, use ssh-keygen -t {rsa,dsa} (you choose between rsa keys or dsa keys, currently I use DSA), which will generate ~/.ssh/id_{dsa,rsa} and ~/.ssh/id_{dsa,rsa}.pub.
  • Follow instructions for SSH1 keys, but instead generate a ~/.ssh/authorized_keys2 file using the id_{dsa,rsa}.pub files.

INTRODUCING MERCURIAL

INTRODUCTION

I came across one more version control system when I started contributing to Mozilla Firefox.Mercurial is a cross-platform, distributed revision control tool for software developers. It is mainly implemented using the Python programming language, but includes a binary diff implementation written in C. It is supported on Windows and Unix-like systems, such as FreeBSD, Mac OS X and Linux. Mercurial is primarily a command line program but graphical user interface extensions are available.

INSTALLING MERCURIAL IN LINUX

$ sudo apt-get install mercurial

BASICS

CREATING A REPOSITORY

$ mkdir hg1
$ cd hg1
$ hg init

ADDING FILE

$ hg add <file-name>

REMOVING FILE

$ hg rm <file-name>

The following command removes the added file

$ hg addremove <file-name>

RENAMING FILE/DIRECTORY

$ hg rename <file/directory>

SHOW STATUS

$ hg status

SHOW REVISION HISTORY

$ hg log

CLONING A REPOSITORY

For example for cloning a small “hello, world” repository hosted at testingmercurial.com:

$ hg clone http://www.testingmercurial.com/repo/hello my-hello

MERGING

$ hg merge <url of repo>

COMMIT

$ hg commit -m “commit-message”

PUSHING YOUR BRANCH TO ANOTHER REPOSITORY

$ hg push <url of the repo>

PULLING CHANGES FORM A REPOSITORY

$ hg pull <url of the repo>

If you are satisfied with the changes you pull then merge it using

$ hg merge

$ hg commit -m “merged”

This is just the basics of mercurial for more information I would suggest to read some mercurial tutorials.One you can find here http://mercurial.selenic.com/wiki/Tutorial also many good books are available just  google it!So go ahead enjoy playing with mercurial.Cheers  🙂

Introducing Bazaar(vcs)

When I started contributing to Ubuntu on launchpad.I came across a version control system popularly used by launchpad developers.It is very easy to use and is flexible and I am going to share some of the basics with  you all 🙂

INTRODUCTION

Bazaar is a distributed revision control system sponsored by Canonical.It is written in Python programming language.

Bazaar give us the ability to track changes for a directory by turning it into something slightly more complicated than a directory that we call a branch. The branch not only stores how the directory looks right now, but also how it looked at various points in the past. Then, when we do something we wish we hadn’t, we can restore the directory to the way it looked at some point in the past.Version control systems give users the ability to save changes to a branch by “committing a revision“. The revision created is essentially a summary of the changes that were made since the last time the tree was saved.

INSTALLING BAZAAR

$sudo apt-get install bzr

Setting an email address via bzr whoami.

For setting a global identity, use

$bzr whoami “Your Name <email@example.com>”

For using a different address for a specific branch, enter the branch folder and use:

$ bzr whoami –branch “Your Name <email@example.com>”
Setting the email address in the ~/.bazaar/bazaar.conf  by adding the following lines.Note that
[DEFAULT] is case sensitive:
[DEFAULT]
email=Your Name <email@isp.com>

CREATING A REPO

$bzr init-repo <repo-name>

CREATING A BRANCH

$bzr init <branch-name>

ADDING FILES

  • Adding all files:

$bzr add

  • Adding a particular file:

$bzr add <filename>

COMMITTING CHANGES

$bzr commit -m “commit-message”

SOME USEFUL BAZAAR COMMANDS

$bzr status     # tells the changes made to the working directory since last revision.

$bzr diff        # shows the full text of changes to all files as a standard unified diff. This can be piped through many
programs such as ‘’patch’‘, ‘’diffstat’‘, ‘’filterdiff” and ‘’colordiff’‘

$bzr log        # shows the history of the branch by browsing its log

UPDATING BRANCH

$bzr merge <url of repo>

then commit changes if you are satisfied with it using

$bzr commit “merged”

PUSHING YOUR BRANCH TO OTHER REPO

$bzr push <url of repo>

Install VirtualBox 4.1 on Ubuntu 11.10 Oneiric Ocelot

VirtualBox is a virtualization application that can help you run any x86 and AMD64/Intel64 compatible operating system on host machine. VirtualBox runs on Windows, Linux, Macintosh, and Solaris hosts and supports a lot of guest operating systems such as (not limited to) Windows NT 4.0, 2000, XP, Server 2003, Vista, Windows 7, DOS/Windows 3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, OS/2, and OpenBSD. VirtualBox 4.1.4 is now available for Ubuntu 11.10 Oneiric Ocelot.

Adding VirtualBox repository:

Installing VirtualBox 4.1:

  • sudo apt-get install virtualbox-4.1

If you want USB 2.0, VirtualBox RDP and PXE boot for Intel cards support on your guest machines, you have to install extension pack that can be downloaded here.

Installing extension pack
Once extension pack downloaded, open VirtualBox and navigate to “File -> Preferences”, at the “Extensions” section, click icon “Add package” and locate your downloaded extension pack.

And then follow on-screen instructions.

Ubuntu Installation

Downloading Ubuntu Desktop Edition:

  1. Using your web browser, navigate to http://www.ubuntu.com/getubuntu/download
  2. Select the architecture of your processor (32 or 64 bit).
  3. Click “Start download”. A pop up window opens, prompting you where to run or save the file.
  4. In Internet Explorer, click Run to automatically open the installation file in a CD burning utility or click Save to save the file to your disk. In Mozilla Firefox, select Open with to open the installation file in a CD burning utility or select Save File to save the file to your disk.

After downloading the Ubuntu installation CD image, you need to burn it to a CD or DVD. See BurningIsoHowto for detailed instructions on burning ISO disk images.

Burning the installation disk to a CD or DVD:

  1. Place a recordable CD or DVD into your CD/DVD drive.
  2. Load an application that is capable of burning .ISO image files to CDs or DVDs.
  3. Using your CD and DVD writing program, copy the disk image to your blank CD or DVD.

Installing Ubuntu

Ubuntu can be installed with the graphical CD. Make sure that your computer is set to boot from a CD before a hard drive.

  1. Insert the Ubuntu disc into your CD drive.
  2. Start or restart your computer. The Language screen appears. If you reboot your computer and do not see the language selection screen (seen below without the option to try without installing), please refer to BootFromCD.install-step1.png
  3. Select your desired language and click Install Ubuntu 10.04 LTS. The Where are you?window appears.install-step2.png
  4. Select the location closest to your location and click Forward. The Keyboard layoutwindow appears.install-step3.png
  5. If the Suggested option is not correct, select the correct keyboard layout. Click Forward. The Allocate drive spacewindow appears.https://i1.wp.com/pix.toile-libre.org/upload/original/1312973605.png
  6. For installing Ubuntu over your entire hard drive, then Select Erase disk and install Ubuntuand select the hard drive to install Ubuntu there. install-step4a.pngClick Forward.

WARNING: Installing Ubuntu on your entire hard disk will erase all data that is currently on the drive.

OR

  1. If you want to install Ubuntu on a single partition Dual Booting, Select Guided – resize. In the New partition size area, drag the area between the two partitions to create your desired partition sizes. Click Forward.install-step4b.png
  1. The Who are you?window appears.install-step5.png
  2. Enter the requested information, and click Forward. The Ready to installwindow appears.install-step6.png
  3. Verify that the language, layout, location, and personal information are correct and click Install. The installation wizard begins.install-step7.png
  4. When the installation wizard finishes, the Installation completewindow appears.install-step8.pngClick Restart now to restart your computer. Ubuntu is now installed.

Troubleshooting

If the install process fails, trying the alternate (text-based) installer is recommended. The screens during installation are in old-school graphics, but the system installed is similar.
The alternate ISO (as well as the regular ones) can be downloaded here.