Posts

Unix cheat sheet

Inspite of years of working on Unix and Linux I still wasn't confident if I knew enough and hence read it in these holidays and I see that we can get our way through these amazing OS using the below commands:- The OS uses the Filesystem to store data on the harddisk. They are different types of file storage, NTFS, FAT and etc.  Commands to get your through! pwd ==> Prints the working directory you are in.  ls ==> just to list the files and directories, flags -l  => output in list format -a => show the hidden files -h => output is more human, that is easier to understand  cd ==> Change directory  find location -type f -name filename   ==> to find the file that you have been looking for. parted for partitioning ext4 mkfs ==> to create filesystems echo $PATH  ==> print the path env ==> to list the environment variables of  ps -efl  ==> to print the details of the process that are running ps $$ ==

Accessing the Google APIs using Oauth 2 in Python

Image
In its simplest form, Oauth is as in this document I had created earlier. Oauth is such a simple protocol and so much of fuss is being made about it, its so simple that you can understand it even by reading its Specification  documentation ! Below pic shows the flow +--------+ +---------------+ | |--(A)- Authorization Request ->| Resource | | | | Owner | | |<-(B)-- Authorization Grant ---| | | | +---------------+ | | | | +---------------+ | |--(C)-- Authorization Grant -->| Authorization | | Client | | Server | | |<-(D)----- Access Token -------| | | | +---------------+ | | | |

Agile Python Development and the Laundry list

We need method to the madness! There are apparently two, one is waterfall and the other agile When? Manifesto for Agile Software Development was produced in February, 2001. Why Agile? Is more pragmatic, as it knows that not everything can be documented at the beginning of a project. But it does put in place some rigorous  checks to accommodate these changes! So that any change can be accommodated, with good communication, iterative design and development.  Agile development can be applied in any project, both testing tools and build automation tend to be very language specific. Python too has these tools. Jargons again! Agile methodologies  XP - Extreme programming -- focuses almost exclusively on the developer and development techniques DSDM - Dynamic Systems Development Method -- focuses completely on processes there could be many more. Spirit of it from manifesto! Individuals and interactions over processes and tools Working software over compreh

Google APIs for python - don't feel unfortunate anymore if you have to work on these

Image
From the past 4 years I've been unfortunate enough to work on Google API's which are those for which even Google cannot search their documentation, may be because it doesn't exist, stackoverflow no matter how much it overflows cannot give us anything much on these. Below is the summary of all my experience to crack the Google APIs. I've spent days together to crack one thing at times and I wished I had known these tricks so that it wouldn't have taken me this long. So firstly try to read as much as possible from the getting started guide. This will take you to a world of links, go to those link and grab in what ever is possible (don't worry if you don't understand anything). [trade secret of software engineers is make the simple sound as complex as possible, and intimidate others!] But the world of python is different!  " Simple is better than complex." -- zen of python So the magical commands in python are :- dir() type() help() (k

Installing Chef client in less than a minute

Image
Open a terminal Enter command as in the screenshot below, you will use the command as below and on the right get an acknowledgement curl -L https://www.opscode.com/chef/install.sh | sudo bash now after this we can confirm that the chef has been installed by looking at version by using the below command.  chef-client -v and also the folder structure 

Git simplified and master it in 10 minutes!

OK, what is this Git thing! Just because the developers use it, doesn't mean its rocket science. Some are using it to work on family photo albums so it should be useful for all. Imagine if you were composing a document and wanted a far off friend's help on it, you would write the initial draft, then email the attachment to your friend, he would download, save a copy, edit it and then email it to you. Now suppose instead of this emailing overhead, if we could just have this document stored on your computer and your final edits pushed and stored on a web repository which your friend can download from and work on it locally and push the changes to the web repo until its perfect. Different versions of this document from the initial one to the final one is stored and available and could be called Versions, since the docs are available with everyone working on it and not central its  distributed and you and your friend have a set of rules to control the flow, combing it, dis

OAuth Simplified

Image
In my earlier post we saw what is SAML. Basically it works on the HTTP i.e. for webpages and etc.  But what if you wanted have SSO on an app, for example on a Mobile App? There are work arounds to implement SAML but the straight forward way of doing it would be to use OAuth, a recent boy in neighbourhood which unlike SAML which is older than 6 years, is designed considering the future, of native apps and mobile apps.  As usual the definition is  OAuth is an open standard for authorisation. OAuth provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user). It also provides a process for end-users to authorise third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections. Please observe the definition, it says Authorisation and not Authentication! What it means is that if you have an app on your phone and would like i