Monday, October 6, 2008

Finding Files

You now know what each major directory holds, but it still doesn’t really help you find things. I mean, you could go looking through directories, but there are quicker ways. There are four main file search commands.

which
The first is the which(1) command. which is usually used to locate a program quickly. It just searches your PATH and returns the first instance it finds and the directory path to it. Take this example:

% which bash
/bin/bash

From that you see that bash is in the /bin directory. This is a very limited command for searching, since it only searches your PATH.

whereis
The whereis(1) command works similar to which, but can also search for man pages and source files. A whereis search for bash should return this:

% whereis bash
bash: /bin/bash /usr/bin/bash /usr/man/man1/bash.1.gz

This command not only told us where the actual program is located, but also where the online documentation is stored. Still, this command is limited. What if you wanted to search for a specific configuration file? You can’t use which or whereis for that.

find
The find(1) command allows the user to search the filesystem with a rich collection of search predicates. Users may specify a search with filename wildcards, ranges of modification or creation times, or other advanced properties. For example, to search for the default xinitrc¤ FORMTEXT
file on the system, the following command could be used.

% find / -name xinitrc
/var/X11R6/lib/xinit/xinitrc

find will take a while to run, since it has to traverse the entire root directory tree. And if this command is run as a normal user, there will be permission denied errormessages for directories that only root can see. But find found our file, so that’s good. If only it could be a bit faster...

slocate
The slocate(1) command searches the entire filesystem, just like the find command can do, but it searches a database instead of the actual filesystem. The database is set to automatically update every morning, so you have a somewhat fresh listing of files on your system. You can manually run updatedb(1) to update the slocate database (before running updatedb by hand, you must first su to the root user). Here’s an example of slocate in action:

% slocate xinitrc # we don’t have to go to the root
/var/X11R6/lib/xinit/xinitrc
/var/X11R6/lib/xinit/xinitrc.fvwm2
/var/X11R6/lib/xinit/xinitrc.openwin
/var/X11R6/lib/xinit/xinitrc.twm

We got more than what we were looking for, and quickly too.With these commands, you should be able to find whatever you’re looking for on your Linux system.

Wednesday, September 10, 2008

Adobe Acrobat Reader

Pdf is the most popular document now. Its simply, light and compatible with many system.

Ubuntu has default pdf reader when we installed it, but adobe acrobat is the most popular reader.

Now, its shows how to install it in ubuntu.

1. Open terminal

2. sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list

3. sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

4. sudo apt-get install acroread

LISTING FILES

• "ls" command
- Linux command used to list the files in a given directory
- Most common method for displaying files
- Displays all the files in the current directory in columnar format

• "ll" command
- Alias for the ls -l command
- Gives a long file listing

• File command
-Linux command that displays the file type of a specified filename

• Text file
- File that stores information in a readable text format
• Some filenames inside each user’s home directory represent important configuration
files or program directories
• Hidden files
– Files that are not normally displayed to the user via
common filesystem commands

List option :
-a or --all = list all filenames
-A or --almost-all = List most filenames (excludes the . and .. special files)
-C = lists filenames in column format
--color=n = list filenames without sorting
-f = lists all filenames without sorting
-F or --classify = lists filenames classified by file type
--full-time = lists filenames in long format and displays the full modification time
-l = lists filenames in long format
-lh or -l --human-readable = lists filenames in long format with human-readable (easy-to-read)
-lG or -l --no-group or -o = lists filenames in long format but omits the group information
-r or --reverse = list filenames reverse sorted
-R or --recursive = lists filenames in the specified directory and all subdirectories
-s = lists filenames and their associated size in kilobytes (K)
-S = lists filenames sorted by file size
-t = lists filenames sorted by modification time
-U = lists filenames without sorting
-x = lists filenames in rows rather than in columns

Wednesday, August 27, 2008

VMware Virtual Machine on Ubuntu 8.04

Running other OS on ubuntu is a great moment. We could use virtualbox ose, xen or use vmware. I think vmware is more interesting because it doesnt need special linux-header like xen or virtualbox. You could get vmware server freely from its website and you could request serial number freely too.

Step for installing and using vmware :
1. Download the file Vmware-server-1.0.6-91891.tar.gz which size is 102MB from vmware website.
2. Request free serial number from vmware too.
3. Open the folder which contain the vmware and extract it or open terminal and extract it by type sudo tar -xvf Vmware-server-1.0.6-91891.tar.gz
4. cd vmware-server-distrib (folder which contain file extract)
5. ./vmware-install.pl
6. Follow all installer command until finish
7. Run vmware from root
root@hardy:/# vmware

Note :
When you see this message :
/usr/lib/vmware/bin/vmware /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1:version 'GCC_3.4' not found (required by /usr/lib/libcairo.so.2)
.........
.........
Remove the folder libgcc_s.so.1 on /usr/lib/vmware/lib

8. From the first windows choose Localhost
9. Goto 'Help' and choose 'Enter Serial Number'
10. Without serial number, you can not running virtualization
11. Click “Create a new virtual machine”
12. Select “Typical” on Virtual Machine Configuration
13. Choose guest operating system
14. Define the virtual machine name and location
15. Choose network connection
16. Specify disk size
17. Finish
18. Now you could install the new operating system

Monday, August 18, 2008

Setting Connexant Winmodem on Ubuntu 8.04

Step for installing winmodem on ubuntu hardy heron
1. sudo apt-get update
2. sudo apt-get install libc6-dev_2.5-0ubuntu14_i386.deb
3. sudo apt-get install build-essential linux
4. Download alsa driver :
wget http://www.linuxant.com/alsa-driver/alsa-driver-linuxant_1.0.16.1-1_all.deb
Install:
sudo dpkg -i alsa-driver-linuxant_1.0.16.1-1_all.deb
5. Download conexant hsf modem
wget http://www.linuxant.com/drivers/hsf/full/archive/hsfmodem-7.68.00.09full/hsfmodem_7.68.00.09full_i386.deb.zip
Unzip:
sudo unzip hsfmodem_7.68.00.09full_i386.deb.zip
Install :
sudo dpkg -i hsfmodem_7.68.00.09full_i386.deb
6. Download hsfpatch (http://arisusanto.com/images/fbfiles/files/hsfuniversalpatch_1.gz)
Copy hsfpatch to /usr/lib/hsfmodem/
Goto /usr/lib/hsfmodem/ and execute hsptch with comand : ./hsfpatch
Use email and license key which generate by hsfpatch
Example :
email : tux@kernel.org
License key : BADCAFE4742B
7. sudo hsfconfig -license
Enter the email and key license which get from hsfpatch
The result:
Config for modem unit 0: /dev/ttySHSF0
Device instance: 0-HDA-14f15045:103c30b2-0
HW revision : SSD=34 LSD=0×22
HW profile name: hsfhda
Registration ID: E15A-8140-4FDE
License owner : tux@kernel.org
License key : BA-DC-AF-E4-74-2B
License status : free (14.4 kbps)
Current region : INDONESIA (T.35 code: 0054)

8. If the license status is still free, do this step
- sudo hsfconfig
- Enter, if request : use the current, email, and license key
Result :
Config for modem unit 0: /dev/ttySHSF0
Device instance: 0-HDA-14f15045:103c30b2-0
HW revision : SSD=34 LSD=0×22
HW profile name: hsfhda
Registration ID: E15A-8140-4FDE
License owner : tux@kernel.org
License key : BA-DC-AF-E4-74-2B
License status : OK
Current region : INDONESIA (T.35 code: 0054)
9. Edit the init in /etc/wvdial.conf
init=AT&FW3+MS=V90,1,28800,33600,28800,56000
10. Connect to the internet is succesfully

Howto reconfigure broken grub

When our grub is broken because of install new windows or our MBR is broken, so we can’t boot on linux.

To normalize grub we can do 2 ways, by using Live CD or we can enter into linux terminal.

For the first time we have to boot by live cd and next we have to do:
1. Open terminal
2. sudo grub
3. grub> find /boot/grub/stage1
(hd0,0)
4. grub> root (hd0,0)
5. grub> setup (hd0)
6. quit
7. Reboot

Instal gnome-ppp

1. #apt-get install gnome-ppp

2. Open gnome ppp in Applications -> Internet -> Gnome PPP

3. Type username and password

4. Type phone number

5. Open Setup

6. Detect modem device

7. Open init string

8. Change init 2 with “AT&FW3+MS=V90,1,28800,33600,28800,56000″

9. Close setup configuration

10. Connect to the world