Sunday, October 21, 2007

Linux Kernel Map



Linux developers launched Linux kernel map.

You can get an interactive map , here

Tuesday, September 18, 2007

BOOT password lost- here is the new way....for ASUS P3B-F Motherboard

During trial of installing CentOS linux I have found that machine already had Redhat installed. I tried putting CD of CentOS OS in the CDROM but the machine could not boot up with CDROM because default boot sequence was HDD and then CDROM. I had tried by Pressing DEL at the boot time but the BIOS was protected by Password. Even I dint have machines root or user password for Redhat.

I tried to remove the jumper and blow away the CMOS settings but that dint work(I used to do this back when i was doing my BS). Next, I looked for the Motherboard type. It was ASUS P 3B-F. So I did google for manual of mother board and found new way of resetting the boot password.

1. You have to turn off the computer and remove the power plug.
(not mention in manual though)set the jumper to pin 2-3(remove from pin 1-2)
2. look for the CLRTC solder points and sort it.
3. turn on the computer and press DEL at startup,
4. And thats it!!! you enter in the BIOS.
5. setup BIOS timer clock and other things you want to

don't forget to put jumper back to pin 1-2.


It dint mention in the manual that you have to put jumper to 2-3, but then without doing this it dint work. SO I did.

Monday, September 10, 2007

Linux Community praise WIndows Vista



Linux Magazine

"One most funny thing I read was that 'Windows Vista does not have SSH protocol, it is still using telnet' :)

Friday, August 31, 2007

How to - CentOS - Apache server with SSL

Most people are finding problems with CentOS , making it https(Secure Socket Layer) web server. CentOS is open source Linux project supported by Redhat. I am configuring machine, making CentOS apache server with SSL. I did google but couldn't find enough information about how to make apache+ssl in CentOS.


CentOS has diffrent configuration for ssl and all certificate generation configuration files have been moved to /etc/pki/tls dir.

Here are the steps to make CentOS apache+ssl (Self-signed certificate)

1. go to /etc/pki/tls/certs
2. make mycert.pem
3. Enter the information about country,state,city,host name etc, your certificate and key has been created .
4. now go to /etc/httpd/conf.d/ssl.conf and change..
SSLCACertificateFile /etc/pki/tls/certs/mycert.pem
SSLCACertificateKeyFile /etc/pki/tls/mycert.pem
5. save changes.
6. on shell prompt service httpd start

thats it!!!


Your apache web server with ssl start working.

to check that whether ssl is working or not, do
https://localhost and you prompted with security alert window.
or
netstat -an|grep 443 , you will find ::443 listening , that is ssl listening.

Sunday, August 26, 2007

Bits&Bytes

Google Interview question

My friend just interviewed by the Google team. Those of you who do not aware of google interviews, the first telephonic interview usually consist of 2 algorithm implementation either in C,C++,JAVA or Python and general questions from your resume (CV).

The question:

Find whether the two strings are anagram or not.(No white spaces included)

The strings which contain same characters with equal number of occurrence in order or without order.
Anagram
e.g,
ARMY EAT
MARY ATE

ALgo steps:
1. get the two string input from user , str1,str2.
2. if (len(str1)!=len(str2))
result : No Anagram , quit.
3.else
sort two strings by quick sort(n log n complexity in ideal case)
4. Compare both strings,
if (str1==str2)
yes anagram
else
no.

This was my friend's answer in just 3 minutes.
Then the interviewer asked : Can you make this more efficient??
!!!!!!
Then she has given a hint,,,, Did you heard about Hasing? now think....

My idea may gives hint ,,,

1. Make a Hash table
Key -value
a - 1
b - 2
c - 3
. .
. .
. .
z 26

2. Get two string from user, str1,str2.
3. call the Hash fun and get the value..
like if I have str1=abc then Hash(str1) = 123
str2=bca then Hash(str2) = 231
4. if Hash(str1) > Hash(str2)
Hash(str1) - Hash(str2)
else
Hash(str2) -Hash(str1)
5. if the return value of above arithmetic is divided by 9 then the string is Anagram
else not.

This seems ok,
But this was also incorrect.
My friend Maulik noticed and found my error because 19-10 also 9 and divisible by 9. then what?

I still don't have any answer.
Any other answers are welcome..

Wednesday, August 15, 2007

A very good tutorial on RAW_SOCKET

Link 1.


Link 2.

Monday, August 06, 2007

Firewall

Hey there,
Many of you heard about Firewall in the network. Here is something interesting to know about Firewall in Linux world.

In the linux, firewall is part of kernel (network arch). Firewall provides security by filtering the incoming, outgoing and forwarding packets. So you guys easily catch that it works on Network (IP) layer. Mostly firewall is designed in dedicated machine, where Admin can define firewall rules. In the early days of Linux the program that provide firewall was known as ipfwadm (IP Firewall for Admin). After 2.2 series there was another enhanced version of firewall called ipchains. It is called Ip chains because there are basically three ways a packet traverse.
1. It can go out from the NIC (Output)
2. Come in to NIC (Input)
3. It can be forward as per routing tables rules if it is not for the local machine (Forward)

In the Linux world this is known as a chain. Input chain, output chain and forward chain.
Though ipchain is good, in 2.4.X and later , the netfilter utilities get enhanced and the newer version came out called iptables. One can define firewall rules using iptable with a normal ease. iptables are extensible compare to ipchains and that’s the most important features available by iptables. NAT rules for forwarding can also be defined using iptables.

I will post how to define firewall rules using iptables once i will be done with it's implementation.

so enjoy!!!!!!!!!!!!!!!