Sunday 22 June 2014

Configuring Tor : Anonymity Online


Tor is free software and an open network that protects you from network surveillance by hiding your real location. This tool can be used to keep privacy. Recent news about agencies that make network surveillance threatening the privacy of people compels us to go anonymous.

Read more about Tor project here .

There are different methods to configure Tor and I am explaining only one of them. The project recommends to use Tor browser bundle but I am not going into it.

This is a step by step procedure to configure Tor client in your Debian/Ubuntu system. Sometimes your internet connection will be configured to block downloads from tor website/repository. The admins usually do this to prevent people from using tor. So in that case use data cards for installing tor and then connect to your network using tor enabled browser.

Step 1: Open terminal and login as root

                      sudo su

Step 2: Get your Ubuntu/Debian DISTRIBUTION

                     lsb_release -c           or            cat /etc/debian_version

Step 3: Open /etc/apt/sources.list  as root and add the following line

                    deb https://deb.torproject.org/torproject.org your-distribution  main
                    deb-src https://deb.torproject.org/torproject.org your-distribution  main

            eg:   deb https://deb.torproject.org/torproject.org precise main

Step 4: Take terminal and then add the gpg key used to sign the packages

                    gpg --keyserver keys.gnupg.net --recv 886DDD89
                    gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -

Step 5: Update

                    sudo apt-get update

Step 6: Use keyring to keep signing key current

                   sudo apt-get install deb.torproject.org-keyring

Step 7: Install Tor

                  sudo apt-get install tor

You have installed tor, but now you need to configure it. Start and enable it.

                  sudo systemctl start tor
                  sudo systemctl enable tor

Configuring Firefox browser for using tor is shown below (port 9050):



Done !!

To check whether it is working correctly, go to https://check.torproject.org/
The website will say whether the browser is properly configured or not.

The network traffic will be slow as it has to go through a large number of nodes.

Saturday 21 June 2014

Enabling WLAN card in Linux Ubuntu 14.04

Today I just installed Ubuntu 14.04 in my Lenovo G510 and found that the laptop's WLAN card is not detected by Ubuntu.

Here is a quick way to enable the WLAN card :

1. Connect to a temporary LAN connection
2. Open a terminal
3. Type in the following command
          
sudo apt-get install bcmwl-kernel-source

4. Disconnect from the temporary connection
5. Give a reboot 

Done . Your WLAN card will work like a charm !!
 

Sunday 8 June 2014

Java program to read input from file

The following java program reads input from a given file line by line and prints the output on the console.

program code :

import java.io.*;
 public class ReadFile
 {
    public static void main(String[] args)
    {
    String file="inputfile.txt";
    try{
    FileReader f = new FileReader(file);
    BufferedReader bufferReader = new BufferedReader(f);
    String line;
// Read file line by line and print on the console
    while ((line = bufferReader.readLine()) != null)   {
            System.out.println(line);
    }
    bufferReader.close();
    }catch(Exception e){
            System.out.println("Error while reading file line by line");                     
    }

    }
  }