Sunday, July 24, 2011

How to Get Notified when Girl remove you from circles

Friends I've found a Google chrome extension which notifies you when any one remove you.Google Minus is a Google Chrome browser extension which lets you know when somebody removes you from a particular Google Plus Circle. When you install it at that moment it saves the details of Circles in which you are and whenever you login to Google +, it checks and matches the data. And if it founds that any of the Circle you belong is not appearing then it notifies you. Its just that simple.So, if you want to keep track of your Google Plus Circles then you can install this awesome Google Minus Chrome extension on your browser from the download button given below.

Download and install Google minus

Screen2Avi, Free Screen Recording Software

Screen2Avi is another lightweight free program to record avi videos. The program is available as a portable version and installer. The application uses tabs to configure the screen recording session. Available for selection are fullscreen, predefined and custom dimensions for the video.

Download it from the developers' websites.

Change your wallpaper automatically in Ubuntu

Letz have a glance at changing static desktop wall paper system. Here is a utility name "DesktopNova", using which you can have a customized dynamic wallpaper. This program works currently only on a Gnome or Xfce based system. 


How to Install :

Open the terminal and run the following commands :
sudo apt-get install desktopnova desktopnova-module-gnome
To install indicator , run the following commands :
sudo add-apt-repository ppa:michael-astrapi/ppa
sudo apt-get update
sudo apt-get install indicator-desktopnova


Thats it!

Wednesday, July 13, 2011

What are Cookies ? Using Cookies in PHP.

Cookies are basically small files which are stored in User’s Computer. Their main purpose is to hold data specific to a particular client and Website, They can only be accessed either by Web Server or the client computer. This allows the server to access user specific data while saving space on the web server, It allows the server to deliver specific tailored web pages to a particular user.

Cookies act as a mechanism to store data in the remote browser and thus tracking and identifying return users.

A Cookie mainly contains data in (key,value) pairs for example (name,aneesh) , (message,cookies are great).

That’s a lot of theory there now let’s move on how to use cookies using PHP.


Cookies in PHP



PHP provides us a with suite of functions for manipulation of cookies.

Setting of Cookies

These functions include setcookie() or setrawcookie() . As cookies are a part of HTTP headers so , it’s obvious we need to call setcookie() before sending any data.

Accessing Cookies

Any cookies which are sent to the server from the client will be automatically included in $_COOKIE auto – global array.

These cookies can be accessed using following syntax:-

Code:
   $_COOKIE['name'];
Using Cookies in PHP

The setcookie() function is used for setting of cookies

Syntax :-
Code:
  setcookie(name, value, expire, path, domain, secure, httponly);
Note: In the above all arguments except name is optional.

Example:-
Code:
  setcookie('name', 'aneesh');
This declares a cookie with name=name and value=aneesh , As no expire time is provided the cookie will be deleted from the browser after ending the session.

Example involving Expire time:-

Code:
  $minutes = 20;
  setcookie('name', 'aneesh' , time()+($minutes*60));
As the ‘expire’ time input should be in seconds we multiplied it with ‘60’ as each minute contains 60 seconds.

Printing:-
Code:
  echo $_COOKIE['name'];
This would print the value of cookie which we earlier set using setcookie()

Output:-
Code:
  aneesh

Making a Simple Application in PHP using Cookies



Now that we know quite a lot about what are cookies and how do we use them lets use them and make a small PHP Application.

Visited.php :-

Code:
  
  
      
          
              Sample Page
          
      
      

Welcome Visitor

According to your browser cookies you have'; } else { echo 'have not'; } ?> visited our site in the last 10 days.
Output :-
1. When visiting for the first time :-
Code:
  Welcome Visitor
  According to your browser cookies you have not visited our site in the last 10 days.
2. Not visiting for the first time
Code:
  Welcome Visitor
  According to your browser cookies you have visited our site in the last 10 days.
Courtesy : Go4Expert (copied and pasted for my personal reference)

APTonCD

Integer Overflow (Bugs) in C

Integers is a fundamental data type in a C program, They are used to represent a finite subset of mathematical integers, C Provides us with a suite of functions, and quite a lot of modifiers for manipulating these integers , but if these functions and modifiers are not used properly and carefully they can lead top disastrous results like failing of a Program Logic , Security breach , A break in authentication applications etc.


Integer Overflow



Integer data types in C have a fixed size and limits and which cannot be changed dynamically, This drawback have resulted in a bug commonly known as ‘Integer Overflow bugs’. These bugs are one of the difficult bugs to track down and fix. It happens When an arithmetic operation attempts to create a numeric value that is larger than can be represented within available storage space.

Basically what happens is , As we add 1 to the maximum value than can be represented within a storage space , The integer overflows and resets to the minimum value it can hold .

To make it simple let’s take an example of a odometer (non-digital) an odometer is used to measure distances and it consists of different rings! When odometer reaches its maximum value i.e some 9999’s after that it rolls over to its lowest value i.e 0.

Demonstration



Bug.c
Code:
  #include
   
  int main()
  {
      int i=0;
   
      scanf("%d",&i);
   
      printf("Value %d" , i);
      
      return(0);
  }
Compiling :-
Code:
  gcc Bug.c –o Bug
Input : 1

Ouput :-
Code:
  1
  Value 1
Input : 2147483648
Code:
  2147483648
  Value -2147483648
Boom! See what just happened we have carried a successful Integer overflow attack o our application.

How it happened

I am currently using a 32 bit GCC compiler , with MAXIMUM integer limit set to 2147483647 , So as we add one more to it resets back to its minimum value i.e -2147483648.

This was just an example of how these bugs can be demonstrated , and believe me if you pick up 10 normal C applications and test them for these bugs I guarantee you’ll find at least one of them which is vulnerable.

A Challenge



In the following challenge, You have to force the application to print the success message.

Code:
  #include
   
  void printInt(unsigned int i)
  {
      if(i > 100)
      {
          printf("Success ! You did it!\nValue of Int : %u",i);
          return(0);
      }
  }
   
  int main()
  {
      int i=0;
   
      scanf("%d",&i);
   
      if(i > 100)
      {
          return(-1);
      }
      printInt(i);
      return(0);
  }
It may seem impossible at first, Read the article once more check if you are missing something , Read the Code carefully and you’ll get your solution.


Solution (don’t check it , at least before trying) :-


Give the input as ‘-1’
Code:
  -1
  Success ! You did it!
  Value of Int : 4294967295

Courtesy : Go4Expert (copied and pasted for my personal reference)

Download from Fileserve, Filesonic, FileFactory, etc Directly as Premium Users

Wireless Network Watcher, Find Out Who Is Connected To Your Wi-Fi Network


The device needs to use proper encryption to block third parties from accessing it. Many users do not know the differences between WEP or WPA encryption, or which of the encryption schemes they should select for best security.
That could leave their wireless routers open for unauthorized access, especially if no encryption or weak encryption is configured.
The best option here is to use the strongest encryption possible. That however may not be always possible, if devices that need to connect to the wi-fi router do not support that.
Wireless Network Watcher is a free software program that scans a wireless network for connected computer systems. It displays all computers that are currently connected to the network in its interface, making it dead easy to identify unauthorized access to the network.





Each connected device or computer is represented with an IP address, device name, MAC address, company that created the network adapter and device information. These information can be exported and saved to various formats including html, xml and text files.
The program is fully compatible with 32-bit and 64-bit editions of the Windows operating system. It supports all Windows versions from Windows 2000 to Windows 7, including Windows Server versions.
The program can only scan the wireless network the computer it is running on is connected to. Users who want to scan a network that they are not connected to need to connect to it first before scanning it.
It can happen that the wrong wireless network adapter is identified by the program. It is possible to select the right one under Advanced Options (F9).
Wireless Network Watcher is a portable program that will start the scan automatically right after it has been started. It can take a few seconds before the list is populated.
Windows users can download the program from the official website over at Nirsoft.

Source : ghacks