Saturday, August 29, 2009

Installing and using VirtualBox in Fedora

Often we have to work in more than one platform simultaneously while developing something (or for any other work as well). And it is very disturbing to switch to different operating systems from time to time.

We have a very good solution to that. We can use VirtualBox to install multiple guest operating systems in one host operating system. For example, lets say we want to install Windows Vista in Fedora. So our host system is Fedora and guest system is Window Vista.

1. First we'll have to download and install the latest VirtualBox in Fedora. After installing, open VirtualBox.

2. Click on 'New'. Then press next. It will ask you to give a name of the new operating system, you can give any name for this. Below VirtualBox will ask for the operating system type and version (in this case, type is Microsoft Windows and version is Windows Vista).

3. Then you'll be asked to specify the amount of memory (RAM) to be used for this guest OS. Give it as you like (better to give atleast 512mb for Vista). Note that, your total RAM will be divided for the host and guest OS when you run guest OS.

4. Then it will ask to specify the hard disk space for the guest OS. When creating a new partition, there are two options. Fixed-size storage (the drive size will be fixed) and Dynamically expanding storage (the drive will start with a small size, but it will expand as needed to the maximum size specified by you).

5. Click finish button. Then start the new created operating system by pressing 'start'. It will ask for the Windows Vista cd for the first time to install. It will continue the install process normally.

6. After installation, you are ready to use your new guest OS.

Sharing files between Fedora and Windows Vista:

1. We have to download the VirtualBox guest addition. It is a cd image file, if you double click on it, it will be shown as a cd drive.

2. From the windows Vista window, click devices->Mount Cd/Dvd-rom->cd/dvd-rom image. Then select the cd image you just created by double clicking on guest addition. Now this drive will be shown in 'my computer' as a drive. Go inside it and install guest addition.

3. Shut down your guest OS. From VirtualBox settings->shared folders, select the folder you want to share between the two operating systems.

4. Now restart Windows Vista. You will find an icon of VirtualBox guest addition in the taskbar.

5. Now go to command prompt and type: net use x: \\vboxsvr\shared -p

6. If successfully completed, you will find that shared folder in 'my computer' as a drive.

Hope it will help you using multiple operating systems in your machine.

Monday, June 15, 2009

Marking duplicates in Excel/Calc

When you have a big Excel/Calc spreadsheet, you often need to see if you have duplicate entries in a column. I also wanted to find out if there's any way to mark the corresponding rows if different columns hold duplicate entries. I did not find any direct solution to this, I had to do it in a few steps.

You have to select the all the entries (click on the first element of the first row, then press ctrl+shift+End), then sort them in ascending order (go to Data->Sort, select the column you want to find the duplicate in, then press OK). Make a new column. For example, if the column that you want to search for duplicate in, is A, and the new column is E, and if the entries start from A2, then put this formula in E2: "=IF((LOWER(A2)=LOWER(A1))OR(LOWER(A2)=LOWER(A3));1;0)". Set the formula to the whole "E" column. It will show 1 if it is duplicate entry, 0 otherwise.

Now, again select the whole range of data, then go to Format->Conditional Formatting. Under Condition1, select "Formula is", and then enter this formula: "=INDIRECT("E"&ROW())=1", then select the format you want the duplicates rows to show. Thats all, now you'll easily find out the duplicate entries.

If anyone know the direct solution to do this, please tell me.......

Saturday, June 13, 2009

Setting up a local SVN server in Fedora Core

hi there......this is my first blog post. So I am not being able to decide which topic I should start with. I am going to start with a very useful topic, "Setting up a local SVN server".

SVN (Subversion) is a version control system which is used to control the changes of files maintained by many people. For example, if many developers are working on a project from different locations (or even from same location), few person can work with the same file and then save it with the changes they made to that file. SVN is a very smart tool that can identify the changes made my each developer and then updates the file in server with all the changes, with no error or bug (SVN actually changes the lines in files rather than overwriting the file). It sounds very unclear first up, but you'll get used to it and understand its concept once you start using it.

Setting up SVN locally can be very useful for a office or a group of developers, so that everyone can work with the same files without having to think about the collisions.

I am going to mention the steps to setup a local SVN server below:

1. You need to have SVN installed in your system. It is installed by default in Fedora Core. If you dont have it, then you can download it using yum.

2. go to terminal and type:

'svnadmin create svn_repo'

(you can use your preferred name instead of svn_repo), It will create a folder called svn_repo in your current directory.

3. cd to the svn_repo/conf folder:

'cd svn_repo/conf/'

4. open passwd file in text editor:

'gedit passwd'

under [users] add your username and password like this:

rafi = 123456

then save the file.

5. open svnserve.conf in text editor:

'gedit svnserve.conf'

under [general], write these:

anon-access = read
auth-access = write
password-db = passwd
realm = My First Repository

6. Go to the first directory:

'cd ../..'

7. 'svnserve -r svn_repo/ -d'

8. Now you'll have to import the files you want to keep in the svn server (e.g. the source files), if you want to import trunk folder in your local server, type:

'svn import trunk/ svn://localhost/local_trunk -m "Initial creation" '

9. You can look at the svn tree: 'svnlook tree svn_repo/'

10. copy the files to a location: 'svn checkout svn://localhost/local_trunk'

It will copy the files in local_trunk folder in your home directory

11. Now change a file in local_trunk, e.g. readme, then check status:

'svn status'

(you must be in the local_trunk folder), you'll see 'M' before readme file, 'M' means modified.

12. Commit your modification to the SVN server:

svn ci WordForge/README -m "readme modified"

-m means message, you must provide a message.

13. If you want to be updated to the latest changes made by other:

'svn up'

14. How others can access the SVN server from their computer:

being root:

svn co svn+ssh://[ip of the server]/home/[user]/svn_repo/ /[path to store in client computer]

for example:

svn co svn+ssh:// /home/ankur/Desktop/

being user:

svn co svn+ssh://user@[ip of the server]/home/[user]/wf_repo/ /[path to store in client computer]

for example:

svn co svn+ssh://Rafi@ /home/ankur/

It will ask for the password of the user of server machine.

15. Now the user from client computer can update his source by going to the directory where he stored the files, then typing:

svn up

It will update the files to the latest version.

I hope it will be usefull for you......