After a break

It has been long time since I blogged last. Well, partly because now a days one liner in social networking takes most of the bandwidth and mostly because my job role now demands lot of hours. It is kind of exciting to work where there is full freedom to decide what kind of software stack to use, how to design and finally code something that people actually use.  

This also means that in almost last 10 months I haven’t done anything with my photography or pending projects, which is shameful.

I hope to take some time out and finish long pending projects et.al. 

Droid/Tux/Web

A close friend of mine bought an android phone.However much of her excitement went down the drain when she was unable to connect to the internet using her ad hoc sharing of Ethernet.

if you are in a similar situation and use linux/fedora and wanted to connect to the internet, here is a small way of doing so. If you use windows 7+ however, you can use an application called connectify. :

Step 1.

$sudo yum install hostapd

Step 2.
Configure hostapd with few lines, there are many options feel free to explore

interface=wlan0
hw_mode=g
channel=6
ssid=Yourssidhere

macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=yourssidpasshere
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Step 3.
Stop the hostapd service if it is running:

$sudo service hostapd stop

or

$sudo systemctl stop hostapd.service

Step 4.
Go to your network manager, wireless and turn on the hotspot.
Step 5.
Restart the hosapd service

$sudo service hostapd start

or

$sudo systemctl start hostapd.service

Done

There is a better way of doing this with bridge-utils, dnsmasq, and hostapd, I will blog about that later.

Migrating from Bzr to Git (Single branch)

We migrated the ChaloBEST Repository from bzr to git. While migration is not a rocket science any more and there are a lot of blogs and threads about this. This post is a simple step as how to and also as self note.

Step 1. Branch out your bzr repo.

<code> $ bzr branch "url to your bzr repo"</code>

Step 2.cd into your new branch and do the following

<code> $ git init </code>
<code> $ git remote add origin "url to git report" </code>
<code> $ bzr fast-export `something`|git fast-import</code>

Step 3. In case your original git repo is not empty, please do a

<code> $ git pull </code>

Step 4.  Now do a

<code>$ git reset --hard  HEAD</code>

Step 5. Now commit the changes using

<code> $git commit -m "some message"</code>

Step 6.  Push the changes

<code> $git push </code>

Here are some links that helps out with migrating both branches and master.

To the south, sir!

It has been sometime while playing with Django. One problem that I face mostly is making changes in the model and expect the change to reflect itself on the fly. Django, however does not like this idea and does not let you do so. In most case if you are making a model and want to create the DB schema you will do something like this:

python manage.py syncdb

This will create your model, however once created and then if you want to make changes in the schema, you are not going anywhere. So this is where we need to go south.
Django south generally works in this way:

python manage.py schemamigration <appname> --initial

Then you do a

python manage.py migrate <appname>

This is enough to create a migration directory and track changes to your model based in the appname you are using.
So now if you are making changes to the column, you will be using south. The next few lines will deal with screwing thing inside south as well as making you model change successful. One piece of caution though, this will/may delete your existing data, so be careful.
Let say, you end up with an error like this while migrating using south.

! These migrations are in the database but not on disk:
some migrations here
! I’m not trusting myself; either fix this yourself by fiddling
! with the south_migrationhistory table, or pass –delete-ghost-migrations
! to South to have it delete ALL of these records (this may not be good).

This happens because there is conflict in the original model and the model you are trying to implement.

The following steps will help:

Undo changes in the model.py intended to have the change and delete the migration folder in the folder, then run

python manage.py migrate <appname> --delete-ghost-migration

This step will delete all the migrations that has not trickled down properly.
If your app is already managed by south then run the next step, else if your app was previously managed by syncdb only, use this command first:

python manage.py convert_to_south <appname>

Coming back to our steps:


python manage.py schemamigration <appname> --init


python manage.py migrate <appname> --fake

The argument –fake will record the changes but will not write it to the DB.
Now redo the changes in the model.py

python manage.py schemamigration <appname> --auto

The argument –auto will keep track of the changes happening over the initial change/previous changes.

python manage.py migrate <appname>

And that’s it, you are done and your changes has flown to the DB.
Please read south documentation for more details, it can be found here.

Wildlife and Us

It has been little over a year since I am associated with wildlife photography closely. However over the year I have learned about various species, their behaviors, habitats and how to photograph them. Even though I am still in learning phase of being a photographer, one thing I learned pretty closely is the risk we, humans pose to the wild.

Here are few stereotypes I have found during this course.

Wildlife Photographers:

First set of people are amazing photographers and they have these B-I-G big lenses, so that means they are able to shoot best of the photographs from quite a distance. However not always, in some cases photographers for the sake for getting the most exclusive photographs takes their gypsies or go very near to the animal or bird they are photographing . So close that even the tiger you are photographing gives an exclamation like “Dude!!!”

Loved the road runner and coyote show..eh! well there has been cases when a bird had to run like road runner while coyote with better acme products is chasing it. Even a sloth bear was that unfortunate.

Again for some other weird reason in order to take breathtaking photograph, photographers become infiltrators, I am sure if birds were to have a political party it would have called for some strikes and hunger strikes by now. Few examples includes, cutting a bird nest to half so as to have a better view inside the nest. I wonder how you will feel if some photographer cuts down your house to take better picture of your morning life cycle. Another one is to clear off the area around the nest for better photographs thereafter leaving it exposed to predators and other harms. Some even go to the extend of destroying the nest so that no other photographer can take the similar picture, hmm! now that sounds familiar..right!.

Here is one guy who went to the extend of writing a book with this tactics:
Life Cycle of birds( A pictorial representation) By Bhagat Singh.
These has been a huge uproar in popular social networking site regarding this.

Wannabe Steve Irwins(not to insult the great personality in any way, he is a legend):

Few months back a guy who can’t help comparing himself to some legendary conservationist. He went to the extend of catching a very rare and endangered mammal(a Namdapha Flying Squirrel) inside a national Park and then pose photograph with it, injuring it in the process, taking it out of the wild and leaving it in ‘Care’ of Humans. However when confronted by members of INW(India Nature Watch, If you are a member of INW you know what I am talking about), the reply he gave was more shocking and can be considered to be a serious threat, not to mention he violated several protocols of Wildlife Protection Act(1972).

This is not singular case, there has been different instances where people who are attached with wildlife groups and agencies cannot keep their excitement level to low.

The Weekender :

After a hectic week in closed glass box called offices, many will opt for some refreshment over the weekend. What can be more relaxing than a fantastic resort down the bed of river with Himalayas all around you. Weather is cool and soothing, this is a perfect recipe of a weekend getaway.
But here comes the problem. You decide to play music from your car stereo with 11 inch sub in the middle of the jungle. The resort manager tries to convince you the sound will attract elephants which will pose the threat to both the resort and you. But you will be like “Dude, I have paid for this, so this is my right”.
Please pray to your god that you came out alive that night.

The Gypsy Tourists:

You took your friends and family to a jungle and you wants to see tigers. Since you cannot see a tiger in first two safari’s, you are pissed off and you curse your gypsy driver and guide for the same. your money is getting wasted. you curse for their incompetence and then it happens.

A tiger comes out and all you can see is the tip of the tail. you want to see more. You started behaving like you own it. Shouts at your gypsy driver and eventually when the tiger is about to go away, your gypsy driver chases it so that you get a better glimpse of the majestic animal. If you are lucky enough you will get close enough to the tiger to pee in your pants. Ignorant of the fact that, this irresponsible behavior poses a threat to both you and the tiger.
Thankfully, the supreme court has banned all tourists from entering the core zone of the tiger reserves across the country. So “no tip of the tail” anymore.

The other set of gypsy tourists talks. How does this pose a threat!
You talk, then you get excited,and you talk so loudly that there comes a huge ‘sssshhhhhh’ from all other fellow tourists around you. Any tiger reserve and you will be welcomed with this situation. I have seen tourist talking loudly and sleeping tiger walking up with face “Go away, you morons!!”. Even though that looked cute then, I am sure situation would be different if tiger decides to take things in its own hand…err…paws.

The awww so cute ones:

How many times have you seen a cute little baby of a monkey and made the expression like awww! so cute. Well, apparently not all can stop just with that expression. They cannot control their emotions and put out a pack of biscuits and chips out from the window to feed these animals. The point you forgot is, those are for you and not for the bird or animals whom you feel is starving and hungry.
Birds and animals adapted themselves to those situation and now knows that you will come to feed them and there have been instances when they attacked because they didn’t get food from you. Familiar with the situation??

So does this means, you should not visit forests. answer is yes and no at the same time.

If you respects wildlife and the jungle mesmerize you every time you visit. You do good study on animals and their behavior. The color of the bird amazes you and you more than happy to spot a very rare bird even if you were not able to photograph it. You maintain all rules and regulation inside the forest and help keep it clean and is genuinely concerned about it. Please visit, the forests need people like you.

If you are “oh! I don’t care”, “It my money”,”Do you know who I am?” in other word a self obsessed person who just wants a weekend visit/Holidaying/relaxing and not willing to abide by the rules and regulations, please do not visit the forest and spoil it. Take your car and 11 inch sub and go for a long drive maybe.

While I agree that government should take more measures and forest department should do their work, but it always like we should be more responsible towards others.This way both you and nature live in harmony(A word long forgotten since childhood). The supreme court does not get a chance to put ban on visit to core areas of the tiger reserve. Is this too much to ask???

P.S : This topic might feel controversial. Feel free to ignore in case you don’t like it.
P.P.S: The post is just my expression as you may take it, so I have refrained from posting links to actual incidents. If you are a wildlife enthusiast based in India, you should have probable already faced the situation or read about it.

API parsing with Backbone.js

The next part of the self note series, this time I have to parse JSON using backbone.js.
So in order to parse an API that returns result in JSON you can do the following(not necessarily the best way but it works for me)

(function($) {
var API_BASE = 'your url here';

var parser = Backbone.Model.extend({});

var apiColl = Backbone.Collection.extend({
model: parser,
url: 'form your url here'

});
var apiView = Backbone.View.extend({
el: $('#collection'),
initialize: function() {
_.bindAll(this, "render");
this.collection.bind("all", this.count);

},
render: function() {
$(this.el).html(this.counter = this.collection.length);
return this;

}
}),
events = new apiColl(),
eventView = new apiView({

collection: events

});
events.fetch({
success: function() {
console.log(events.length);
}
});
})(jQuery);

and yes, my ultimate target will be to parse the API and integrate with some open maps.

Even though Backbone’s code is pretty well explained, the main help if stuck comes from stack overflow. So really appreciate the help that I got.

Ouch! My Bad

JavaScript is powerful and Backbone.js is a nice small utility that makes it even more powerful. I was playing with Backbone and Open layers thrown over a Django system.
However there is something weird that I faced and took a good amount of my time to figure out the problem.
This blog post is kind of self note so that I notice this the first place when I face such problem again.

What was I trying to do : Write a small backbone code to display Open layers(OSM) Map.
How was I trying to do :

(function($) {
var Map = Backbone.Model.extend({});

var MapView = Backbone.View.extend({

initialize: function() {
_.bindAll(this, 'initMap');
this.initMap();
},

initMap: function() {
// Initialize Basic Openlayers;
var center = new OpenLayers.LonLat(8110203.9998955, 2170000.4068373);
map = new OpenLayers.Map(this.el, {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
var layers = [];
layers[0] = new OpenLayers.Layer.OSM(); //some more layer will go here
map.addLayers(layers);
map.setCenter(center, 12);

}
});
var map_view = new MapView({ el: $("#mapCol") });
})(jQuery);

The problem faced here was I am trying to access the DOM element even before it is ready.
Result : A webpage which shows the HTML elements, shows some access to Openlayers but no map.

Solution : I modified my code to this

(function($) {
var Map = Backbone.Model.extend({});

var MapView = Backbone.View.extend({
el: '#mapCol',

initialize: function() {
_.bindAll(this, 'initMap');
this.initMap();

},

initMap: function() {
// Initialize Basic Openlayers;
var center = new OpenLayers.LonLat(8110203.9998955, 2170000.4068373);
//alert("you are here");
map = new OpenLayers.Map(this.el, {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326")
});

var layers = [];
layers[0] = new OpenLayers.Layer.OSM(); //some more layer will go here
//$(this.el).html(map);
map.addLayers(layers);
map.setCenter(center, 12);

}
});
$(function() {
var map_view = new MapView();

});
})(jQuery);

Here mapCol is the div element where I want my Openlayers map to be displayed. For more details on Backbone and el, there is a beautiful blog post here.

P.S : There may be certain errors in the codes above. please feel free to correct me anytime.

My first birdwatching trip

Last weekend (Nov 4 -6) was amazing and it was my first bird watching/photographing trip. Before I start with the trip itself, remember I spoke about my confusion on my gears(what to buy and what not to buy). Well, I finally settled with an used Canon EOS 40D and just before the trip I got myself a Sigma 150 500 APO HSM OS lens.This combination is awesome as 40D has some amazing ISO performance even at 1000+.

So, Now the trip.

Rather than a normal travelogue like boarding a bus, getting down there, boarding a car, getting wooed out by the sight and sounds of the jungle and reaching the resort…oops I mentioned all of them. This more of a note that I am writing about my first birding trip.

If you are still guessing, well…I went to Ganeshgudi, a beautiful jungle near the city of Belgaum in Karnataka.

Three days of ultimate awesomeness with some medium weighing gears and 12 hours of continuous walking, looking and photographing birds. I managed to record some 24 species of birds including some rare species like Malabar Trogon, Crested Goshawks and Great Horn bill(this was not recorded, all I could hear was the sound of its wing flaps..gives goose bump). My 40D went b0rked in the middle of the trip with its exposure and metering not working properly. So most of my photos were taken with an exposure compensation of -2.

Still some photos came out good and they are here

The only mammal I was able to spot and photograph was Malabar Giant Squirrel. the photo is here

So, my first birding trip with my new gear and some unexpected challenges that came out with it. I guess I am learning a lot more that I expected.

P.S : Please ignore grammatical errors and other minor mistakes.

Ranthambhore Diaries #1

June 17 to June 20 was an amazing weekend. I went to Ranthambhore again, mainly because it was raining tigers in INW and I needed more experience with wildlife photography.

But what happened on the trip was marvelous, We heard from some fellow visitors that T39(A 3 and half year old Tigress) had killed a big male Blue Bull (Nil gai) and seen near it and is expected to be there for next two three days.

Saturday was test on us as we got completely drenched in rain(No photos, cameras were kept safe).

Sunday afternoon we had superb time with T39 sitting just some feet away from us in the water but Monday morning was even better as she was sleeping when we reached the place, as time flies by she woke up, answered nature’s call, slept again, sat for some time, came down to have breakfast and like previous day went again to sit in the water.

It was a complete six hour fiesta between her and us(Photographers).

Here are two snap from the whole fiesta. More to come soon…..

T39 having water post breakfast :
Princess of Ranthambhore #2

T39 Relaxing in water after breakfast :
Thanda Thanda Cool Cool - Princess of Ranthambhore  #3

Dilemma

After over 3 years of using a Powershot, I thought of graduating to a SLR. I planned for a decent SLR but had no plan on lenses.. well I never had taken that into consideration.

Then Ranthambore trip happened. I went crazy over what to buy..from a TC for my Powershot to all possible cameras that I can buy at that point of time, finally ended up buying a Canon EOS 1000D and with some good advice, a Sigma 70 300 APO DG MACRO F4 – 5.6.

Ranthambore trip was a great learning experience, my first wildlife shot was of T39 tigress. I got so confused on either to take pic or watch the tiger go just feets away from me. So did not pay attention to details. Rest of the days in Ranthambore were good, learned a lot from wildlife photographers(Sagar Gosavi and Yogesh Rane).

Next trip was after a week from Ranthambore was Jim Corbett National Park and this time I tested my setup as a camera person . Well I found myself starting from scratch here in Corbett.

My few observation in regards the last two trips were :
1) Canon EOS 1000D is an awesome camera but not at all suitable for Wildlife photography.(1.5 fps in RAW is way too slow).
2) OS/IS/VR is somehow a requirement for early morning and late evening shots(Most movements happens in this time though).
3) ISO the more the better. Noise the less the better ( 1000D scores a good point her though).

In the last two trips I narrowed down on my short comings trying to fix them but still I need a basic setup to do wildlife photography(I might be carried away with the crowd though). Here is what I shortlisted and currently in a dilemma.

1. Canon vs Nikon : Being a faithful canon user for last three years I wanted to stick to canon but found in some cases Nikon provides exactly what i want.
2. Lenses (Sigma,Canon,Nikon ) : Sigma cheap and does great job, while Canon/Nikon are better and costs a lot

Finally these are my shortlisted cameras and lens :

Canon EOS 550D : Great camera with great feature but misses on fps.
Used Canon EOS 40D : Again Great Cam but 10MP(low resolution on high crops, ISO to 1600 only).
Nikon D5100 : Pretty much does everything but I have one or two inexpensive canon mount lenses which goes wasted if I chooses this.

I pretty much narrowed down on Sigma 150 500 F5 – 6.3 APO lens which means I need high ISO a lot of times.

Taking all into consideration I am confused like never before :-(

So please help!!!!

Post Ranathambore et.al.

My last post was on my first wildlife trip to Ranathambhore. Well it was an amazing trip, I did so many things that I never imagined to have done before.

Nevertheless I got hooked to wildlife photography, even leaving the photography part aside it is pretty amazing to watch wildlife at their best(in the wild).

I came back from Ranathambhore on 4th of April but I was so hooked to the whole thing going around me,I joined the same group again on a trip to Corbett national park(16th to 21st April 2011).

What I felt, the way I reacted been there remains treasure in my memory and there is no way I can explain that in a blog post. for that you have to be in Corbett.

Took some snaps which goes here :

My current action item is to create my own gear consisting 550D, Sigma 150 – 500 OS and a telephoto mic.

P.S : I manage to get GPS traces of about 700KM (in the jungle plus some rail track) in these two trips. Hope these goes to OSM soon.e

GSOC 2011/OpenStreetMap/Projects

Like every year this years mentoring organizations for Google Summer of Code 2011 has been announced and OpenStreetMap is in this years list as well.

Now as a lot of cheap phones has the capability to click pictures in high resolution,make GPS traces,shoot videos and have a internet connection via WIFI/GPRS or mobile broadband connection. I would really love to see a mobile based OSM mapping application that can utilize this facility and able to do photo tag/Video tag with GPS traces,upload to OSM/Flickr/Youtube, create and edit basic maps.

The idea by Zhijie Shen is here. So in case if you are interested in developing such an application do get in touch with the OSM community.

Apart from this you can find a lot of interesting project ideas here.

Student application for GSOC 2011 starts from March 29th.

Brownian Motion

Before you start reading this post, I warn you its  boring and makes no sense  ..may not interest you but I am writing it because it does deserve one.

Evere since I went out of college I started looking to do something creative and something that goes with me rather than something imposed on me. I stayed in Kolkata for a while starting to look at things in a different way.The way which is completely new to me. Since this is the first time I am away from home. I started facing something which I didn’t consider a problem before, Well days past by and I had a surgery in my eyes so had to take a break .Problem is somehow I never got that interest back to go to Kolkata and start looking for what I was looking.

I joined a service MNC. I got posted to Gandhinagar, things were different again. Again lot of things happened to me when least expected. In this phase I really went through a tough time because the learning curve was way over my limit threshold.

By this time my contribution to open source is almost nill and I am almost a dormant person.

Gandhinagar period was over, I got posting in Mumbai. Interestingly this is the only place about which I knew nothing although I should have guessed something as this being such a popular place.

My friends from Gandhinagar helped me a lot. Initial days were tough out here and overall I realized that this city is so big and huge that I could easily get absorbed into it and can never be able get out.

My company has  a office in almost every single neighborhood. So the next thought in our mind after getting into mumbai is where will our office be.

When every single of my friend got a office together, I was left alone to go to a different one. Later after two months I am still where I am posted while all my friends are in different offices far away from where they were staying.

This is also when I started to do experimenting with what I can and how much I can. Because of a idle last year I was how ever a little bit apprehensive  with my confidence level.

I am now a software tester where all my friends are running behind development. However I am still in touch with some or the other opensource technology just as I wanted. So the experiment didn’t go wrong at all. I still in touch with coding just the way I wanted.

But somehow this “Just the way I wanted” makes no sense anymore because priorities as well as aspiration changes. So is the situation.

Mumbai taught me a lot of things in last few months. I saw people homeless in front of some of the mansions out here. I guess anything can happen in this city.

While all my friends have a fixed goal for next few years about their future. I am still in search for it. I don’t know what I will do in next few year to come. I like a lot of things that I want to do but they are completely different from each other and can never be persuade together.

Will I able to pursue any one of them? or will I have to leave them all and make a compromise with something else? Is it that you always need to make your mind understand that somethings you deserve and most of the things you don’t so dont worry be happy kinda things…….well I am completely clueless.

If this blog post didn’t make a single sense to you. well even I can’t make out what I have written.but this is what i am feeling/thinking/sleeping right now.

P.S : Tomorrow is the first time I am going for a outing outside Mumbai with my team. let see how it goes.

P.P.S. I hope to see myself working on a open source project soon with lots of if’s and but’s.

P.P.P.S: Ignore spelling mistakes.