Sunday, August 31, 2008

How to post your top 10 used terminal commands.

You need to use terminal on Linux often. Recently one Ubuntuforum member posted this code to know the top 10 terminal command used by you.
history | sed -e 's/  / /g' | cut -d " " -f3 | sort | uniq -c | sort -n | tail | sort -nr

You can copy the code and paste in the terminal and know the results.

Wednesday, August 20, 2008

Yamaha opl3sa2 sound card configuration through alsaconf on Debian Lenny.

I have mentioned about my old desktop Intel Pentium 200 Mhz MMX 32 MB RAM many times on this blog. This PC has a legacy ISA sound card Yamaha opl3sa2. Puppy Linux has the utility alsaconf which detects and configures this card correctly. I have 256 MB swap partition and Puppy Linux uses it, therefore, it is possible to take out the Puppy Linux CD and play an audio CD.

I have recently installed Debian Lenny on this desktop and wanted to configure the sound card. I installed alsa-utils package which contains alsaconf. Following are the steps:
$ su
Enter root password
# apt-get install alsa-utils

After installations I got alsaconf in Debian menu. I clicked on it and had to enter the root password once again.

The first screen read:
No supported PnP or PCI card found. Would you like to probe legacy ISA cards/chips
yes

Next screen:
Probing legacy ISA cards might make your system unstable. Are you sure to proceed.
yes

Next screen:
Probing legacy ISA cards. Please select the drivers to probe.
[*] opl3sa2 Yamaha OPL3SA2+

I deselected other drivers.

Next screen:
Shall I try all possible DMA and IRQ combinations? With this option, some unconventional configurations might be found, but it will take much longer time.
yes

Next screen:
Configuring opl3sa2. Do you want to modify /etc/modprobe.conf
yes

Next screen:
OK. Sound driver configured. ALSA mixer used to raise volume. You can change the volume later.
ok

Next screen:
The mixer is set up now for playing. Shall I try to play sound sample now?
yes

After sound card configuration I downloaded the command line CD player cdcd (it was dcd on earlier versions of Debian).

# apt-get install cdcd

Now I am happily playing an audio CD and surfing through Kazehakase (or elinks) on Debian Lenny IceWM desktop on 32 MB RAM.

Sunday, August 17, 2008

How to password protect a file on Linux?

This question is being asked by many Linux users on various forums. Today I searched on Google and found this solution on Linuxforums.org.

You can password protect a zip file. Proceed as follows:

Create a directory for this experiment, and name it test.
Copy a few files and paste them into this directory so it isn't empty.Now open a terminal and enter:$ zip -e -r test test
Enter password:Verify password:Delete the directory test.

Now you have a file test.zip which is password protected.
zip with -e option encrypts the contents of the zip archive using a password. This encrypts with standard pkzip encryption which is considered weak.

However, the job of protecting the file is done, because even the root user needs the password or should be a hacker to decrypt.

I also recommend the method suggested in the comments.
If the filename is test,
$ gpg --symmetric test
It will ask the password and create a file test.gpg
Delete the file test.

Use the following command to open the file:
$ gpg test.gpg
It will ask the password and create the test file.

Air India direct flight to San Fransisco has flown through China today.

 My sister in law left for San Fransisco by AI 173 flight which flows over North Pole. I tracked that flight on flightstats.com till it land...