user-avatar
Today is Thursday
November 28, 2024

October 13, 2009

What does the alphabets on the left of aptitude search command output mean?

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

If you are reading the article as you were searching for an answer to the question mentioned in the subject, that means you are not a regular user of “man” command or you were not satisfied with the info given in man page of aptitude command. The following is an excerpt from the man page of aptitude command and hence dont bother to read if you have already gone through it thorughly. If you have not, then from next time spend more time reading man pages. They are the best tutorials.

However here is the excerpt:::

Unless you pass the -F option, the output of aptitude search will look something like this:

i apt – Advanced front-end for dpkg
pi apt-build – frontend to apt to build, optimize and in
cp apt-file – APT package searching utility — command-
ihA raptor-utils – Raptor RDF Parser utilities

Each search result is listed on a separate line. The first character of each line indicates the current state
of the package: the most common states are p, meaning that no trace of the package exists on the system, c,
meaning that the package was deleted but its configuration files remain on the system, i, meaning that the
package is installed, and v, meaning that the package is virtual. The second character indicates the stored
action (if any; otherwise a blank space is displayed) to be performed on the package, with the most common
actions being i, meaning that the package will be installed, d, meaning that the package will be deleted, and
p, meaning that the package and its configuration files will be removed. If the third character is A, the
package was automatically installed.

For a complete list of the possible state and action flags, see the section “Accessing Package Information” in
the aptitude reference guide. To customize the output of search, see the command-line options -F and –sort.

October 12, 2009

Single, Master and Slave Drives and Jumpering

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

Courtsey: http://www.pcguide.com/ref/hdd/if/ide/confJumpering-c.html

Why I came across the below article?

When I was trying to install Ubuntu 9.10 (Karmic Koala) beta release installation on my system, I faced a peculiar problem. When I connected the CD Drive and my IDE HDD on a single IDE channel, BIOS was not detecting any of the hardware. However when connected individually, BIOS was able to detect both drives. I first felt that the IDE channel was not working and hence changed it and tried it again but again the same problem. Then I also changed the CPU and tried it on some other CPU thinking that my BIOS might have some problem( ya ya I am an idiot but sometimes inexpirience is very costly, however most people learn only the hard way). Then I finally gave up and asked my senior about it and that is when I found about the problem of master and slave and understood that it was a simple matter of changing the jumper and configuring one as master and other as slave. Anyways I now hope that nobody in future will find that dificulty and hopefully this whole article(along with the article from pcguide )will be useful.

Each IDE/ATA channel can support either one or two devices. IDE/ATA devices of course each contain their own integrated controllers, and so in order to maintain order on the channel, it is necessary to have some way of differentiating between the two devices. This is done by giving each device a designation as either master or slave, and then having the controller address commands and data to either one or the other. The drive that is the target of the command responds to it, and the other one ignores the command, remaining silent.

Note that despite the hierarchical-sounding names of “master” and “slave”, the master drive does not have any special status compared to the slave one; they are really equals in most respects. The slave drive doesn’t rely on the master drive for its operation or anything like that, despite the names (which are poorly-chosen–in the standards the master is usually just “drive 0” and the slave “drive 1”). The only practical difference between master and slave is that the PC considers the master “first” and the slave “second” in general terms. For example, DOS/Windows will assign drive letters to the master drive before the slave drive. If you have a master and slave on the primary IDE channel and each has only one regular, primary partition, the master will be “C:” and the slave “D:”. This means that the master drive (on the primary channel) is the one that is booted, and not the slave.

Devices are designated as master or slave using jumpers, small connectors that fit over pairs of pins to program the drive through hardware. Each manufacturer uses a different combination of jumpers for specifying whether its drive is master or slave on the channel, though they are all similar. Some manufacturers put this information right on the top label of the drive itself, while many do not; it sometimes takes some hunting around to find where the jumper pins are on the drive even once you know how the jumpers are supposed to go. The manufacturers are better about this now than they have been in the past, and jumpering information is always available in the manual of the hard disk, or by checking the manufacturer’s web site and searching for the model number. I describe (and illustrate) the jumpers on IDE/ATA disks in detail in the section on hard disk construction. For a fundamental description of what jumpers are, see here.

ATAPI devices such as optical, Zip and tape drives are jumpered in pretty much the same way as hard disks. They have the advantage of often having their jumpers much more clearly labeled than their hard disk counterparts. Most optical drives, for example, have three jumper blocks at the back, labeled “MA” (master), “SL” (slave) or “CS” (cable select).

If you are using two drives on a channel, it is important to ensure that they are jumpered correctly. Making both drives the master, or both the slave, will likely result in a very confused system. Note that in terms of configuration, it makes no difference which connector on the standard IDE cable is used in a standard IDE setup, because it is the jumpers that control master and slave, not the cable. This does not apply when cable select is being used, however. Also, there can be electrical signaling issues if one connects a single drive to only the middle connector on a cable, leaving the end connector unattached. In particular, the use of Ultra DMA is not supported in such a configuration; see the discussion of the 80-conductor Ultra DMA cable for more information.

As long as one drive is jumpered as master and the other as slave, any two IDE/ATA/ATAPI devices should work together on a single channel. Unfortunately, some older hard disks will fail to work properly when they are placed on a channel with another manufacturer’s disk. One of the reasons why drives don’t always “play nicely together” has to do with the Drive Active / Signal Present (/DASP) signal. This is an IDE/ATA interface signal carried on pin #39, which is used for two functions: indicating that a drive is active (during operation), and also indicating that a slave drive is present on the channel (at startup). Some early drives don’t handle this signal properly, a residue of poor adherence to ATA standards many years ago. If an older slave drive won’t work with a newer master, see if your master drive has an “SP” (slave present) jumper, and if so, enable it. This may allow the slave drive to be detected.

Drive compatibility problems can be extremely frustrating, and beyond the suggestion above, there usually is no solution, other than separating the drives onto different channels. Sometimes brand X won’t work as a slave when brand Y is the master, but X will work as a master when Y is the slave! Modern drives adhere to the formal ATA standards and so as time goes on and more of these older “problem” drives fall out of the market, making all of this less and less of a concern. Any hard disk bought in the last five years should work just fine with any other of the same vintage or newer.

When using only a single drive on a channel, there are some considerations to be aware of. Some hard disks have only a jumper for master or slave; when the drive is being used solo on a channel it should be set to master. Other manufacturers, notably Western Digital, actually have three settings for their drives: master, slave, and single. The last setting is intended for use when the drive is alone on the channel. This type of disk should be set to single, and not master, when being used alone.

Also, a single device on an IDE channel “officially” should not be jumpered as a slave. In practice, this will often work despite being formally “illegal”. Many ATAPI drives come jumpered by default as slave–because they are often made slaves to a hard disk’s master on the primary IDE channel, this saves setup time. However, for performance reasons they are sometimes put on the secondary channel, and often the system assemblers don’t bother to change the jumpers. It will work, but I don’t recommend it; if nothing more, it’s confusing to find a slave with no master when you or someone else goes back into the box a year or two later to upgrade.

For performance reasons, it is better to avoid mixing slower and faster devices on the same channel. If you are going to share a channel between a hard disk and an ATAPI device, it is generally a good idea to make the hard disk the master. In some situations there can be problems slaving a hard disk to an optical drive; it will usually work but it is non-standard, and since there is no advantage to making the ATAPI device the master, the configuration is best avoided.

There are many more performance considerations to take into account when deciding how to jumper your IDE devices, if you are using several different ones on more than one channel. Since only one of the master and slave can use any channel at a time, there are sometimes advantages to using more than one IDE/ATA channel even if not strictly necessary based on the number of devices you are trying to support. There can also be issues with using a drive that has support for a fast transfer mode like Ultra DMA with older devices that don’t support these faster modes.

October 6, 2009

import mysql query into csv

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

When you want to import the results of a query into a csv, you can use the following mysql query.

SELECT a,b,a+b INTO OUTFILE ‘/tmp/result.text’
FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘
LINES TERMINATED BY ‘n’
FROM test_table;

October 5, 2009

LDAP LDAP LDAP

by viggy — Categories: Uncategorized — Tags: , Leave a comment

Install::

To run a LDAP server, you need to install slapd package.
To do various work on LDAP, you need libldap and ldap-utils package.

While installing you are asked for a DN, which will be the main path for your LDAP server. IT is something similar to domain names, and the DN that you specify will be the name of the root of your LDAP directory. You will have to access the LDAP server using the DN.

Configuration::

the configuration of the slapd is stored in slapd.conf. This is a good document about slapd configuration file, http://www.openldap.org/doc/admin24/slapdconfig.html

Adding data::

Data can be added in the LDAP server using ldapadd and ldapmodify commands. You can either store the different data in a file and then supply the file as an argument to the ldapadd command or directly specify the data in ldapadd command.

Need to improve this post many times any folds.

October 4, 2009

Understanding software installation in linux, configure, make, make install

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

Courtsey:: http://www.codecoffee.com/tipsforlinux/articles/27.html

Each software comes with a few files which are solely for the purpose of installation sake. One of them is the configure script. The user has to run the following command at the prompt

$ ./configure

The above command makes the shell run the script named ‘ configure ‘ which exists in the current directory. The configure script basically consists of many lines which are used to check some details about the machine on which the software is going to be installed. This script checks for lots of dependencies on your system. For the particular software to work properly, it may be requiring a lot of things to be existing on your machine already. When you run the configure script you would see a lot of output on the screen , each being some sort of question and a respective yes/no as the reply. If any of the major requirements are missing on your system, the configure script would exit and you cannot proceed with the installation, until you get those required things.

The main job of the configure script is to create a ‘ Makefile ‘ . This is a very important file for the installation process. Depending on the results of the tests (checks) that the configure script performed it would write down the various steps that need to be taken (while compiling the software) in the file named Makefile.

If you get no errors and the configure script runs successfully (if there is any error the last few lines of the output would glaringly be stating the error) then you can proceed with the next command which is

$ make

‘ make ‘ is actually a utility which exists on almost all Unix systems. For make utility to work it requires a file named Makefile in the same directory in which you run make. As we have seen the configure script’s main job was to create a file named Makefile to be used with make utility. (Sometimes the Makefile is named as makefile also)

make would use the directions present in the Makefile and proceed with the installation. The Makefile indicates the sequence, that Linux must follow to build various components / sub-programs of your software. The sequence depends on the way the software is designed as well as many other factors.

The Makefile actually has a lot of labels (sort of names for different sections). Hence depending on what needs to be done the control would be passed to the different sections within the Makefile Or it is possible that at the end of one of the section there is a command to go to some next section.

Basically the make utility compiles all your program code and creates the executables. For particular section of the program to complete might require some other part of the code already ready, this is what the Makefile does. It sets the sequence for the events so that your program does not complain about missing dependencies.

One of the labels present in the Makefile happens to be named ‘ install ‘ .

If make ran successfully then you are almost done with the installation. Only the last step remains which is

$ make install

As indicated before make uses the file named Makefile in the same directory. When you run make without any parameters, the instruction in the Makefile begin executing from the start and as per the rules defined within the Makefile (particular sections of the code may execute after one another..thats why labels are used..to jump from one section to another). But when you run make with install as the parameter, the make utility searches for a label named install within the Makefile, and executes only that section of the Makefile.

The install section happens to be only a part where the executables and other required files created during the last step (i.e. make) are copied into the required final directories on your machine. E.g. the executable that the user runs may be copied to the /usr/local/bin so that all users are able to run the software. Similarly all the other files are also copied to the standard directories in Linux. Remember that when you ran make, all the executables were created in the temporary directory where you had unzipped your original tarball. So when you run make install, these executables are copied to the final directories.

Thats it !! Now the installation process must be clear to you. You surely will feel more at home when you begin your next software installation.

October 4, 2009

how to download an ftp link from browser

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

Let me first describe what was the problem faced by me?

I was in my friend’s laptop and ssh-ed in my system. Now i wanted to download a tar file from internet to my system. The link mentioned was a ftp link. When i tried to use wget, I got a permissioned denied error. So I was left with 2 options, either to download it in my friend’s lappy and then scp it into my system or download it using link2 console WWW browser. I chose the later even though it was my first time to try that.

First after starting links2 in console, using links2 command, we need to open the link where the download link is present. For that, the shortcut-key to get address bar is “g”. (Note that I first tried to directly open the ftp link assuming that it would directly download the file, but instead I came to know that links2 actaully tries to open that as a page and hence file does not get downloaded, hence no use). Now after you have entered the web-page, go to the download link. Now you can download the file by using the shorcut-key “d”. It gives you an option to rename the file that is being downloaded. After you have given it a suitable name, you are ready to download it. Note that the file is downloaded in the present working directory(the directory from where you executed the links2 command).
Also let me mention here that “esc” is the key to get the toolbar in links2 browser.

October 3, 2009

Why wedding ring should put on the fourth finger???

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

This is from a Chinese excerpt – really interesting.

Thumb represents parents
Second finger represents brothers & sisters
Center finger represents own self
Fourth finger represents your partner
Last finger represents your children

Follow the steps below:

¨ Firstly, show your palm, center finger bend and put together back to back

¨ Secondly, the rest 4 fingers tips to tips

Games begin, follow the arrangement below, 5 fingers but only 1 pair can split.

Try to open your thumb, the thumb represents parents, it can be open because all human does go thru sick and dead. Which are our parents will leave us one day.
Please close up your thumb and then open your second finger, the finger represent brothers and sisters, they do have their own family which is why they will leave us too.
Now close up your second finger, open up your little finger, this represents your children. Sooner or later they too will leave us for they got their own living to live.
Nevertheless, close up your little finger, try to open your fourth finger which we put our wedding ring; you will be surprised to find that it cannot be opened at all. Because it represents husband and wife, this whole life you will be attached to each other. Real love will stick together ever and forever….

October 1, 2009

difference between helo and ehlo

by viggy — Categories: Uncategorized — Tags: , , Leave a comment

HELO handles the basic SMTP commands, EHLO is “Enhanced HELO” and has more
features.

An advanced mailserver will send “EHLO …” — if the remote mailserver
doesn’t accept EHLO, then it will revert to HELO (which all mailservers
understand).

October 1, 2009

SMTP numeric codes

by viggy — Categories: Uncategorized — Tags: , Leave a comment

After you have set-up the connection with any SMTP server using telnet, you can try different commands, and they’ll be processed and responded to with numeric response codes.
These three-digit coded responses, like 220, may look familiar to Webmasters. The first digit indicates success or failure. 1 indicates a success requiring confirmation, 2 indicates complete success, and 3 indicates success so far, but that more input is expected. 4, the first failure code, is used for failures that may be temporary, such as the mail account existing but being locked; 5 indicates that the failure condition is permanent, such as a syntax error in the command. The second and third digits provide further details, but at the top level, all that matters is that 1xx, 2xx, and 3xx are good, and 4xx and 5xx indicate problems. (For further information on mail response codes, read RFC 1893.)

September 23, 2009

how to repair a mysql table using myisamchk

by viggy — Categories: Uncategorized — Tags: , , , Leave a comment

For some very easy repairs, this utility can be used.

myisamchk is an table-maintainence utility. It is used to repair corrupted mysql tables.

First, try myisamchk -r -q tbl_name (-r -q means “quick recovery mode”). This attempts to repair the index file without touching the data file. If the data file contains everything that it should and the delete links point at the correct locations within the data file, this should work, and the table is fixed. Start repairing the next table. Otherwise, use the following procedure:

1.

Make a backup of the data file before continuing.
2.

Use myisamchk -r tbl_name (-r means “recovery mode”). This removes incorrect rows and deleted rows from the data file and reconstructs the index file.
3.

If the preceding step fails, use myisamchk –safe-recover tbl_name. Safe recovery mode uses an old recovery method that handles a few cases that regular recovery mode does not (but is slower).

Courtsey: http://dev.mysql.com/doc/refman/5.1/en/repair.html