Auto mount partitions in few easy steps

When we log in to Linux we have to mount partitions manually. In some earlier distributions of Ubuntu we had to enter the root password too. This is troublesome and I’m going to give you few easy steps to mount these partitions on start up or rather as we call it to auto mount these partitions.
First we have to understand what fstab is. The term fstab stands for file system table.  It contains the startup script which relates to mounting partitions so we have to add our partitions to the fstab. fstab looks like a table at a glance it has these columns

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

<file system> – this stands for the location of the partition. (eg: /dev/sda2)

<mount point> – the place in the file system where we want to mount the file system. (eg: /media/work)

<type> – the file system type. (eg: ntfs, ext4)

<option> – here we want to mount it automatically so it should be auto

<dump> – the archiving schedule for the partition.

<pass> – the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be either 2 (to check after root) or 0 (to disable checking for that partition altogether).

Now lets get to the fun part;

1) Mount the partitions manually then open a terminal and give df -h this will list all the mounted partitions with the file system details.

2) Unmount the partitions and then make directories with the names you like to give to those partitions in media eg: mkdir /media/Work

3) Open fstab sudo gedit /etc/fstab and add the partitions with the details you found using df -h
eg:
/dev/sda7 /media/Work ext4 auto 0 0
/dev/sda1 /media/Win7 ntfs auto 0 0

4) Now restart the machine :D

hope this was helpful :D
Bye! for now
:D

Is ubuntu reaching the end of it?

I started my life of Linux with Mandriva, it made me realize Linux is better than windows and I felt like I know something about operating systems by that time Ubuntu was there but it looked bulky and I hated that shade of brown color and its large icons. As the time goes by I got to know about LinuxMint which I loved (by the way I never sticked to Mandriva because it didn’t support my Huawei E220 which is my primary source of Internet connectivity) and I started to use LinuxMint as my primary OS I still had windows by the side because I didn’t like the presentation templates in open office, Mint supported my Huawei E220 that was the main reason for my transition. Mint was bas ed on Ubuntu after few release cycles I thought of moving to Ubuntu because it’s the same as Mint and the UI started to look better, and among other reasons the Mint made Ubuntu less stable so basically Mint is less stable than Ubuntu.

The transition took with Ubuntu 9.04 (Jaunty Jackalope) and my OS world was perfect!! free software all the time, just an apt-get to install those and the Ubuntu software center made some promises with nice descriptions. From there onwards the OS became better and better and better. Nice UIs, faster booting times, new logos, nicer user friendly installation guides and Ubuntu made the perfect OS for the open-source community and most of all its became the best OS for the newbies in Linux.

Lets talk about Linux for a bit, Since the beginning of GNU project it was all about freedom. Men and women who were involved in Linux always talked about freedom free software, freedom to distribute freedom of use and Linus Torvalds helped Richard Stallman with his philosophical idea of free software and the Linux community always withstand any dictatorship they always challenged the monopolies. That lead to success of this community.

Now new ubuntu comes with Unity, for what I have experienced its still in the development phase and its still not desktop worthy, but it seems like Mark Shuttleworth thinks its desktop worthy. Its a crappy desktop environment where you cannot change the position of the launcher and the reason for that is the launcher should match with the ubuntu logo which is in the top left hand corner. As the latest reports says there wont be an ubuntu logo after all it will be just a blue triangle, but still they are arguing about it lets just hope for the best.

Change is good it makes people think differently and act differently but those changes should not make people slaves. Ubuntu says; the Gnome support will still be there for another few releases and then after that Gnome no more. That will make the Ubuntu transition for a newbie difficult, the user friendly OS will not be that user friendly. I highly appreciate the work the Ubuntu developers put behind to build such a wonderful OS but I have this big question

IS UBUNTU REACHING THE END OF IT?

This is just a thought!
What do you think about? Leave a comment!

bye!

Installing XAMPP on Ubuntu

Hey guys this is a quick post on how to install XAMPP on ubuntu. Here we go first you have to download XAMPP.
First you have to browse to your downloads folder and enter this command to extract the compressed folder;

Code:
tar -zxvf xampp-linux-1.7.3a.tar.gz

Now you have to copy the content to /opt and here is the command;

Code:
sudo cp -vr lampp /opt/

As you have copied the content of the lampp folder to /opt using sudo you don’t have permission to access the files freely there are two things you can do you can change the ownership of the file system by using chown or change the permission using chmod. The best way and the easiest way to do this is chown and the command is;

Code:
sudo chown root:< your username > /opt/lampp

Now browse to /opt/lampp folder and run;

Code:
sudo ./lampp start

You can check the status of lampp by simply running

Code:
sudo ./lampp status

and it should be something like this

rusiru@rusiru-L510:/opt/lampp$ sudo ./lampp status
Version: XAMPP for Linux 1.7.3a
Apache is running.
MySQL is running.
ProFTPD is running.

Hope this was helpful :D
if you have any questions feel free to comment :)
Bye.
Have fun :D

P.S.

Go to localhost to check it out :D

Android and NetBeans

Hey guys I’m writing this post after few weeks. This time I thought of writing a post about Android. I bought a HTC Hero, the first HTC android phone with the Sense UI . Since the day I bought the phone I wanted to write an app for the phone, but with work didn’t get much time to do that. Finally I found some time to kill, so as a result of that I’m writing this post.

First I wrote my Hello World app using Eclipse. Though it’s a powerful IDE I don’t like the idea of using Eclipse. Therefore I looked for a plugin to NetBeans to develop my first Android app. Among the first few search results I found this article How to setup Netbeans for Android development and it worked the magic. Even though the above mentioned post was written for NetBeans 6.5 it works for NetBeans 6.8 too.

Note: you have to install Android SDK to start. Follow this link to install the SDK Installing the SDK

Ok then lets start developing our first android app; to start work first you have to install NetBeans and have to install the Android plugin by following the above link.
Open NetBeans File -> New Project and you’ll get the screen below select Android as the category and Android Application as the Project and then click next.

New Project

And the next part is the Name and Location window its as same as a usual NetBeans project therefore I’m not gonna explain that to you!

Name and Location

OK now lets take a look at the first code this is really simple, the below image is the class which you have to edit.

Java class

you have to add these lines of code which is demonstrated on the following image

TextView tv = new TextView(this);
tv.setText(“Hello Android”);
Button bt = new Button(this);
bt.setText(“GO”);
setContentView(bt);

Finished code

and then you have to hit the run button and it will start the Android emulator

Running App

Try more and enjoy
bye for now
:D

Note: This link has more and further details on android development

~~ Rusiru Boteju ~~

Fixing a broken pendrive

Hey guys, after the installation of Lucid had to install all the softwares from the beginning. It was a time consuming task, but I kinda like the idea of apt line commands of installation so I did all the installations without going to synaptic package manager. Thats what happened so far, today I’m gonna talk about what happened to me yesterday and how I fixed it.
This is the story from the beginning;
I was copying some image files to my pen drive, (its a Kingston DataTraveler 2Gb) suddenly it got ummounted during the copying process. Then when I plugged it back it didn’t work. When I do a lsusb it shows the pen drive but for sudo fdisk -l it says there is no partition table. I was so upset, and since then I was searching the web and looking for a solution. There were certain suggestions for Linux those are testdisk, gparted etc but nothing worked the worst part was it was write protected too. :( gparted didn’t even recognize the pen drive. I thought it was the end, even in certain ubuntu forums some users said its the end of the pen drive. I never gave up, i just kept searching, while doing that I plugged the pen to windows xp machine the same problem occurs the pen drive is available but can’t format it cos of the write protection. Then I found this article, about how to remove write protection on pen drives, but in windows that didn’t work too, but I kept on reading the comments of that article on one of those comments I found this COMMENT and that particular comment saved my life.
This is what you have to do, first download the software from this Link. Then unplug all the other usb devices except the one you need to recover or the one you want to fix. Extract the file and double click on the .exe file (ah btw you have to do this in a machine with windows xp). The software will automatically format your pen drive with fat16 file system (Format it again with ntfs or fat32 if you want).
And finally the pen drive is recovered :) you are over joyed :D
Hope this was helpful!
bye for now
Good Luck!!

~~ Rusiru Boteju ~~

The change it self – Lucid Lynx

Hey guys! hope you have already installed “Lucid Lynx” or as we all know it ubuntu 10.04. I installed Lucid few hours back, and it is definitely a change. I installed it by creating Startup Disk, it was an exciting idea for me, because I tried it out for the first time. The installation was really impressive, it took me less than 10mins (it was that fast) and I’m proud to say, from today onwards I’m totally “opensourced” (at least the operating system) and also I might install windows on virtual box in time to come (if I want it).

What I like about Lucid:
- E220 Huawei dongle works like a charm (it was not like this when I was using Karmic)
- The UI design is way cooler than the earlier editions and the window controls on the right hand side of the window border gives it a more sleek look.
- Ubuntu software center is renewed with more features.
- Gnome-terminal looks purple
- And finally the menu items are improved and more user friendly.

Terminal
terminal

Software Center
software center

What I don’t like about Lucid:
- The indicator applet takes too much space (the space between icons are too much when comparing to the icon sizes).
- Bluetooth with phoenix bios still suck till you install omnibook module (check my post on Phoenix bios and bluetooth)
indicator

I hope the indicator applet problem will get solved soon its not that much of a big issue.

Lucid Lynx really shows that change can happen, because its that good, and when you use it you’ll realize its fast(i.e. installation, boot-up and response time).
Now I’m gonna tell you about few things you have to do after installing Lucid(there are many blog posts about that but here I’m gonna tell you what I did so far)

1. Change font sizes, the default font size is 10 but I changed it to 9.

font sizes

2. Remove the panel on the bottom and install Docky
sudo add-apt-repository ppa:docky-core/ppa
sudo apt-get update
sudo apt-get install docky

then add more docklets change settings to make it look like what I did or as you prefer,

Docky

3. Lucid comes with Empathy as the default chat client it was the same with Karmic too but I like pidgin so I installed pidgin sudo apt-get install pidgin if you want to change the smiley theme to those smilies in yahoo messenger or MSN messenger download the file in this LINK extract it on ~/.purple/smileys then go to Preferences -> Themes -> Smiley Theme and select original – M@her and that will do the trick.

pidgin

4. When it comes to twitter I use Choqok as in my previous post so to install choqok, sudo apt-get install choqok but in default Gwibber comes with Lucid.

5. I installed chrome too by downloading and installing the .deb file

Those are the major changes I did after installing Lucid Lynx.

If you are new to Linux then the best OS to use is ubuntu and also if you are new to computing then again the best OS is ubuntu that is what I recommend.

bye for now download, install and experience the change !!!!!!!

~~ Rusiru Boteju ~~

Restore Grub boot loader after installing Windows

I got some free time, after finishing my work (I do get a lot of free time these days don’t I?) Anyway when I was writing my previous post about Removing older kernels from Ubuntu Karmic I thought of writing a bit more about the grub so today I’m gonna write about how to restore grub.
When we install windows xp, vista, 7 or some other version of MS OS’s, while having ubuntu or some other Linux distribution we can see that, the grub menu goes away or simply put, the grub menu doesn’t come when the OS is booting. How can we go to ubuntu? Do we have to install ubuntu? (I’m using ubuntu here because I’m using ubuntu as my primary OS) those are the questions which come to mind to mind. But there is no point in being worried, we can restore the grub, and it will solve the problem :D

Note: when it comes to grub 2 the process is a bit different (I’ll explain it later on)

Ok then lets start with Grub 1 (I call this grub 1 because the new one is called grub 2)

First insert the live CD and reboot. When the menu appears go to Try Ubuntu without installing menu and press enter.
When you get to the desktop open a terminal and type
Code:
sudo grub

This will lead you to a grub prompt which will look like this : “grub>”
Then from there you have to find where the grub is situated, to do that you can use the command,
Code:
find /boot/grub/stage1

and that will return something like hd0, 1 (It may differ) for the demonstration purpose I’ll use hd?. ?
now we have to enter
Code:
root (hd?,?)

for example if you got hd0,1 you have to type root (hd0,1)
Then you have to enter setup command which will install the grub to the MBR
Code:
setup(hd0)

and finally
Code:
quit
reboot

And that will do the trick for grub 1 :)

Now lets restore grub 2. When restoring grub 2 you have to have ubuntu 9.10 (for now or later version)
This part is a bit tricky and have a bit more to remember (keep that in mind)
As we did in the earlier process first you have to boot up ubuntu using the live CD then open a terminal and type,
Code:
sudo -i

This will make you the super user (root). If you think logging in as root is risky then don’t. What you have to change in the following commands is, you have to add “sudo” in front of each command :)
Now you have to identify the mounted partitions of your computer, to do that you have to enter the following command,
Code:
fdisk -l (usually you have to do sudo fdisk -l but as you are logged in as root you don’t have to)

Then from that result you have to find out in which partition ubuntu is installed. (it could be /dev/sda1 , /dev/sda2 etc.)

Note:
If you have partitioned your HDD as root(/), home, boot etc. separately then you have to select the partition which is used as boot if not, that means you if you have just root(/) and home then select the partition which is used as root. For now I’ll take /dev/sda1 as my root partition.

Now you have to mount that partition,
Code:
mount /dev/sda1 /mnt (we are working as root)

After mounting the root partition you have to bind the /dev and /proc you can do this by entering the following,
Code:
mount –bind /dev /mnt/dev
mount –bind /proc /mnt/proc
update-grub
grub-install /dev/sda
grub-install –recheck /dev/sda

Important: Check the above command carefully it says /dev/sda and not /dev/sda1. “sda” means the full hard disk where ubuntu is installed

Now you have to unmount the partitions you mounted during the process,
Code:
umount /mnt/dev
umount /mnt/proc
umount /mnt

and then you have to reboot the computer.

And that does it :D
I hope now you don’t have that to worry about :D
Have fun,
Bye for now!!

~~ Rusiru Boteju ~~

Removing older kernels from Ubuntu Karmic

Hey I’m back again! This time I think I should talk about the Grub a little bit, (if you are thinking that I’m gonna tell you how to remove grub 2 and install the previous one its better if you stop reading this). What I’m gonna tell you is “How to clean the usual Grub menu”.

When we do the updates, for an instance if we take ubuntu there are updates almost every week and among those there are kernel updates like every other week, so what basically happens is that, the grub menu will get filled up like the one in the image below

Grub menu filled

So how can we clean this mess?
First, you have to open a terminal and type,
uname -r
This will show you the current kernel you are using, (i.e. 2.6.31-20-generic for me) or remember the name of the kernel at the top of the menu, (for the above image its 2.6.27-11-generic). Now you have to go to System–> Administration –> Synaptic Package Manager. From there, in the Quick Search, type linux-image and this will enlist all the kernels that are available and also, the ones marked in green are the ones that are currently installed (here I’m gonna remove 2.6.31-19-generic). Right click on the one you want to remove and click on “Mark for removal”. Then again search for linux-headers and again mark for removal.

linux-image search

Marked for removal

And finally Apply :D thats it !!

Warning!
Please remember to remove the ones you are not using only, and be careful to not to remove the current kernel that you are using because it’s possible to break ubuntu if you remove the wrong kernel.

The grub menu list will get updated automatically and you are free from old kernels.

Finally Free

I’ll meet you again with another post about the Grub till then
bye.

~~ Rusiru Boteju ~~

Compiz fusion with black screen

Is there a best time to write a post, I don’t think so but when you are challenged by the technology then its time to attack it back (you know what i mean) this is what happened to me just now, compiz fusion gave me a black screen, my best buddy for a long time gave me a black screen :( I was so upset I always liked those wobbly windows those little fancy things it does when I turn my laptop on, anyway I’ll come straight to my point now I got a “Black screen” whats the problem??

I’ll first describe you the symptoms, the OS boots as smoothly as it was but when I login AWN (avant window navigator) is not working the area that is belong to AWN is black then it moves to the system tray then the whole panel disappears or get covered with black color what I did instantly was trying to go to the terminal still no use I cant go to the terminal it gets black too :( but finally I pressed Ctrl+Alt+F2 vola!! the X-Server went away and the full screen shell came to life

But still I cant browse cos I cant open Fire Fox, then I turned on my friends computer and searched finally, found the ANSWER !!! :D

Now I’ll tell you what I did to get the black screen. Yesterday there was a problem with my machine the AWN is now working properly fire fox doesn’t have the bookmarks I saved compiz is not working and also virtualbox is not working too :( then went to gparted (open terminal and type sudo gparted) then I saw the reason the home partition is filled just 200Mb is free, then I removed XP from the virtualbox then I got 8Gb free memory :D fire fox showed me the bookmarks and AWN works but compiz didn’t work so today I went to compizconfig settings manager and enabled wobbly windows and also blur windows then the black screen came :(

As I can go to terminal/shell what I did was searched for the terminal command to set the defaults in compiz using the terminal/shell finally I found the answer its:
Code:
gconftool-2 --recursive-unset /apps/compiz

and now it works as smoothly as it was earlier :D

Note:
All the thanks goes to the guys who sent replies to this thread

~~ Rusiru Boteju ~~

Follow

Get every new post delivered to your Inbox.