Friday, January 27, 2012

Package dependency hell

I thought that dependency issues are a things of the past. I mean it is the 21st century after all. Well not so fast. Today I had the pleasure to spend 20 minutes to install python-ldap. One of my iPhone app project is a Point of Sale app. It connects to the backend for categories, products, and user login and uses the company's LDAP server for authentication.
Simple task isn't it... not so fast. Backend server running Ubuntu linux. I am writing all my server code in Python using the Django framework.

Let's see what we need to accomplish it:
Started by running pip install django-auth-ldap... Success. to install into the virtual environment. Installs without issue, nice. Next lets boot up the Python shell and try to import it and do some testing... Failed. Gives me a nice message that it's missing python-ldap. No problem lets jump out of the Python shell.Run pip install python-ldap... Big fat fail "error: command 'gcc' failed with exit status 1". I've been doing C coding for awhile to know that's not a good sign. First I though it maybe a virtuelenv issue so I tried it with the package manager, sudo apt-get install python-ldap... Failed. WTF!! How can it be?! I mean if Ubuntu does not know how to install it properly then who can?

Well I have been using Linux since '94 and no I do not have gray beard or beer belly. Looked up how can apt-get check metadata, found build-dep. Super. Lets run it again sudo apt-get build-dep python-ldap... Success. Long behold it found an other 55MB worth of packages it needs. Gave it 'Y' to install and after a few seconds I got my shiny python-ldap up and running. What I don't get is why on earth Ubuntu doesn't do this by default, or at least give me the option after a failed attempt.

Thanks to django-auth-ldap good docs the rest is history. Now the app authenticates every user with their LDAP credentials and marks all their sales. Sweet :D

Thursday, January 26, 2012

Finding the right domain name is a challenge

Last week I decided it's time to start blogging again. This time though I plan on staying on top of it and share my indie experiences and/or struggles. I have been a loyal reader of iDevBlogADay. Envy their commitment and they are inspiring me to do the same. That was the easy part. Then came the question "what should be the domain name"? Should I just keep it on a subdomain by the blogging platform or get my own? If I get my own should it be my username I use on all the social network sites or something unique?
So many questions, unknown... I turned to twitter as usual and trusting that some kind folks will help me out. Sure enough there was a few replies with great ideas. Inspired by the awesome list, my wife ended up with the winner. iCodeRogue.com. I like what it means. I always have been a rogue coder who does not follow the trend and does not tries to do fancy design patterns. I have been doing software consulting for over a decade now and I can tell you from experience that all my clients care about is ship the product on time. Or as Jamie Zawinski said it in Coders at Work "At the end of the day, ship the f@#!%$& thing!". If you haven't read Coders at Work Go Do it Now! It will change your life. 
I code by 3 rules (even rogues have rules) but that will be an other blog post. So you have to come back and read it.

Thanks to you all encouraging me to start this journey. Will do may best to keep up with it.
Stay tuned I got lots to share.