Step 1
boot the machine using live cd.
Step 2
press ctrl+alt+F2.Now You are in non gui mode
Step 3
Type fdisk -l
Now you can see what are available partitions in hard disk.
lets assume you need to mount /dev/sda1
Step 4
make directroy to mount the harddisk partition
mkdir /test
Step 5
mount hard disk typing below command
mount /dev/sda1 /test
Step 6
now go to /test directory and you can do any file operation in that partition.
Type ls
cheers
kwak
This blog was opened by a team who love foss and is open for all those who love to contribute for foss development. All the foss lovers are most welcome to our blog. Take from it.Do not forget to contribute!
Monday, October 24, 2011
Monday, September 5, 2011
How to setup an apt-cacher in ubuntu 11.04?
Following is the scenario which we had to come up with an apt-cacher set up.
There are several machines Ubutnu 11.04 installed and each time one user needs a software installed he runs
sudo apt-get instal command and this is done by each user in each machine which would eats up the bandwidth.
Instead of that caching the installed software can have a dramatic impact on the use of bandwidth.Apt-cacher is a tool
which would act as middle man between the public repository and the LAN clients, sharing any common downloads internally.
i.e. whenever a user requests for a new installation or an update for the first time, the tool would download them from the public repository and store it and pass it back to that user. The package is then made available to any future requests from the internal network.When another user requests for the same installation instead of going to the public repository again it woul pass from what is already installed.
Setting up the apt-cacher is quite simple and is described below.
First we need apt-cacher and some tools installed.
Do a sudo aptitude install apt-cacher
sudo aptitude install apache2
To activate the service edit /etc/default/apt-cacher file and change the AUTOSTART value to "1".
You can also limit access to the cache within the /etc/apt-cacher/apt-cacher.conf file. Update the value for allowed_hosts to match the individual hosts or subnets that you want to allow.
To start the caching system type in cmdline, sudo /etc/init.d/apt-cacher restart.
Now you have the apt-cacher up and running.The final step is to set up the client.
Following is the scenario which we had to come up with an apt-cacher set up.
There are several machines Ubutnu 11.04 installed and each time one user needs a software installed he runs
sudo apt-get instal command and this is done by each user in each machine which would eats up the bandwidth.
Instead of that caching the installed software can have a dramatic impact on the use of bandwidth.Apt-cacher is a tool
which would act as middle man between the public repository and the LAN clients, sharing any common downloads internally.
i.e. whenever a user requests for a new installation or an update for the first time, the tool would download them from the public repository and store it and pass it back to that user. The package is then made available to any future requests from the internal network.When another user requests for the same installation instead of going to the public repository again it woul pass from what is already installed.
Setting up the apt-cacher is quite simple and is described below.
First we need apt-cacher and some tools installed.
Do a sudo aptitude install apt-cacher
sudo aptitude install apache2
To activate the service edit /etc/default/apt-cacher file and change the AUTOSTART value to "1".
You can also limit access to the cache within the /etc/apt-cacher/apt-cacher.conf file. Update the value for allowed_hosts to match the individual hosts or subnets that you want to allow.
To start the caching system type in cmdline, sudo /etc/init.d/apt-cacher restart.
Now you have the apt-cacher up and running.The final step is to set up the client.
Add a proxy setting to the /etc/apt/apt.conf.d/ directory. To do this is create a new file called 90-apt-proxy.conf and entering the line. Following would open up the file in gedit.
sudo gedit /etc/apt/apt.conf.d/90-apt-proxy.conf
Enter the following line to that file.
Acquire::http::Proxy "http://cache-ip:3142";
Replace "cache-ip " with the IP address or URL of the machine you installed apt-cacher in.
There is no limit of the no of machines you can point to the apt-cacher.
Before ending the post I must say thank you to this web post. It was very hard to find the exact information while we were working on this and hope this post would help those are in the same scenario.
Have a great day!: )
Monday, August 29, 2011
Integer and string Comparison in bash
Integer Comparison
There are 2 ways of comparing integers.
let's consider a and b as integer variables.
if [ "$a" -eq "$b" ] -checks weather $a equals to $b
if [ "$a" -ne "$b" ] -checks weather $a not equals to $b
if [ "$a" -gt "$b" ] or if(("$a" > "$b")) -checks weather $a is greater than $b
if [ "$a" -ge "$b" ] or if(("$a" >= "$b")) -checks weather $a is greater than or equal to $b
if [ "$a" -lt "$b" ] or if(("$a" < "$b")) -checks weather $a is less than $b
if [ "$a" -le "$b" ] or if(("$a" <= "$b")) -checks weather $a is less than or equal to $b
String Comparison
let's consider a and b as string variables.
if [ "$a" = "$b" ] -checks weather two strings are equal
if [ "$a" != "$b" ] -checks weather two strings are different
Useful built-in variables in bash
In bash scripting there are extremely useful build-in variables which we must know.
Given below are some of them.
$#-Number of arguments passed to the script.
$?-Exit status of the last command executed.
$!-Pid of the last command executed.
$$-Pid of the script.
Given below are some of them.
$#-Number of arguments passed to the script.
$?-Exit status of the last command executed.
$!-Pid of the last command executed.
$$-Pid of the script.
How to play sound files in bash
Playing sound files in bash is pretty simple.
All you have do is get install mplayer and execute the command.
sudo apt-get install mplayer
mplayer /path/to/sound/file
All you have do is get install mplayer and execute the command.
sudo apt-get install mplayer
mplayer /path/to/sound/file
Tuesday, August 23, 2011
How to add new menu to the applications menu in ubuntu
how to add new menu to the applications menu in ubuntu
most of us know that we can add new menu to applications menu by right clicking main menu bar and selecting edit menus.Then a window appears with existing menus and you can add any number of menus and items into them. This is a super simple approach which everyone can follow without much trouble.
But what if you need to edit menus programmatically.Do you know how to do it???
This is the guide for you if you need something like that.
first you need to identify the file which specifies the applications menu in ubuntu.It is applications.menu file located in /etc/xdg/menus/ directory.
locate it and examine bit carefully the tag structure in there.If you are familiar with HTML code tags you will understand it easily.
Follow these steps:
1.Open up a terminal and type sudo nautilus,give password,it will give you a file browser with root privilages. We need root privilages since we are going to edit applications.menu file.
2.open applications.menu file in your favourite text editor.You will see there are tag blocks for development,education,science etc. So what we should do is create our own code block which generates our custom menu. Example code block is given below.
< menu >
< name > MyMenuName < /name >
< directory> myMenu.directory < /directory>
< include>
< and>
< category> custom < /category>
< /and>
< /include>
< /menu>
3.place the above code block in between two existing code blocks. for example in between education and science.
Here is a brief description of what the above code really means:
< name> MyMenuName < name>
This tag defines the name of the menu which is self explanatory.But remember it is not the menu visible name in case we specify a name in myMenu.directory file.if we don't give a name in myMenu.directory file it is the menu visible name.The .directory file is explained in the next step.
<directory> myMenu.directory></directory>
There is a .directory file for each of the menus. So we should create a .directory file for our menu and it's name should be given here.
<include>
<and><
<category>custom></category>
/and>
</include>
This part is really important to understand since this determines which are the applications categorized under this menu.><category>custom></category> line indicates that all the applications which has category of "custom" are put in to this menu.
4.Next step is to create a .directory file for our menu.
example myMenu.directory file
[Desktop Entry]
Name=My apps
Comment=my Applications
Icon=/path/to/icon
Type=Directory
X-Ubuntu-Gettext-Domain=gnome-menus
Name specifies the visible name for our menu.And under icon give the path to the icon.
5.place this myMenu.directory file under /usr/share/desktop-directories.
now you are almost done.
6.The new menu will not visible straight-away since there are no items to display. So you can one of the things to get visible your new menu.
i.create your own debian package with category custom and get install it. After the installation new menu will appear with the new application under it.
If you need help in creating debian packages see the article "How to create debian packages".
ii.changecustom to office .then you will see your new menu but with all the office type applications under it.
Here office is used just as an example.
most of us know that we can add new menu to applications menu by right clicking main menu bar and selecting edit menus.Then a window appears with existing menus and you can add any number of menus and items into them. This is a super simple approach which everyone can follow without much trouble.
But what if you need to edit menus programmatically.Do you know how to do it???
This is the guide for you if you need something like that.
first you need to identify the file which specifies the applications menu in ubuntu.It is applications.menu file located in /etc/xdg/menus/ directory.
locate it and examine bit carefully the tag structure in there.If you are familiar with HTML code tags you will understand it easily.
Follow these steps:
1.Open up a terminal and type sudo nautilus,give password,it will give you a file browser with root privilages. We need root privilages since we are going to edit applications.menu file.
2.open applications.menu file in your favourite text editor.You will see there are tag blocks for development,education,science etc. So what we should do is create our own code block which generates our custom menu. Example code block is given below.
< menu >
< name > MyMenuName < /name >
< directory> myMenu.directory < /directory>
< include>
< and>
< category> custom < /category>
< /and>
< /include>
< /menu>
3.place the above code block in between two existing code blocks. for example in between education and science.
Here is a brief description of what the above code really means:
< name> MyMenuName < name>
This tag defines the name of the menu which is self explanatory.But remember it is not the menu visible name in case we specify a name in myMenu.directory file.if we don't give a name in myMenu.directory file it is the menu visible name.The .directory file is explained in the next step.
<directory> myMenu.directory></directory>
There is a .directory file for each of the menus. So we should create a .directory file for our menu and it's name should be given here.
<include>
<and><
<category>custom></category>
/and>
</include>
This part is really important to understand since this determines which are the applications categorized under this menu.><category>custom></category> line indicates that all the applications which has category of "custom" are put in to this menu.
4.Next step is to create a .directory file for our menu.
example myMenu.directory file
[Desktop Entry]
Name=My apps
Comment=my Applications
Icon=/path/to/icon
Type=Directory
X-Ubuntu-Gettext-Domain=gnome-menus
Name specifies the visible name for our menu.And under icon give the path to the icon.
5.place this myMenu.directory file under /usr/share/desktop-directories.
now you are almost done.
6.The new menu will not visible straight-away since there are no items to display. So you can one of the things to get visible your new menu.
i.create your own debian package with category custom and get install it. After the installation new menu will appear with the new application under it.
If you need help in creating debian packages see the article "How to create debian packages".
ii.change
Here office is used just as an example.
Tuesday, August 9, 2011
how to make a text file from terminel easily
how to make a text file from terminal easily
you have to do just only two small steps
step 1
open the terminal and go to location which you want to create a text file
step2
Type the command as below
cat > file.txt
now enter anything which should include inside of the file.txt
now press ctrl+d to save that file.
ok you are done.
cheers.......kwak
you have to do just only two small steps
step 1
open the terminal and go to location which you want to create a text file
step2
Type the command as below
cat > file.txt
now enter anything which should include inside of the file.txt
now press ctrl+d to save that file.
ok you are done.
cheers.......kwak
Subscribe to:
Posts (Atom)