Tuesday, April 14, 2009

Installing virtualbox 2.2.0 on ubuntu 8.10

To install virtualbox is fairly easy. Just follow the instructions below:

1. Open /etc/apt/sources.list and add this line deb http://download.virtualbox.org/virtualbox/debian intrepid non-free

2. Import sun public-key and register it using apt-key (wget is for downloading, apt-key is for registering the key to your machine)
$
wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc -O - | sudo apt-key add -
OK

3. Update your system's package index file
$ sudo apt-get update

4. Install virtualbox 2.2
$ sudo apt-get install virtualbox-2.2

Done, that's all :)


Friday, April 10, 2009

Adding local directory to apt sources.list

I faced this problem when trying to install the latest version of lyx, frontend for the famous LaTeX/TeX document processor. Lyx is available at the ubuntu main repo, but the version is kind of outdated. After checking at http://www.getdeb.net, a latest version is available. After downloading the lyx and lyx-common package from here, I tried to install both of them using "dpkg -i *.deb" but they have unsatisfied dependencies. One of the way to solve this is to download all the dependencies and put them inside one directory, and run "dpkg -i *.deb" but I think I wanna try another solution which is using apt to install them. This is where "Adding local directory to apt sources.list" comes into the picture. The steps will be explained below:

1. Create the directory to put all the deb files you downloaded, in this case I'll create /home/foo/debs
$ mkdir /home/foo/debs

2. Put all the downloaded deb files into the directory
$ mv /home/foo/Desktop/*.deb /home/foo/debs

3. Check the current priorities and section for the package, find entry named Section and Priority:
$ dpkg --info lyx_1.6.2-1~getdeb1_i386.deb

Here are some of the info:
Package: lyx

Section: editors

Priority: optional

Homepage: http://www.lyx.org/


4. Create override file. Override file is used to override the default priority and section setting of the package (refer to no. 3 for guide on how to check section and priority). Override file contains 3 columns: package, priority, section. Package is the name of the package, priority is low, medium, high or optional and section is the section to which it belongs.
Example of override file content:

## Override
#Package priority section

lyx low editors


5. Create Packages.gz inside /home/foo/debs
$ cd /home/foo/debs
$ sudo dpkg-scanpackages . override | gzip -c9 > Packages.gz

6. If you are too lazy to do the override file, you do not have to. Just change the "dpkg --scanpackages" command above to this:
$ cd /home/foo/debs
$ sudo dpkg-scanpackages . /dev/null | gzip -c9 > Packages.gz
If you follow this path, ignore step 4 and 5

7. Add this line to /etc/apt/sources.list
deb file:///home/foo/debs /

8. Resynchronize the package index files from their sources
$ sudo apt-get update

9. Install your application (in this case, lyx)
$ sudo apt-get install lyx


Apt will fetch the deb files from your local file directory also. Congratulations, you just created a local file repository in your own computer :)

Tuesday, March 31, 2009

Suse forgotten root password

In suse, if you forgot your root password, you can go to the single mode as usual. Steps are explained below:

1. Reboot the machine
2. When Startup Options(blue background in SLES) appear, choose Failsafe mode
3. In the Boot Options, append init=/bin/sh at the end of the line
4. Press Enter to boot
5. You will be presented with a shell. Change your password using command passwd root
6. Reboot the machine. root is now can be accessed using your new password

Wednesday, March 25, 2009

Changing default shell in ubuntu

I faced this problem when I created a new account using command line where the default shell of my new account is /bin/sh. After googling around, I found 2 useful solutions which are listed below:

1. Change user entry in /etc/passwd
a) edit /etc/passwd using any editor

  • $ vi /etc/passwd
b) find the line that belongs to the user (foo) that we about to modify
  • foo:x:1001:1001::/home/foo:/bin/sh
c) change from /bin/sh to /bin/bash
  • foo:x:1001:1001::/home/foo:/bin/bash
d) save
e) Logout and login back

2. Use chsh command
a) type chsh
  • $ chsh
b) You will be asked for password. Enter your password
c) This screen will appear
  • Enter the new value, or press ENTER for the default
    Login Shell [/bin/sh]:
d) Put /bin/bash at the menu and press Enter

Done :)

Thursday, March 19, 2009

Turn off automatic first capital letter in openoffice

By default, openoffice will automatically turn the first letter to capital in a sentence. This feature is very useful but sometimes you do not want your first letter in your sentence to be capital. There is a setting that you have to turn off to make this happen. This steps have been tested on openoffice 3.

  1. go to Tools -> AutoCorrect
  2. go to Options tab
  3. Uncheck Capitalize first letter of every sentence under [T] which means disable capitalize first letter of every sentence when typing
  4. Click on OK
Done :)