Wednesday 25 November 2009

Exporting multiple photoshop images in JPG

There are cases when we have multiple photoshop images (.PSD) images and we want to export them/ save them as JPG format, possibly even resize it. So, the best way out is to use Picasa Software (http://http://picasa.google.com/)available for Windows, Linux and Mac. It automatically detects all images on your Hard Drive (even photoshop images in PSD format). Now you just need to select the album (folder) containing the PSD files, and click on "Export" at the bottom. This export will provide you options like resize and picture quality and many others. After selecting them, just click on "Export" and that's it. ou have saved multiple PSD files in JPEG format in one go, using Picasa :-)

Don't forget to comment, if you liked it.

Wednesday 30 September 2009

Using tweepy on AppEngine Python

This blog post is all about using tweepy on Google AppEngine.

What is Tweepy?
Tweepy is a library written in Pure Python (yeah Pure Python), by JoshTheCoder. There are many libraries in Python for twitter, however my choice for tweepy is because of following reasons

  1. Hyper Active Development
  2. Up to date with twitter APIs
  3. Python 3 supported
  4. OAuth and Cache system
  5. Really simple to understand (my favourite)


How does Tweepy Work?
Tweepy uses basic as well as OAuth for authentication with twitter, and has well defined classes for almost everything that you might need.


What is OAuth?
OAuth is an open protocol, initiated by Blaine Cook and Chris Messina, to allow secure API authorization in a standard method for desktop, mobile and web applications.

For consumer developers, OAuth is a method to publish and interact with protected data. For service provider developers, OAuth gives users access to their data while protecting their account credentials. In other words, OAuth allows a user to grant access to their information on one site (the Service Provider), to another site (called Consumer), without sharing all of their identity.

More details on OAuth can be found at http://oauth.net

Getting started with Tweepy on GAE
Before reading this section make sure you have access to the code sample at http://code.google.com/p/codecontrol-samples/. That will be helpful.

The basic authentication process follows the following steps

  1. Create an OAuthHandler object using the Consumer Key and Consumer Secret. This is something that is provided by twitter when you start with an application on twitter. For more details on Consumer Key and Consumer Secret, visit http://twitter.com/oauth_clients

  2. Next, we have to generate something called as Authorization URL. The authorization URL is a URL which looks like http://twitter.com/oauth/authorize?oauth_token=slyFKiyIiQ1RRHnhIg8AilcYIlgoL37u1goWZILss. Don't worry about the oauth_token and how to generate this URL. This is something that Tweepy does for you. All you need to do is to call the get_authorization_url method of the OAuthHandler object that we created in step 1.

  3. Alongwith Authorization URL are generated request tokens. These are the keys which are used while asking access from twitter. Make sure we store them in datastore as we will be needing them later.

  4. Your users need to be redirected to the authorization URL page created in Step 2. This is where Twitter will ask permission from it's user to share their details with our application. If they allow the action. Twitter redirects them to the CALLBACK_URL. This callback_url is a URL on your domain, where users will land after a success. This URL will contain some parameters like oauth_token and oauth_verifier.

  5. Next, we need to lookup for the request token that we saved earlier. Using this request token alongwith consumer key and consumer secret, we create something called as ACCESS_TOKEN. This is the actual token that will allow us access this user's information on twitter. Again, we must store all these tokens in the datastore so that everytime our user need not authorize us.

  6. Now its all done. We have in our datastore the request token, the access token and the oauth verifier ad oauth token. We will always create an object of OAuthHandler using these data whenever we want to access someone's twitter information.

  7. To use the tweepy's twitter APIs, we need to create an instance of tweepy's API class using the OAuthHandler object created in last step.



Well, that explains pretty much of how tweepy works. If you have found any issues with the code at http://code.google.com/p/codecontrol-samples/, create an issue and i will be more than happy to fix it up.
The code can be directly downloaded from http://codecontrol-samples.googlecode.com/files/gae-tweepy.tar.gz.

Monday 7 September 2009

Mere dost bhi hacker

Was sitting idle and then thought of this song for one of my hac0r friend

---------------

kabhie hum hacker nikle
kabhie doosre hacker


kya kare zindagi isko hum jo mile.. isko hack kartey gaye.... meri zindagi "life of a procastinator"... mere dost bhi hacker......


kabhie zindagi se maanga HDD mei google ka database le aao
kabhie USB de ke kaha... sabka CC and CVV number isme daalo
hacking ke sab kareene ... hai hamesha se kamine
kya kare.. zindagi.. isko hum jo mile...
isko hack kartey gaye...

jiska bhi database choda.... ander se aur nikla...
Microsoft waale to hadd hai, Linux ka server nikla

Kabhie hum hacker nikle... kabhie doosre attacker
attacker..... attacker
mere dost bhi hacker
meri zindagi hacker
ek PP se dosti thi.... ye huzoor bhi hacker

Sunday 31 May 2009

N79 best pictures

These are some of my favourite pictures that i took from my Nokia N79. Do check them out, you'll love them.

Count of Unique hits

Add to Technorati Favorites