Sunday, October 24, 2010

How to show hidden files and folders in windows7

Here is the step by step guidance to enable the option "show hidden file and folders" in windows7.

1. Go to "Control Panel"

2. Click on "Appearance and Personalization" link

3. Under the "Folder Options" click on "Show hidden files and folders"

4. Folder options will pop up in a new window, under the "View" tab select the radio button "show hidden files, folders, and drives" and Click "ok"

Sunday, October 17, 2010

Simple lex program

Lex acts as a lexical analyzer which reads the input and converts strings in the source to tokens according to the regular expressions defined in the source.

Sample lex code - lexcode.l

//definition section
#include <stdio.h>

//rules section
[0123456789]+ printf("NUMBER\n");
[a-zA-Z][a-zA-Z0-9]* printf("WORD\n");

//user subroutings


lex lexcode1.l
Creates lex.yy.c

cc lex.yy.c -o lexcode1 -lfl



Sample inputs and their outputs






Friday, October 15, 2010

lex and yacc for Ubuntu

Ubuntu by default does not have lex and yacc installed. Here is the simplest way to install lex and yacc in Ubuntu. This method uses the following packages

flex (for lex)
bison (for yacc)

Open a terminal and type the following command

sudo apt-get install flex bison

After the installation type the following two commands on the console.

which lex
which yacc

They should return /usr/bin/lex and /usr/bin/yacc respectively if lex and yacc
installed properly

How to find the process running on port 8008?

1. Open a command prompt.

2. Type netstat -o -n -a | findstr

3. Find the last column in the displayed result. It is the PID of the process which listening to port 8008.

4. Open task manager and inside process tab find PID column. If you cannot see PID column, go to view>select columns and check PID check-box.

5. Arrange processes by PID then find the PID resulted previously and see the corresponding process.

Thursday, October 14, 2010

Installing webgoat for windows

The Open Web Application Security Project (OWASP) is focused on enhancing security of application softwares. It offers various documents and tools for this purpose. WebGoat is one of such a project of OWASP which is designed to teach web application security lessons. Here is a guide how to install WebGoat in a windows environment.

use the following link to download

Extract the zip file downloaded that will result WebGoat-5.2 folder. There should be two bat files inside this folder named webgoat.bat and webgoat_8080.bat

Doulble click on any of the bat files to start Tomcat for browsing WebGoat directory.

To start browsing WebGoat directory give http://localhost/WebGoat/attack on the address bar of the browser.

Then it will probably ask for an username and a password, give "guest" for both username and password.

Follow the series of lessons they have provided for web application security.

JDK and JRE on Ubuntu

Here is a step by step procedure to install JDK and JRE on ubuntu operating system. Note that there should be an internet connection for this method of installation.

  1. Open a terminal.
  2. Install JDK and JRE using the following command.
  3. apt-get install sun-java6-jdk sun-java6-jre
  4. During the installation process it will ask whether to proceed or not. Give y or n (y and n for yes and no respectively).
  5. Go through the wizard like interface and complete the installation.
  6. On the command line type following and confirm JDK is working. This Should return the java version which has been installed for a successful installation.
  7. java -version

Sunday, October 10, 2010


Kaleidoscope is a beautifully written book by Danielle steel who has been hailed as one of the world's most popular authors... Kaleidoscope is my favorite Danielle Steel book so far and if you are much in to Danielle steel books this is a must read...

Little Bit of a review...

Hillary, Alexandra and Megan, three orphan walker sisters who have been torn apart in their early childhood... One act of madness changed those three 3 lives a lot... AS a "Kaleidoscope" gives different shapes when it rotates, these three lives lead to totally different paths as they torn apart from each other... 30 years of time after they lost their parents, Hillary practically runs a TV network, Alexandra lives in a fancy house in France with her Nobel husband and two lovely daughters, Magen, a doctor who is willing to sacrifice her life for the cause of saving poor hillbillies... Who should take the responsibility for their 30 years of separation? Is it Arthur who torn them apart and kept no trace of them afterwards or was it sam their own father who killed their mother Solange in the first place and committed suicide inside a prison cell? That leaves unanswered till the latter half of the book when Hilary reveals the truth... The truth which shocked everyone... Hillary is the one who had a bitter life while other two had decent lives... She has the right to hate Arthur but still readers gets the idea it is too over reacting hatred for separating them and keeping no trace of them afterwards... But she gives a good answer which justifies her hatred is fair enough... She was beaten, she was raped and yet she didn't give up her dream to find her little sisters until she finally met Arthur when she was 17... She was pregnant once and the fears of separation obviously lead her to do an abortion... After that she totally obsessed with her work in the network just to forget her past... she was called merciless by majority, a person once been cared a lot about her sisters turned in to a person who doesn’t think of anyone at all as a result of the horrible things she had to face... Arthur finally wants to get them sisters back together after he finds he is dying in no time... he hires private investigator John and with his enormous effort he finds all of them and get them back together... All of them sacrifice so many things just to see each other again... But they never regret that decision... specially it was very brave of Alexandra to disobey her husband and come all the way to America with her mother and her children... before she left Paris she had to tell the truth to her husband, who cared a lot about her family tree... it almost gave him a panic attack and she thought he would call right away his attorneys and divorce her... But he loved her more than she thought and loves her no matter from what the family she comes from... Meanwhile john was able to make sure Hillary she can trust him and love him and everything will be alright from here after... But what makes readers really astonished is the reveal of Hillary, her mother Solange had had an affair with Arthur and Solange told Sam that fateful night the truth which even Arthur wasn’t aware of, Megan is Arthur's child and that made Sam furious and that anger made him kill her... That was the end of their fairytale love which started in Paris during second world war...The truth of an unspoken tragedy reveals after 30 years…