Saturday, February 5, 2011

Hide files in a jpg

Set up:
1. Must have a .zip or .rar compressor.

Steps:
1. Save the picture of choice to your desktop.
2. Make a new .rar or .zip folder on your desktop.
3. Add the files you want to hide into the .zip or .rar
4. Click start menu, run, cmd.
5. In Command Prompt type cd "desktop" with the quotation marks.
6. Now type in copy /b picturename.jpg + foldername.rar outputfilename.jpg
( If you use .zip then: copy /b picturename.jpg + foldername.zip outputfilename.jpg)
7. Now there should be the outputed file name with a .jpg extension on the desktop.
( Do not close Command Prompt just yet )
8. Double click it to open the picture and check it out.
9. When your done looking, and want to view the hidden files
Type: ren outputfilename.jpg outputfilename.rar or zip

How To Become A Hacker by Eric Steven Raymond

Read from here...Click here..

Friday, February 4, 2011

Turning a Hostname into an IP Address

#!/usr/bin/env python
#Get the IP Address

import socket
hostname = 'maps.google.com'
addr = socket.gethostbyname(hostname)
print 'The address of ', hostname, 'is', addr

Install VirtualEnv in Ubuntu

Once virtualenv is installed, you have the power to create any number of small, self-contained “virtual Python environments” where packages can be installed,
un-installed, and experimented with without contaminating your system-wide Python. When a particular project or experiment is over, you simply remove its virtual environment directory, and your system is clean. In this case, we want to create a virtual environment in which to test the googlemaps package. If you
have never installed virtualenv on your system before, visit this URL to download and install it:

http://pypi.python.org/pypi/virtualenv

Once you have virtualenv installed, you can create a new environment like this (on Windows, the directory containing the Python binary in the virtual environment will be named “Scripts” instead):

$ virtualenv --no-site-packages gmapenv
$ cd gmapenv
$ ls
bin/ include/ lib/
$ . bin/activate
$ python -c 'import googlemaps'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named googlemaps

As you can see, the googlemaps package is not yet available! To install it, use the pip command that is inside your virtualenv and that is now on your path thanks to the activate command that you ran:

$ pip install googlemaps
Downloading/unpacking googlemaps
Downloading googlemaps-1.0.2.tar.gz (60Kb): 60Kb downloaded
Running setup.py egg_info for package googlemaps
Installing collected packages: googlemaps
Running setup.py install for googlemaps
Successfully installed googlemaps
Cleaning up...

The python binary inside the virtualenv will now have the googlemaps package available:

$ python -c 'import googlemaps'

Now that you have the googlemaps package installed, you should be able to run the simple program named search1.py.

#!/usr/bin/env python
# Fetching a Longitude and Latitudefrom googlemaps import GoogleMaps
address = '207 N. Defiance St, Archbold, OH'
print GoogleMaps().address_to_latlng(address)
Running it at the command line, you should see a result like this:
$ python search1.py

(41.5228242, -84.3063479)



Credits goes to Foundations of Python Network Programming(Apress)

Wednesday, February 2, 2011

Short-notes for Linux

Exit GUI and start up again command line CTRL-ALT-BACKSPACE
Shift to command line CTRL-ALT-F1
Shift back to GUI CTRL-ALT-F7
Terminal window and enter the shutdown, halt, or reboot command, halt will log out and shut down your system.
Use CTRL-ALT-F7 to access the first session and CTRL-ALT-F8 for the second session.
To end your session, issue the logout or exit command. This returns you to the login prompt, and Linux waits for another user to log in.
Shut down the system $ shutdown -h now
Reboot CTRL+DEL+ALT
To create a link, hold both the CTRL and SHIFT keys while dragging the icon to the location where you want the link.
The startx command starts the GNOME desktop by default.
Terminal --- $ command-name options arguments
The ls command displays a listing of files in your directory.
CTRL-U erases the whole line and enables you to start over again at the prompt.

Saturday, January 29, 2011

Dragon Realm's Game

import random;
import time;

def displayIntro():
 print("You are in a land full of Dragons. In front of you!");
 print("You see two caves. In one cave the dragon is friendly...");
 print("and will share his treasure with you!");
 print("Other one is greedy and Kill you!");
 print();
 
def chooseCave():
 cave = "";
 while cave != "1" and cave != "2":
  print("Which cave will you go into?(1 or 2)");
  cave = input();
 return cave;
 

def checkCave(chosenCave):
 print("You approach the cave...");
 time.sleep(2);
 print("It is dark and spooky...");
 time.sleep(2);
 print("A large dragon jumps out in front of you and open the jaw...");
 print();
 time.sleep(2);
 
 friendlyCave = random.randint(1,2);
 
 if chosenCave == str(friendlyCave):
  print("Give you his treasure...");
 else:
  print("Gobbles you down in one bite...!");

playAgain = "yes";

while playAgain == "yes" or playAgain == "y":
 displayIntro();
 caveNumber = chooseCave();
 checkCave(caveNumber);
 print("Do you want to play again? y/n");
 playAgain = input();
http://inventwithpython.com/chapter6.html

Guess The Number Simple Game in Python

I am learning python at this moment and created simple game. I saw some tutorial before and just coded this.

#!/usr/bin/env python3.1
#This is a guess the number game.
import random;

guessesToken = 0;

print("Hello! What is your name?");
myName = input();

number = random.randint(1, 20);

print("Well, Myfriend "+myName+" let's play a game");
print("Guess a number between 1 and 20");

while guessesToken < 6:
 guess = input();
 guess = int(guess);
 
 guessesToken = guessesToken + 1;
 
 if guess < number:
  print("Your guess is too low!");
 if guess > number:
  print("Your guess is too high!");
 if guess == number:
  break;
if guess == number:
 guessesToken = str(guessesToken);
 print("You guessed it within "+guessesToken+" times congratulations!");

if guess != number:
 print("You failed man!");