Monday, August 29, 2011

Some important commands in ubuntu

1> To remove an application already installed
sudo apt-get remove <app>

2> To remove application already installed with all config files.
sudo apt-get --purge remove <appn>

3>To list all installed packages
dpkg --list
 dpkg --list less
dpkg --list | grep -i 'app'




Sunday, August 28, 2011

How to make password protected folder in Ubuntu

Steps are :

## Install cfs using sudo apt-get install cfs

## Create the encrypted directory (let say lock)
$ cmkdir lock (It will ask for key i.e passwd for folder should not less than 16 chars)

## So encrypted directory lock is created, now we have to put our secret files, this is done by attaching another directory to lock ( let say directory is clock where we put our personal files)
$ cattach lock clock (again it will ask for key)

## You can look a new directory called /crypt is created  and clock folder is inside it where you put ur personal files. /crypt/clock

## Move ur personal stuff to clock
$ mv personal-files /crypt/clock

## Now, to close ~/lock so no one can get into it, we need to unattach the directory with the cdetach command

## $ cdetach clock 

NOTE : Next time if u want to acess ur personal stuff firstly u should start cfsd so, /etc/init.d/cfsd start and then reattach using cattach and then 
sudo umount -f /crypt/clock


Now u can acess ur files. 
After that u shud deattach using cdetach so that it become protected again.
 

Monday, August 22, 2011

Loading Servlet in Tomcat 5.5.29

1> After installing tomcat 5.5.29, CLASSPATH needs to be set for servlet-api.jar file (which is located in apache-tomcat (in my case it is tomcat0)/common/lib/servlet-api.jar). So CLASSPATH = $CLASSPATH:$CATALINA_HOME/common/lib/servlet-api.jar , where CATALINA_HOME=apache-tomcat folder.

export CLASSPATH

2>Create a directory where you compile all your servlet codes. Let say /usr/Servlet.
Also CLASSPATH needs to be set to this folder also.
i.e CLASSPATH=/usr/Servlet.
export CLASSPATH

3>Create your servlet code (let say example.java). Now compile it to create example.class.
sudo javac -classpath /opt/tomcat0/common/lib/servlet-api.jar HelloWorld.java
where path for servlet jar should be included. i.e

sudo javac -classpath <servlet-jar-path> <example.java>

4>Now goto CATALINA_HOME/webapps/ROOT/WEB-INF
--> Create a classes folder (if not present) and copy example.class file to classes folder.
--> Now in web.xml file add these lines
<servlet>
<servlet-name>example</servlet-name>
<servlet-class>example</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>example</servlet-name>
<url-pattern>/example</url-pattern>
</servlet-mapping>

Above entries to be created inside <web-app>...</web-app> tags available in web.xml file

5> Now stop and start the tomcat .
In my case :
Stop : sudo /etc/init.d/tomcat0 stop
Start : sudo /etc/init.d/tomcat0 start.

6> Goto to browser and type :
http://localhost:8080/example


Thats all

Sunday, August 21, 2011

To Do List After installing Fresh Ubuntu 10.04 lucid

You can go to the link given as Here 
Repository update  source list is quite nice. (Follow the same instructions as given in link to update repositories).

Speakers donot mute after plugging headphone in Dell Vostro

You can follow this link here
For me Downloading and installing driver (deb)  here  worked for me.

Monday, August 15, 2011

How to enable Wireless on ubuntu

Install following packages from repositories :
1> bcmwl-kernel-source
2> b43-fwcutter
3>bcmwl-modaliases 
After that reboot your machine. 
 

Sunday, August 14, 2011

Forgot Windows 7 password

To reset windows 7 password , use Britec software.
1>http://www.briteccomputers.co.uk/downloads/BritecRecoveryConsole.iso
Download iso into pendrive(bootable)
2> Goto bios and change boot options.
3> On running britec goto password option and select on user whose password you want to reset.

Friday, August 12, 2011

History of commands in shell

Can be seen on bash_history file.
Can be found in /home/bharat/.bash_history