Monday, November 14, 2011

How to get Window's minimize and maximize button in fedora 16

This is something which I believe should have been available by default.
Thou, the below steps to get that is not so difficult and also little bit of fun.

Step 1. Download gconf-editor
# yum install gconf-editor

Step 2. Open gconf-editor
# gconf-editor

Step 3. Go to / -> desktop -> gnome -> shell -> windows

Step4. Now click on value of button_layout and change it to:

Step 5. Logout and Login back ...... it's done! :)

Note: if you want some space between menu buttons use "space" for eg:

Friday, September 16, 2011

Tip / Trick for web developers

Today I was trying to install JEvent2.0 in Joomla1.5.23 for one of my client.
But, when ever I "upload and install" JEvent I was getting few MySQL error messages.
Something like this:
* Component Install: DB function failed with error number 2006
MySQL server has gone away SQL=INSERT INTO ULJoomla_components VALUES( 0, 'JEvents MVC', 'option=com_jevents', 0, 0, 'option=com_jevents', 'JEvents MVC', 'com_jevents', 0, 'js/ThemeOffice/component.png', 0, '', 1 )

INSERT INTO ULJoomla_components VALUES( 0, 'JEvents MVC', 'option=com_jevents', 0, 0, 'option=com_jevents', 'JEvents MVC', 'com_jevents', 0, 'js/ThemeOffice/component.png', 0, '', 1 )

* Error Loading ModulesMySQL server has gone away SQL=SELECT id, title, module, position, content, showtitle, control, params FROM ULJoomla_modules AS m LEFT JOIN ULJoomla_modules_menu AS mm ON mm.moduleid = WHERE m.published = 1 AND m.access <= 2 AND m.client_id = 1 ORDER BY position, ordering

Extract the archive file and paste the complete path and press "Install" (not upload and install).
But, in my case I don't have full path since I have access to joomla's root directory using ftp only.
Here, goes the solution, how I made it worked for me:
1. upload the archive file into (joomla'root directory)/tmp/
2. now use "upload and install" method to install file.
Finally installed smoothly without a single issue.

Thursday, September 15, 2011

Alias to find process id of a running process

This is an example for those who believe in saving time.
You can create your own aliases to save your time from typing long commands again and again.
Create alias
# alias p_id='echo -n '\''process name:'\'';read a;ps -e | grep firefox | cut -d '\'' '\'' -f 2'
Execute it
# p_id
process name:[name of the running process]
[output will be the process id]

Monday, August 8, 2011

[Alpha version] Now it is simple to install rpm packages on other pc which don't have internet connection.

Run this script from the system which has internet connection then copy the package.tar.gz file.

How to install packages on other pc which don't have internet connection.
1. paste package.tar.gz into non-internet pc.
2. Switch to root user using
$ su -
3. Extract tarball
# tar -C packagepkd -xvf package.tar.gz
# cd packagepkd/.package/
5. rpm -ivh ....
check "man rpm" for more details.


Kindly, report here if you find any bug.

How to remove all *.lnk files from pen drive

Yesterday, I have connected my pen drive on someone else's system. Now, when I return home and connected my pen drive on my system, I have found lnk files for each file and directory in my pendrive. It is a waste of time deleting those files one by one. So, here is a simple command to remove all lnk files.

# find /path/to/pendrive -name '*.lnk' -exec rm -v '{}' ';'

Friday, July 8, 2011

How to change MAC address in fedora

1. First step is to find the current MAC address and take a backup copy in a safe place.

To know your current MAC type:
$ ifconfig | grep HWaddr
eth0 Link encap:Ethernet HWaddr 00:19:48:2E:D1:27

The above hexadecimal numbers 00:19:48:2E:D1:27 is your MAC address for device eth0.
Simply copy and paste it in a file.

2. Now, time to change the MAC address this requires you to work as root user.
Take the network interface down
# ifdown eth0

Now, lets change the current MAC address to 00:E0:81:5C:B4:0F
# ifconfig eth0 hw ether 00:E0:81:5C:B4:0F

Take the network interface up again
# ifconfig eth0 up

Check if your MAC address is changed:
# ifconfig eth0 | grep HWaddr

Changing MAC address is only temporary. Once you reboot your machine, the operating system will reflect the physical MAC address burnt in your network card and not the MAC address you set.

Thursday, July 7, 2011

Default Permission

Default Permission:
For Normal Users:-
1. On File:
-rw-rw-r-- or 664
2. On Directory:
drwxrwxr-x or 775

For users with root permissions:-
1. On File:
-rw-r--r-- or 644
2. On Directory:
drwxr-xr-x or 655

File and Directory Permissions

File Permissions:
1. -r--
content of the file can be read using command such as cat, less or more.
2. -rw-
Note: read permission is required to write into any file.
file can be edited and saved
3. -r-x
Note: read permission is required to execute any file.
shell (bash or sh, etc) will attempt to execute the file when file's name is entered as a command.

Directory Permissions:
1. dr--
content of directory can be read as ls.
Few examples:
$ ls testing/
ls: cannot access testing/file2: Permission denied
ls: cannot access testing/file1: Permission denied
file1 file2

Note: long listing requires execute permission.
Few examples:
$ ll testing/
ls: cannot access testing/file2: Permission denied
ls: cannot access testing/file1: Permission denied
total 0
-????????? ? ? ? ? ? file1
-????????? ? ? ? ? ? file2

2. d-wx
files may be created or delected in the directory.
a). execute permission required.
b). A file can be deleted by anyone who has write permission to directory in which the file resides regardless of the ownership or permission for that file.
Few examples:
a). $ ls testing/ [Failed]
ls: cannot open directory .: Permission denied

3. d--x
enter into directory using command cd
Few examples:
a). $ ls testing/
ls: cannot open directory testing/: Permission denied
b). $ cd testing/ [Okay]

Tuesday, June 14, 2011

[Solved] Starting LSB: start and stop the WLM configuration [1;31mfailed [0m, see 'systemctl status cgconfig.service' for details.

Most simple solution:
# yum update libcgroup-0.37.1-3.fc15

My problem is solved after this update.

[Solved]- Starting /dev/disk/by-uuid/ad5290fc-d073-45db-bfaf-86f25f401a07 [1;31maborted [0m because a dependency failed.

If you got any error like this at f15 booting time:
Starting /dev/disk/by-uuid/ad5290fc-d073-45db-bfaf-86f25f401a07 [1;31maborted [0m because a dependency failed.
Case I:
First check your /etc/fstab,
if you got any line starting with
Note: In my case UUID=ad5290fc-d073-45db-bfaf-86f25f401a07. But in case UUID will be something else.

Reason for this failed message can be due to change in the partition like partition recreated after delete or filesystem type change (say ext3 to ext4).

If it is due to change in partition you can use any one of the two methods:
1. Use blkid to find the UUID of /dev/sda5 (say the partition which has been changed is /dev/sda5)
# blkid
copy the UUID value from the output of the above command for /dev/sda5 only and paste it in place of previous UUID in /etc/fstab

Note: If the changed partition is your root partition you must have to edit /etc/grub.conf file
root=UUID=^new UUID^

2. open /etc/fstab file as root.
Now, edit only first field.
for example:
if it is like:
UUID=ad5290fc-d073-45db-bfaf-86f25f401a07 swap swap defaults 0 0
Replace the first field with partition name /dev/sda5 (say the partition which has been changed is /dev/sda5)
/dev/sda5 swap swap defaults 0 0
Note: If the changed partition is your root partition you must have to edit /etc/grub.conf file
root=/dev/sda5 (say the partition which has been changed is /dev/sda5)

Monday, June 6, 2011

We configure DSL connection using Network Manager. I like to know which file does it edit??

Yesterday, I was searching for this file. Googled alot, asked on #fedora, even I have thrown this question on #nm but didn't find any answer.
After searching for one hours, I have found this of my own and like to share with you all.

When you create a new DSL Connection using Network Manager your configurations are saved at
# cd /etc/NetworkManager/system-connections
Inside this folder you can find all DSL Connection's configuration files.

Friday, June 3, 2011

How to Configure Network Connection in fedora 15

Now, a days most of end-users have a common question i.e., How to configure network connection for usb-modem, mobile phone and broadband etc.

Today, I will try to cover all different types of network setup in fedora 15.

First step
First step for network configuration is to open Network Manager where you have to enter LAN and Service Provider's Info.
You can open Network Manager by:

1. Right click on the icon of two Computer -> Edit Connections
2. Left click on the icon of two Computer -> VPN Connections -> Configure VPN
Or Using command:
3. $ nm-connection-editor

Now, after this you can find a small window something like this:

I. Router/modem in bridge mode.
Most of the bsnl users, use this mode of network setup.
Before you start your network setup you must need two things:
1. username provided by bsnl.
2. password provided by bsnl.

Now, click on the DSL tab of Network Manager -> Add/Edit

Enter you username and password provided by bsnl, and service can be any name. (better to use service provider's name)
At the end don't forget to "Save" your changes.

II. Router/modem in pppoe mode.
This mode of network setup is mostly used in Corporate sectors and sometime people having dual boot System.
Now, click on the Wired tab of Network Manager -> Add/Edit

Here, the IP, Netmask and other information may not be the same for your case.

Note: All the information which are entered here are similar to the information entered in case of "Network Places -> LAN Connection" in Windows XP.

III. Internet Connection on PC using Mobile Phone.
Here, mobile phone works as a modem and mobile phone is connected to PC using a data cable.
Now, click on the Wireless tab of Network Manager -> Add/Edit

From "Any Device" drop down select your device and simply follow the steps.
Note: At the end must check if APN Name is corret.

IV. For usb-modem.
For bsnl and other dial-up usb-modem, same as "I. Router/modem in bridge mode."
For other, "III. For Mobile Phone."

1. At a time enable "Connect Automatically" for only one device.
2. There are other ways of network connection too available but all above steps are simple and less risky.

Saturday, May 28, 2011

Data Recovery in Linux

Yesterday was really an unlucky day for me. An example for this may be, I have deleted a lot of my useful data by mistake. I was going to delete a folder using SHIFT + DEL, but in doing so by mistake I had pressed SHIFT + END then SHIFT + DEL. Grrrrrrrrrrrr :x.
So, now I need a software for data recovery for ext4 filesystem.

TestDisk - CGSecurity

TestDisk is wonderful FOSS under GNU Public License. It is capable enough to data recovery from lost partitions and/or make non-booting disks bootable again when caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table).
TestDisk can run under
* DOS (either real or in a Windows 9x DOS-box),
* Windows (NT4, 2000, XP, 2003, Vista, 2008, Windows 7 (x86 & x64),
* Linux,
* FreeBSD, NetBSD, OpenBSD,
* SunOS and
* MacOS X

How to recover data?

Open terminal and type:
1. Installation:
# yum install testdisk
2. Run:
# testdisk
Now, you can see a text user interface like this:

Note: Use keyboard: left arrow move left, right arrow to move right, Up arrow to move up, down arrow to move down and Press Enter to Select an option.
Now, select an option which you think best for you. But, I prefer to main a log.

Select the disk from which you want to recover data and Proceed.

Select partition type, here in my case Intel and Press Enter.

Select Analyse and Press Enter.

Just Select Quick search and Press Enter. First time, it will take some time, in my case it took half an hour.

Now, select the partition from which you want to recover data and Press P. It will list all files and directories inside the partition.

Note: White Color files indicate existing files and Red color files indicates deleted files.

Just select the deleted file which you want to recover and Press c to copy. Now, you will get a options asking about destination location. Choose your destination location and Press Y. This copy process will take some time depending upon files size. When the 'Copying, please wait...' message will be replaced by 'Copy done!' message, then you can find your files on destination location.

I hope this post will help you. Thanks for Visiting by blog.

Cheers. :)

Google Summer Of Code 2011- Student


Port Infrastructure TurboGears1 apps to TurboGears2

This year, I am participating in Google Summer Of Code 2011 as a student.
From Summer coding ideas for 2011 , I have selected Port Infrastructure TurboGears1 apps to TurboGears2 as my Summer Of Code project. Thou, I am interested to work on another project hopefully Fedora Medical. But, my semester exams are going to begin from 19th May 2011. So, till now looks like situation is not favouring me to accept another project.

Here, you can find my proposal in Summer Of Code 2011 for Port Infrastructure TurboGears1 apps to TurboGears2.
I have already conversation with Matt Domsch (mentor) and Toshio Kuratomi on #fedora-admin about this issue. With the permission Of Matt Domsch and his suggestion, I have decided to working on fas application first.
Yesterday, I have cloned fas app from "git clone git://" and successfully completed modiication on and files.

I love development work and enjoying my work in GSoC 2011. :D
Thanks To Google for Conducting Summer Of Code.

Fedora And Open Source Event, GCECT

Before I start, I like to Thanks Rahul Sundaram, Prosun Sir, all Speakers, all Volunteers and my college teachers who help me a lot to organise this event successfully.
Thou, I agree that there where few mistakes may be since this was my first event or first FOSS event in our college (strange na) or may be due to lack of any Senior fedora Ambassador.

What ever may be I put you to decide the perfect reason for this.

Event Details:
Total Event Registration: 200+
Total Event Attended: almost 150

2nd Feb 2011, I entered into my college campus at 9:00 A.M (1 and half hour before event was going to begin), my friend (responsible for managing auditorium and audio system setup) called both the person (lives beside our college campus) who were responsible for auditorium and audio system setup. Event's starting time was 10:30 A.M, but auditorium and Audio system setup was completed at 11:30 A.M in simple 1 and half hour late. Few people may be thinking why we haven't go for Auditorium and Audio system setup day before the event's day. The reason is simple, we already had a cost related problem and going for those setup day before that means we had to pay charges for two days. Ok! Atlast event started almost at 12:00 P.M.
Note: I have learned a new thing and I like to share this with my friends those who are first time going to organize any Event. Try to maintain that Event's beginning time must not be before 11:30am.

Event started with the speech of Mr.Indranil Das Gupta. Really very inspiring speech in which he had explained us about FOSS, importance of FOSS. Few information about fedora like total number of languages currently available in fedora. He had also mentioned about Fedora Project and Google Summer Coding. Here I can't stop myself saying about the best example of the importance of FOSS given by Mr. Indranil. i.e., air we breath is like FOSS and we can't live without it, may be we can hold our-self for few secs but after that we will start choking for air. He also mentioned about people like Sayamindu Das Gupta, Gopal V, Subhodip Biswas, Arindam Ghosh, Susmit Shannigrahi, Máirín Duffy and about their contributions to FOSS and Fedora.

-- break for 30mins --

After his speech I found a lot of attendees, specially new faces taking interest into FOSS and asking me about how to make contribution on FOSS and Fedora projects. Before, he leave he suggested me to create a group with other WBUT Board (West Bengal University Of Technology) students. I really found this very important after this event.

After break, my friend Er. Rahul Ghose came on stage to speak on “Awareness On Programming tools in linux”. Really very important topic for attendees since almost all attendees were Computer Science Engineering and Information Technology students. Before, event many students asked me about programming tools which are available in Linux. I hope this speech has solved a lot of queries regarding that.

After that around 2:20, Mr A.Mani was holding the mic for his speech on “Digitization of Documents in Fedora Linux”. Few people may be don't know that Mr. A.Mani is an Ambassador from India and has a lot of experience on events. Also, he coordinates the activities of ILUG-CALINFO. “Digitization of Documents” - a new topic for me too. So, I was trying to lessen his speech carefully. Few topics which I liked a lot from his speech are Copy-Left Licenses, Creative Common Licenses, Open Hardware, Scan Tailor and few others.

Next came Abhishek Jha, I guess this was his first speech on FOSS event speech (please correct me if I am wrong). He answered about one of the question asked by attendees “How to make money from FOSS projects”. He used examples of his friends and some tips during his speech for his explanation regarding this.

Next my turn, it was almost around 4:50, I guess. I have heard a lot of attendees were interested to hear on this topic “Cloud Computing and OpenStack-swift”. But, everyone was tired a lot during my speech, So I have to cut down my speech. I told them about What is cloud computing?, Importance of Cloud Computing, Public Cloud and Private Cloud, Cloud Infrastructure, OpenStack Servers, Swift tool, and few other topics.

During, speech I have found lots of questions from attendees. So, I have added a Question and Answer section at the end. Few of the question which I remember now are:
1. What is Fedora??
2. How to make money from FOSS projects??
3. When FOSS project's codes are open to be changed by anyone, what about the security from harmful code, if someone intentionally adds a harmful code??
4. About Fedora bugs and where to report, etc

Conclusion and Suggestion:

I think we need to create a mailing list or fedora-wbut group for wbut-students on fedora (if possible). Since for each and every fedora release there is at-least one fedora event by WBUT students. But, these events lacks co-ordinators, also searching for them before event is almost not possible due to exams, campussing, college etc. I guess a group or mailing list will be best to bind them all at a common place.

Reset Cisco Router Password using Minicom

Suppose you have a cisco router with configuration and password set. Today, I am going to tell you how to reset the Cisco router using Minicom (linux application).

Install MiniCom in fedora:
To install minicom in fedora type
# yum install minicom

Configure Minicom:
The configuration has to be done as root or user with root privilege.
# minicom -s or #minicom -s -c on
The -c on will enable the colour mode on.

Use the 'Up/Down' arrow to select "Serial port setup" and press "Enter".
Now type A to change serial device. Here, you have to know which tty is assigned for serial port. To know that type,

$ dmesg | grep ttyS
[ 1.297446] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.297896] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

So, In this case tty for serail port is ttyS0.
Select "E", now change the "Bps/Par/Bits" to "Current: 9600 8N1"or something else by pressing "A" next or "B" previous or using default C = 9600, D = 38400 and E=115200. Press "Enter".
Select "F", to disable Hardware Flow Control and press "Enter" to save the settings and exit back to the configuration menu.

Use the "Up/Down" arrow to select the "Save setup as dfl".
Now, your configuration is saved.
From now type
$ minicom or minicom -c on
as a normal user to connect with the Router.

Note: for more info about available functions in minicom
$ minicom
Now, press Ctrl+A, then Z for help

Reset Password:
First, Power off the Cisco router then Power on again. When the moment after CISCO ISO will be Self decompressing the image, you have to send the router the break signal as it is booting. In minicom, press Ctrl+A then F to send break signal.
This should bring you to the "rommon" prompt:
rommon 1 >

Now, for the rest part I guess you already know and don't have to write here....
Thou, if you need I will write it for you.

Install multiple linux OS on a single PC

Now a days there are so many Linux distributions and also each of them has their own speciality. There are many users those who have dual boot OS(two different OS on a single machine). Many of my own friends have fedora/Ubuntu and Windows OS installed.

Today I am going to say about how to install fedora, Ubuntu, and Windows XP on a same PC.
1: Install XP
2: Install Ubuntu
3: Install fedora.

Note: When you install fedora after the installation of Ubuntu your Ubuntu's grub will be removed and you can't see Ubuntu on the Grub's list.

Now, to get the Ubuntu on the Grub's List follow these Steps:
1. boot with fedora
2. open terminal
$su -

as root type this command.
# fdisk -l

Hint: Check Column "System"
Lets /dev/sda3 partition contains your Ubuntu OS.
3. mount your Ubuntu partition.
# mount /dev/sda3 /mnt
4. Open the grub menu.lst file
# cd /mnt/boot/grub
# gedit menu.lst
Now search for similar lines:

title Ubuntu 8.10, kernel
uuid 84c1144f-93ff-4f12-8a6a-90f12f51421c
kernel (hd0,2)/boot/vmlinuz- root=UUID=84c1144f-93ff-4f12-8a6a-90f12f51421c ro quiet splash
initrd (hd0,2)/boot/initrd.img-

title Ubuntu 8.10, kernel (recovery mode)
uuid 84c1144f-93ff-4f12-8a6a-90f12f51421c
kernel (hd0,2)/boot/vmlinuz- root=UUID=84c1144f-93ff-4f12-8a6a-90f12f51421c ro single
initrd (hd0,2)/boot/initrd.img-

title Ubuntu 8.10, memtest86+
uuid 84c1144f-93ff-4f12-8a6a-90f12f51421c
kernel (hd0,2)/boot/memtest86+.bin

Copy these lines and paste these inside the fedora's grub menu list file:
# gedit /boot/grub/menu.lst
now restart fedora OS
This time you can see few more options on your Grub's List.

Setting custom Prompt

As much as I know maximum linux family's users were Windows users previously or using Linux parallel with Windows/Mac OS. I was too a Windows user previously, now fully switched to Linux.
In Windows, we have seen prompt command in command prompt(cmd) to change the prompt of the cmd.

Today I am going to discuss about same thing for linux.
In Linux, PS1 shell variable sets the prompt. We can use this variable to set our own custom prompt with the use of special escaped sequences.
Here, are few common escape sequences:
\h - short hostname
\u - username
\w - current working directory
\! - history number of the current command
\$ - this shows the privilege i.e for root users # and for non-root users $
Setting custom prompt using special escaped sequences:
1. temporary change:
$ PS1="\u@\h: \w \$" this will give you prompt something like this:
prabindatta@localhost: /home/prabindatta $

2. to make this change permament:
$ vi /.bashrc
at the end append your line something like this:
PS1='\u@\h: \w \$'

Install ns-2 Simulator in fedora 13

What is ns-2 Simulator??

Ns is a discrete event simulator targeted at networking research. Ns provides substantial support for simulation of TCP, routing, and multicast protocols over wired and wireless (local and satellite) networks.


First you need to download ns-2 Simulator
link: NS-2 Simulator Download


Before your ns-2 installation few packages must be already installed. Required packages (for fedora only) are:
1. yum install gcc.
2. yum install tcl-devel.
3. yum install libX11-devel.
4. yum install libXt-devel.
This is an important for f14 users. Fedora 14 users have to do some changes in the code of ns-2.34 (inside some .cc files) before install.
For eg:. lets take an example code "Test::Test(para1, para2).value();" it has to be changed into "Test(para1,para2).value();"


1. Unarchive the downloaded file "ns-allinone-2.34.tar.gz" into /opt
$ tar -xvf ns-allinone-2.34.tar.gz
2. open terminal type
$ cd /opt/ns-allinone-2.34/
3. Start the installation process
$ ./install
4. At the end of installation you can see few lines like:
Libraries have been installed in:

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and manual pages.
..................(few lines)
Please put /opt/ns-allinone-2.34/bin:/opt/ns-allinone-2.34/tcl8.4.18/unix:/opt/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.


1. You MUST put /opt/ns-allinone-2.34/otcl-1.13, /opt/ns-allinone-2.34/lib, into your LD_LIBRARY_PATH environment variable. If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH. If you are using csh, you can set it like: setenv LD_LIBRARY_PATH If you are using sh, you can set it like: export LD_LIBRARY_PATH= 2. You MUST put /opt/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.

Setting the environment variables:

Add all these lines into your ~/.bashrc file:
export PATH=$PATH:"/opt/ns-allinone-2.34/bin:/opt/ns-allinone-2.34/tcl8.4.18/unix:/opt/ns-allinone-2.34/tk8.4.18/unix"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/opt/ns-allinone-2.34/otcl-1.13:/opt/ns-allinone-2.34/lib"
export TCL_LIBRARY=$TCL_LIBRARY:"/opt/ns-allinone-2.34/tcl8.4.18/library"

Validate successful installation:

After these steps, you can run the ns validation suite with
$cd ns-2.34; ./validate

1. Now its time to check if your installation is really successful. You can do so by:
$ cd /opt/ns-allinone-2.34/ns-2.34
$ ./validate (this will take some time)

Convert a partition

Convert ext2 -> ext3
Suppose you want to convert your /tmp partition into ext3 then follow the following step:-
1. # init 1(Single user mode)
2. un-mount your partition which you like to convert
# umount /tmp
# mount -o remount,rw /tmp
3. command to convert
# tune2fs -j /dev/sda6 (Here /dev/sda6 represent /tmp must check using fdisk -l command)
This command add .journal file into /tmp partition.
4.Open /etc/fstab file change partition type of /tmp into ext3.
5.Now check file system type using following command:-
# file -s /dev/sda9
6.# init 6(Restart)

Convert from ext 3 -> ext2
Suppose you want to convert your /tmp partition into ext2 then follow the following step:-

1.# init 1(single user mode)
2. un-mount your partition which you like to convert
# umount /tmp
# mount -o remount,ro /tmp(better choice)
3. command to convert
# tune2fs -O^has_journal /dev/sda9 (Here /dev/sda9 represent /tmp partition)
4.# e2fsck /dev/sda9
5.# rm -f /tmp/.journal (Removing .journal file)
6.Open /etc/fstab file change partition type of /tmp into ext2.
7.Check partition type of /dev/sda9 using following command:-
# file -s /dev/sda9
8.# init 6(Restart)

Add a partion with linux

How to add a partition with linux??
If your linux OS has very low space and also you have extra/free space in your HDD which you can add with linux just follow the simple steps:
$ su
# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x15c415c3

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5100 40959734+ 7 HPFS/NTFS
/dev/sda2 5100 10199 40960000 7 HPFS/NTFS
/dev/sda3 10199 15298 40960000 83 Linux (going to format this partition since this partition contains other files which I want to delete)
/dev/sda4 * 15299 18944 29284352 83 Linux
/dev/sda5 18944 19458 4122624 82 Linux swap / Solaris

# mkfs.ext3 /dev/sda3
mke2fs 1.41.10 (10-Feb-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
2564096 inodes, 10240000 blocks
512000 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
313 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

# vi /etc/fstab
append this line (make your modifications as your needs)
/dev/sda3 /disk1 ext3 defaults 1 2

/dev/sda3 is your formatted partition
/disk1 is your directory name like /opt, /home, /usr
ext3 is your partition type, check above that /dev/sda3 is formatted to ext3 format

Note: for more info check man pages for fdisk, mkfs.ext3 and fstab

HP Printer's Driver

Last Monday, on 30th August 2010, my friend came to my home with his new HP Laser printer, he don't know how to remove the stickers from inside. Like to add here, 1st time removing those stickers are no 'so easy', normally a 'normal person' has fear to do that alone. After that I have successfully removed those. Now, he requesting me to check if the printer is working properly or not. I have fedora 13 as default OS plus another open source linux. HP provides a printer's driver CD for windows.

On that moment I was unaware how to work with this on linux. Here goes the solution:

1. Online installation:

Go to:
Now, Click on Download HPLIB
this will take you to .
From this page select your distribution, for fedora:
Step1 :Select Distribution: Fedora
Step 2: Select Version: 12 (don't worry if you are using fedora 13)
Step 3: Select Printer Type:<select your printer type> (OfficeJet/ Deskjet/ LaserJet/...)
Step 4: Select Printer Model:<select your printer's model no.> (p1007/ 2100d /...)
After filling all the above click twice or thrice Next.
Now, Under the Topic "Installer Walkthrough"
Step 1:
Click on Download HPLIP to download the installer file in your HDD.
Now, follow all the guide lines given below on that page.

2. Offline installation:

Download these packages from outside source(for fedora 13):
* cups-devel (CUPS devel- Common Unix Printing System development files)
* libusb (libusb - USB library)
* libjpeg (libjpeg - JPEG library)
* libcrypto (libcrypto - OpenSSL cryptographic library)
* libnetsnmp-devel (libnetsnmp-devel - SNMP networking library development files)
* pyqt4-dbus (PyQt 4 DBus - DBus Support for PyQt4)
* pyqt4 (PyQt 4- Qt interface for Python (for Qt version 4.x))
* reportlab (Reportlab - PDF library for Python)
* dbus (DBus - Message bus system)
* sane-devel (SANE - Scanning library development files)
* pil (PIL - Python Imaging Library (required for commandline scanning with hp-scan))
* xsane (xsane - Graphical scanner frontend for SANE)
* cups-ddk (CUPS DDK - CUPS driver development kit)

Note: Updated package list for fedora 14:
* libjpeg-turbo in place of libjpeg
* libjpeg-turbo-devel
* openssl-devel
* net-snmp-devel
* libusb-devel
* python-devel
* xsane (xsane - Graphical scanner frontend for SANE)
* sane-backends-devel
* dbus-devel
* libtool
After successfully installation of all the above package send me a mail requesting for off-line package for HP printer's driver.


Security problems:
read from below link to make your data secure->
Hacking Network Printers

For Online Configuration:
type http://:port
from this page your can add printer, search onlone help, check printer status, etc.
I am not going on details since you can find all those of your own.

Commands used/related with printers:
For a parallel printer the device name is usually /dev/lp0 and for a USB printer the name is usually /dev/usb/lp0.

View the content of the Printer Queue
$ lpq
HP_LaserJet_P6100 is ready

System Printer's Status (Ipstat-> list all printers)
$ lpstat -p -d
printer HP-OfficeJet_6100 is idle. enabled since Sun 05 Sep 2010 01:19:39 AM IST
system default destination: HP-OfficeJet_6100

Other commands:
cancel(1), lp(1), lpadmin(8), lpoptions(1), lprm(1), lpstat(1)
use man to find details on each.

Check Hardware and few linux's commands

few handy linux command and check hardware

CPU info:

$ cat /proc/cpuinfo

Running kernel version

$ uname -r

Version of most installed applications:
$ gcc -v
$ gcc --version

What is the running kernel and compiler installed
$ cat /proc/version

X server, X Protocol, Build Operating System version and and Kernel command line:
$ X -showconfig

What pci cards are installed and what irq/port is used
$ cat /proc/pci

What kernel modules are loaded

Memory and swap information
detail-> $ cat /proc/meminfo
short info-> $ free or $ free -m (output in megabits)

Hard drives partitiontion
$ fdisk -l

Free/used drive space
$ df -h

Show disk usage by current directory and all subdirectories
$ du | less or $du | more

What takes up so much space on your box
Run from the directory in question and the largest chunk shows up last
$ find $1 -type d | xargs du -sm | sort -g

What is the distribution
$ cat /etc/issue
$ cat /etc/

For finding or locating files
$ find <location to search (path)> -name <starting string of file name which you want to search>
$ locate <file name>
$ which <file name> (search in all path available in PATH)
$ whereis [-bmsu] [-BMS directory... -f] filename...
where b:Search only for binaries. m:Search only for manual sections.
s:Search only for sources. u: Search for unusual(not b:m:s) entries.

Use dmesg to view the kernel ring buffer (error messages)
$ dmesg | less or $ dmesg | more

Watch error messages as they happen (sysklog needed)
as root,
$ tail -f /var/log/messages (this will shows last 10 lines, use a number in front of f for more lines)

list all processes running
$ ps -A

Find a process by name
$ ps -ef | grep -i <plain text>
$ ps -ef | grep sendmail

See current environment list, or pipe to file
$ env | more
$ env > environmentvariablelist.txt

Show current userid and assigned groups
$ id

See all command aliases(shortcut command for a long command) for the current user
$ alias

rpms installed on current
$ rpmquery --all | less
$ rpmquery --all > <filename>
$ rpmquery --all | grep -i <plaintext>

Present Working Directory:

Get ls in less
ls --color=always | less -R


The /proc/ directory contains a hierarchy of special files which represent the current state of the kernel — allowing applications and users to peer into the kernel's view of the system.

Look at man <command> or info <command> for other options you can use for bash commands.

Lock a folder(/directory)

Sometime it happens in few cases that you are sharing a common pc and an user account with others. It may happen that you want few of your data to keep away the reach of other users.

use the below code with some modification(where specified) to lock your folder:
#! /bin/bash

# Use the bash shell to run the script

cd <path to folder>

i=$(ls -al | grep "<folder name>")


echo "$j"

if [ "$j" == 'drwxr-xr-x' ]; then

chmod 000 <folder name>

elif [ "$j" == 'd---------' ]; then

chmod 755 <folder name>


i=$(ls -al |grep '<folder name>')

echo " -> ${i:0:10}"
Now, place the above file on the same directory which you want to lock.

now type(in terminal):

1. $ cd <path to directory where your file exists>

2. $ chmod 500

3. $ ./

from next time use $ ./ to lock and unlock your directory.

Manual Pages (man pages)

To read a man page the general command is:

$/# man <command>


$ man ifconfig

The above command gives you a name, synopsis, note short description about the command, list of options with that command and author . At the same time you can see something like this on first line for ipconfig:

IFCONFIG(8) Linux Programmer’s Manual IFCONFIG(8)

IFCONFIG(8) denotes name(section) here the name: IPCONFIG and section: 8.

Linux Programmer's Manual denotes section means section 8 is Linux Programmer's Manual.

Now, a question may come in your mind what is sections??

The manual pages are categorised into sections. There are 8 sections in fedora 13.

The standard sections of the manual include:
1 User Commands
2 System Calls
3 C Library Functions
4 Devices and Special Files
5 File Formats and Conventions
6 Games et. Al.
7 Miscellanea
8 System Administration tools and Deamons.

Tips and tweet:

1. Suppose you want to find info about a C command. You have reduce the search time of man pages by using this format:

$ man 3 <C command>

eg: $ man 3 scanf

2. Convert man pages to any other format.

$ man -t <command>

The above command returns in postscript format. Now using the below command we can convert a man page to pdf file.

eg: $ man -t ifconfig | ps2pdf -> ifconfig.pdf

3. An equivalent command of whatis:

$ man -f <command>


$ man -f man
man (1) - format and display the on-line manual pages
man (1p) - display system documentation
man (7) - macros to format man pages
man-pages (7) - conventions for writing Linux man pages
man.config [man] (5) - configuration data for man

$ man -f ifconfig
ifconfig (8) - configure a network interface

In the above two commands, 1st command searches and returns 5 man pages and second command return only one man page.

4. Search an string (or word) in all man pages(inside a man page).

$ man -K <command>

Note: This command takes a long time.

Install realplayer in fedora

Today I am going to write about how to install RealPlayer11GOLD.rpm in fedora 13. Before Installation 1st thing which you need is the RealPlayer11GOLD.rpm package. You can download package from:


Now steps to installs:

1. $su -

password:<your default user's password.>

2.#rpm -ivh <path to rpm package>/RealPlayer11GOLD.rpm

3.Exit (if you want, you can install this package as root(super user) also)

3.$cd /opt/real/RealPlayer


after this you can see GUI to install realplayer.

5.Now you can run RealPlayer by typing this commond:

$cd /opt/real/RealPlayer


Best Of Luck!

if you face any problem free to give your comments...