Archive

Archive for the ‘Open Source’ Category

Ubuntu 10.04 : Enable/Disable root account

August 3, 2010 3 comments

Well, today I had installed Ubuntu 10.04 and my immediate action was to change the root account password, I followed the usual method  “System>Administration>Users and Groups” but couldn’t find any way to change it. Then I realized that the root account might inactive by default. I found myself correct when I searched on web.
Now, if we wished to carry out something with root permission, we need to type the keyword ‘sudo’ before the command. ‘sudo’ means superuser do. When ever we use ‘sudo’, it will prompt for the ‘Password’, to which we need to enter the specific user password.

However, we can still enable the root account by using the following command

$sudo passwd root :- This will prompt for a new root password and once you confirm it, our root account will be activated. We can further log in to root user by using the command
$su (‘su’ stands for super user)
To disable or lock the root account we can use the following command
$sudo passwd -l root

What is inode??

January 30, 2010 3 comments

Have you ever thought or imagined on how does a linux system manages all your files in ur hard disk? Lets have a look, it uses a very simple concept of nodes. When a file is created, a data structure is created which contains information about the files. Each file is associated with an inode that is identified by an inode number. On many types of file systems the number of inodes available is fixed at file system creation. A typical fraction of space allocated for inodes in a file system is 1% of total size. From the inode number, the kernel can access the contents of the inode, including the data pointers, and so the contents of the file.
ls -i    (list the inode number of all the files and folder in the current directory)
ls -l    (this retrieve the inode information/file information)

File names and directory implications :-
1. Inodes do not contain file names, only metadata.
2. Unix directories are list of “link” structures, each of which contains one file name and one inode number.
3. The kernel must search a directory looking for a particular filename and then convert the filename to the correct corresponding inode number if the name is found

Some more implications :
1. If multiple names link to the same inode then all of them are equivalent. The first one to have beed has no special status. This is unlike the sometimes more familiar symbolic links, where all the links depend on the original name.

2. An inode can even have no links at all. Normally such a file would be removed from the disk and its resources freed for reallocation (normal process of delete), but if any process are holding the file open, they may continue to access it, and file will be finnaly deleted
when the last reference to it is closed.

3. It is not possible to map from an open file to the file name that was used to open it. The operating system would convert the filename to an inode number at the first possible chance, then forget the file name. This means that the getcwd() and getwd() library functions
would need to search the parent directory to find a file with an inode matching the working directory, then search that directory’s parent, and so on until reaching the root.

4. It is also possible to hard link the directories which leads to a directory structure into an arbitrary directed graph and this will have n-1 nodes edges for n nodes.

5. A file’s inode number will stay the same when it is moved to another directory on the same device, or when the disk is de-fragmented. Therefore, moving either a file’s directory entry or its data(or both) is not enough to prevent a running process from accessing it, if the
process ever had a chance of finding out the inode number.

6.Installation of new libraries is simple with inode file systems. A running process can have a library mapped whilst another process replaces the file, creating a new inode, and an all new mapping of the library will exst for the new file. This facilities eliminates the need
to reboot tp replace currently mapped libraries.

I hope it helps you understand the concept behind the file management..! :)

Connect Airtel-Mobile Office in Ubuntu!!?

November 26, 2009 2 comments

I am using Samsung SGH-L700 and I wanted to use Airtel Mobile Office in Ubuntu. Finally when I am succeeded in configuring it in Ubuntu. I would like to share it with everyone. Here are the steps:

Before proceeding you need to make sure that wvdial package is installed in your machine.

Step1:- Just type wvdial in terminal to check if it is installed. If yes, then proceed otherwise type the following command in terminal to install.

sudo apt-get install wvdial

Step2:- Now follow these commands :

wvdialconf

This will scan and detect the serial ports of the modem which is connected. It will then edit the file called wvdial.conf which is present in /etc/ .The expected output is :

Editing `/etc/wvdial.conf’.

Scanning your serial ports for a modem.

Modem Port Scan<*1>: S0   S1   S2   S3
ttyACM0<Info>: Device or resource busy
Modem Port Scan<*1>: ACM0
ttyACM1<Info>: Device or resource busy
Modem Port Scan<*1>: ACM1
WvModem<*1>: Cannot get information for serial port.
ttyACM2<*1>: ATQ0 V1 E1 — OK
ttyACM2<*1>: ATQ0 V1 E1 Z — OK
ttyACM2<*1>: ATQ0 V1 E1 S0=0 — OK
ttyACM2<*1>: ATQ0 V1 E1 S0=0 &C1 — OK
ttyACM2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 — OK
ttyACM2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK
ttyACM2<*1>: Modem Identifier: ATI — SAMSUNG SGH-L700
ttyACM2<*1>: Speed 4800: AT — OK
ttyACM2<*1>: Speed 9600: AT — OK
ttyACM2<*1>: Speed 19200: AT — OK
ttyACM2<*1>: Speed 38400: AT — OK
ttyACM2<*1>: Speed 57600: AT — OK
ttyACM2<*1>: Speed 115200: AT — OK
ttyACM2<*1>: Speed 230400: AT — OK
ttyACM2<*1>: Speed 460800: AT — OK
ttyACM2<*1>: Max speed is 460800; that should be safe.
ttyACM2<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 — OK

Found an USB modem on /dev/ttyACM2.
Modem configuration written to /etc/wvdial.conf.
ttyACM2<Info>: Speed 460800; init “ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0″

Step3:- Now its time to make some necessary changes in your wvdial.conf file in /etc/

sudo gedit /etc/wvdial.conf

Major changes required are Phone, Username & Password. Changes are as follow:

Read more…

Quick Reference to Linux Commands

August 14, 2009 1 comment

Many of us find it very difficult to remember the general linux commands(especially for a person with short term memory loss, like me ;-) ). Thus, everytime I Google for a particular command. I then thought of a page which will give a quick reference to the most common linux commands. Here it is–>

I will keep updating this page whenever i come across a command which is not included. I would request viewers to help me  increase the number…..

1. adduser :- This command will automatically add a new user to the system. The Bash script can be found in /usr/sbin if it needs to be changes.

2. alias :-

—–alias help=man – The alias command allows you to substitute a new name for a command.

—–alias long=ls -al – An alias can also contain command line options. Unless the alias definition is included in your

.login file it is only temporary.

3. apropos :- Display command names based on keyword search

4. at :-

—–at 1:23 lp /home/index.html – The at command runs a list of commands at a specified time (e.g. print @ 1:23).

—–at 1:50 echo “lp Job Done” – This uses the echo command to send a message at 1:50 saying a print job is done.

—–at -l – Lists all scheduled jobs; an alias for the atq command.

—–at -d 5555 – This will cancel job number 5555; an alias for the atrm command.

Read more…

Installation -> Ubuntu 9.04

July 11, 2009 1 comment

My assumption:-I am using vmware 6.0 to install my copy of ubuntu9.04(1 GB RAM, 1 GB swap space, 8 GB hard disk). You can make it dual boot with any other operating system also. Before installing any OS first decide the following:-

1. Decide the hard disk space?

2. Decide the swap space?

3. Decide the purpose and the amount of data you need to back up?

4. Decide whether your system will have only Ubuntu 9.04 or you planning to make it dual boot with any other OS?

Insert the Ubuntu 9.04 installation disk, restart your system and following screen will appear.(If you are using vmware then start your virtual machine). Follow the steps:-

STEP 1:-

Select the option ‘Install Ubuntu‘.

1

Read more…

Follow

Get every new post delivered to your Inbox.