Feb 16, 2013

Heroku Error H14 with Django

H14 Error on Heorku


Today morning I did a new push to www.bikenomads.co.in with images from the fantastic 2013 calendar.

And the website died :(

One minute it was working fine, and the next it died ! Showing a problem with the app, and if you are the administrator to check the logs.

It took me 2 hrs to fix this, as Heroku site is not clear on what to do in case of errors ( see here for list of errors in Heroku) . So, here's a short guide to fix it ( this guide is for a Django project but I think it should work out similarly for other platforms )

First , if the app is not loading , check the logs in heroku. So, I logged into the web console and could not find the error log at all ! Apparently you need to use the command line for the logs as :

$ heroku logs
and it showed something like this to me : 
2013-02-16T08:35:49+00:00 heroku[web.1]: Process exited with status 143
2013-02-16T08:35:51+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/ host=www.bikenomads.co.in fwd="122.161.143.22" dyno= queue= wait= connect= service= status=503 bytes=

The what ?! Web process exited ?? Then how will the site run ? I checked the web console and it did not show anything under "Dynos" ( I am also not sure if it existed 2 months back?) 

Check with heroku ps if there is any process running: 
$ heroku ps
That did not return anything. 

So, a bit of search over the net and stackexchange pointed to something called the Procfile - which I had never used before. Apparently, heroku picks up the info on what to run automatically, but sometimes it jinxes. It is safer to put the information into a Procfile . This problem seems to keep recurring for over a year, but Heroku guys have not fixed it or fixed their tutorials, and that is where it all starts going downhill. 

Now follow the steps below to fix it for your installation : 
1. Create a file called Procfile ( it is case sensitive - so capitalize P !) in the root directory of your application ( where you have the venv folder ) . On windows you will have to make sure that windows does not add a .txt extension . I use linux so it was just 'touch Procfile'.
2. Edit the file and put in the following details for Django ( other apps you will need to figure out depending on what is needed to run it ) :
web: python website/manage.py runserver 0.0.0.0:$PORT
Note the spacing and the IP you need to give. If you miss out the last part, it will run on localhost which you will not be able to connect to from your machine. 
3. git add the file and do a git push heroku master to push this file to the server. We are not done yet even though the push says everything is fine.
4. Remember the heroku ps did not give any results earlier ? So, now you need to attach the process. Do this with the following command to add a web dyno :
$ heroku ps:scale web=1
Scaling web processes... done, now running 1
Check your website now and it should be working ! 

And check out my site : http://www.bikenomads.co.in 

Feb 4, 2013

Product Spec of a A Basic Phone

I was recently looking for a basic phone for my uncle ( and also for myself ) which would be cheap and have a long lasting battery life. I am yet to find something which suits me, but it got me thinking that there is no really good low end phone OS now.

What has happened in the last few years is that with the advent of the touchscreen, everyone wants to sell a touchscreen phone. Now, it makes sense when you have something which consumes a lot of data - e.g. for emails or browsing or facebook. And the low end phones - like the nokia Asha series - which are cheap to sell, have this touch tacked onto the phones. This is a pretty bad experience as things like scrolling etc do not work well.

The closest phone that I came to liking was the Motofone, but like Motorola is apt to do, they under-made the phone, and it did not do that well.

Motofone F3 - not quite there.


So, here is my specifications of a low end phone.


  • It will be a phone without internet access
    • There are many people who do not want internet access. They buy the phones and never enable 3G on the SIMs or if they do, they hardly use it. 
    • There are many places in the world where you do not have internet access. E.g. travelling in many parts of India. 
  • It will need to have a great battery life
    • I envisage that it should have a week's battery life. One of the most irritating things about phones nowdays it that you need to charge them atleast twice a day. 
    • Great battery life also means that if you leave the phone charger on a short trip, you do not worry. 
  • It will have a fast and responsive addressbook which syncs through your PC
    • After all, once you remove internet access, all that remains on the phone is the actual phone. 
    • Syncing with the PC means that your address book can be updated to google or whatever service. This will be through an installed program. 
      • Essentially this will be quite simple as the extract from the phone will be a simple vCard export which can be imported to various services. 
  • It will have a good camera
    • 5MP or so. Saves to a SD card so that it can be easily inserted into a card reader on the laptop or an external attachment. 
    • I find the camera is an invaluable addon to the phone for the sheer easy of access. 
    • Maybe can have a dedicated button to start the camera. 
  • It will not be touch based. 
    • For the limited functionality, touch is not required. 
  • FM radio
    • This is a good requirement as it really used by a lot of people. I do not know why high end phones do not come with FM radio.
  • Casing/Screen properties
    • Screen should be big so as to have a lot of display area. I would want 2/3 of the front to be screen. 
    • On not using the phone, the screen should show : 
      • The current time
        • Can be enhanced for multiple timezones / sunrise/moonrise/etc. 
      • The FM radio station if playing 
        • Only the FM should be controllable via a trackball/pad.
      • Missed calls/sms incoming status. 
        • When incoming call, the entire screen area should be having the details of the caller from the Phone book. 
          • Font should be easily readable from arms length.
    • On activating the phone: 
      • Same as on not using the phone, but now can select the different rows of activities to check them out. 
      • Pressing numbers should instantly start the phonebook lookup based on number and letters
    • It should be eInk
      • Colour eInk if the phone has a camera
      • Else b/w eInk. 
  • Waterproof casing for isntances of using the phone in rain. Normally, with today's phones we cannot. 
  • Touch casing of the phone so that if you drop it, it does not crack. 
Would all this be achievable within 5k INR ? 

Do you think that such a basic phone will have a market ? 


Feb 2, 2013

Tiger Tiger

Disclaimer : Major Philosophical Rant.

TIGER, tiger, burning bright  
In the forests of the night,  
What immortal hand or eye  
Could frame thy fearful symmetry?  

In what distant deeps or skies         
Burnt the fire of thine eyes?  
On what wings dare he aspire?  
What the hand dare seize the fire?  

And what shoulder and what art  
Could twist the sinews of thy heart?
And when thy heart began to beat,  
What dread hand and what dread feet?  

What the hammer? what the chain?  
In what furnace was thy brain?  
What the anvil? What dread grasp
Dare its deadly terrors clasp?  

When the stars threw down their spears,  
And water'd heaven with their tears,  
Did He smile His work to see?  
Did He who made the lamb make thee?

Tiger, tiger, burning bright  
In the forests of the night,  
What immortal hand or eye  
Dare frame thy fearful symmetry?
- William Blake



It is one of the most endangered species on earth. It is also the most royal ones. This was the 2nd time in my life that I have seen the tiger face to face in the wild - and both the times it has been in Ranthambore Wildlife Sanctuary - one of the few haunts left for the tiger. 

You can describe what you see. Take a few pictures in the gathering dusk. But you cannot share the feeling you get when you see the magnificent creature staring at you, as though looking into the depths of your soul. 

It was a transformational journey to the jungles of rajasthan and the chance meeting with the Tigers. You see, once you see them, you are left wondering what the heck am I doing ? Is the deskjob - where you spend the entire time of your life replying to emails - life ? Comeon, there has to be more into it. Its like the mist of gadgets, conversations, pressing demands lift, and you suddenly catch a glimpse of something beyond the mist, something you suddenly feel gives a larger meaning to life. 

Questions . Questions. Questions. 

Why do people poach the magnificent creature ? Cant they see anything beyond their greed ? 

Why do corporations and businesses want to denude and permanently destroy the jungles ? 

Why do we just keep doing our job without thinking of the bigger picture of life ? 

Questions that I have no answer for. But the seed of thought has been watered. Life is more than what we live in our apparently busy lives. Life is more than consumer greed and running after the next gadget. Life is happening all around us and we are ignoring it. 

Dec 31, 2012

In Memory of the Delhi Braveheart

In Memory of the Delhi Braveheart

( Taken from the google page for India today)

Oct 22, 2012

Virtual Box VPN settings

I use the VirtualBox VPN a lot for checking out the various new flavors of OSs that come out. Part of the job and part of my curiosity. Unfortunately, it seems that the network detection over the VPN is not good, so I was usually ending up getting no network in the VM. However, if I disconnect the VPN, it would work.

This is a pain, as I need access to emails even though I am playing around with settings in the VM. After a few frustrations, I finally found the way out. So, in case someone is facing this problem ( and from the stack exchange posts, it seems that many are) here are the steps to follow:

Step 1: In your VM go to Devices -> Network Adapters.


Step 2: Change the 'Attached to' to "Bridge Adapter" and use the WLAN settings. 


It should now work. If it does not, change the name in the dropdown list. 

Aug 14, 2012

Ubuntu no sound fix for USB audio

Update 14/08/2012 - please see Edit2 below for a solution. 

Ubuntu 11.10 seems to be quite a step back in terms of usability. Things which worked in 10 are broken now. One of the things that was driving me crazy was the audio was not working sometimes.

My system uses a USB audio system (Bose Companion 5). I believe this issue is there on other systems using USB audio also.

When I used to boot, the system would come up but there was no audio. The audio would start once I would slide the volume slider down and up. But if I start VLC video player, the sound would go away all together and the only way it would work was to reboot the system. This was nuts.

After a lot of searching, i finally got the solution from Ubuntu Forums . Here's the relevant part of the solution.It involves un-installing and re-installing the audio systems.

Open a terminal and enter the following:
sudo apt-get remove --purge alsa-base
sudo apt-get remove --purge pulseaudio
sudo apt-get clean && sudo apt-get autoremove
sudo apt-get install alsa-base
sudo apt-get install pulseaudio


For some reason while removing alsa-base it removes the ubuntu-desktop. So you need to install it again.
sudo apt-get install ubuntu-desktop

Now reboot your system. Once it comes up you will see that the audio icon on the top bar is no longer there. But now all sound should be working without fiddling around.

Drop me a comment if you had this problem and this change worked for you.

Edit: Seems there is still some reboot issue as pointed out by Albin in the comments below. Once you reboot - you will need to go to Settings -> Sound and slide the volume indicator up and down to get the sound. :(

Edit 2 : 14/Aug/2012

I entered a bug for this as I got frustrated. And then after googling extensively I finally got a solution of setting usb audio as primary sound device and it seems to work.

Essentially you need to do the following steps :


1. Edit the file /etc/modprobe.d/alsa-base.conf . Since this is a system file you will need to sudo to get this done. e.g. 
$sudo vim /etc/modprobe.d/alsa-base.conf
2. Scroll down to the end. Now you have to change the line which says 
options snd-usb-audio index=-2
to 
options snd-usb-audio index=-1
Reboot and it should work. 

Aug 9, 2012

Ubuntu - getting it to show partitions

One of the main frustrations that I have with Ubuntu nowdays , apart from the USB audio problem and the grouping of open windows problem, is that it has stopped listing the windows partitions that I can mount. I do not know who is the Product Manager, but he/she has their heads in a jar.

This blog post is a howto to undo that harm for the people who dual boot.

Fixing the problem of partitions not showing up ( see the rectangular area for what I am talking about)

The solution, it turns out, is quite simple. You need to use the Advanced Setting application to turn the slider to on as in the image below. You can achieve the same thing by using the udisks command from the command prompt also if you want, but I am not gonna talk about that here.

Toggle this option!

Once you toggle this switch, the partitions will be shown in the bar on the left side. however, you will still need to click them to mount them - which is fine with me as I do not want to mount all of them.

Install the advanced setting using Ubuntu Software Center or Synaptic.

In case you do not find the advanced settings, you will have to find it in the Ubuntu Software Installer and install it. I do not know why this is not installed by default.

Aug 6, 2012

Mars - Curiosity Has Landed

Not often you get to watch a historic event like this. If you are one of the people who were in office and not following the event, you should just die. You are not living, but existing.

A good resolution image from Curiosity after landing (c) NASA
Yes. It took a lot of money for this.
Yes. There are other big problems the world is facing.

So What ?

Does it mean that you stop dreaming ? For this is nothing but a huge boost to one's imagination.

My earliest recollection of Mars is from an encylopedia on the Solar system of a barren red planet. This was followed by fantastic novels like Edgar Rice Burroughs's Princess of Mars books ( recently made into a movie - John Carter ). I was hooked to science fiction - it was probably the first scifi book I read. Years go by , but this morning's events brought back all those memories. I know they are fictitious, but they add to the sense of wonder.

The landing was being live streamed by NASA on their website to millions around the world as well as a few News channels like CNN. As the lander went into the final descent the only information from it was a 'hearbeat' - like a continuous pinging that 'all iz well'. Finally came the first image - a tiny 64x64 pixel image in which the wheel could just be seen ! Wow! Like someone mentioned on twitter - it was back to the days of dialup - but considering the space between the Earth and Mars - a feat of technology !

The journey itself took 9 moths - so for those born today, you know what happened 9 months back ;)

Next we expect to see some great images being sent to the Earth. The objective of the mission is to see if life ever existed on Mars.

Now, if you are interested here are some links:
PS : If you know of more Sci-Fi books on Mars, please leave a comment below :)

Aug 1, 2012

Android on the Netbook

Hey, did you know that you can run Android on the netbook ?

I wanted to get some faster and more usable OS on the netbook I have. Ubuntu with its new direction towards the Unity interface is not one of my favourites. It is buggy and slows down the system quite a bit.

I am currently using Linux Mint which is ok, but i feel that again its just as fast as Ubuntu. Also, the problem is that with the changes in UX in the last few years, it looks archaic.

I was struck by the idea if any of the mobile OSs could be available on the netbook. The only viable choice was Android and I started searching for any project which has this available. I was quite in luck and found the Androidx64 project ! The result is as below. This is so far running off the USB pen drive, as I did not want to install it without first checking everything is running.


Details : 

 Netbook : 

  • Acer One 

 OS : 

 What works : 

  • Most of the things. 

 What does not work:

  • Wifi ( cant seem to get it to working yet)
  • Waking from sleep is not working well. 

How to Install:

  1. Download the android iso. The EEEPC one works for the netbooks.
  2. Download unetbootlin for your OS
  3. Use unetbootlin to write the iso to a USB pen drive. 
  4. Boot from the pendrive and enjoy or be frustrated :D

Jul 17, 2012

6.5k + Pageviews in a month ! Thank you all !

I was just looking at the analytics for this blog, and fell off my chair - I have 6.5k + pageviews in the month of March ! That is just awesome !


Thank you all for visiting my blog ! 

I am not sure why the spike ? The posts in march were not that many or that interesting.

The top post is - strangely enough - bugzilla installation post. It is not an original post - though I modified the post to be more readable and helped out in a few comments.

Also, looking at the top posts, it seems people are more interested in tech stuff.


Jul 15, 2012

Minimalstic Designs

Simplicity is the ultimate sophistication.
- Leonardo Da Vinci

Life is really simple, but we insist on making it complicated.
- Confucius

Everything should be made as simple as possible, but not simpler.
- Albert Einstein

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
- Antoine de Saint Exupery
 
I am becoming a fan of minimalism. Somehow the simplicity appeals to my aesthetic senses. So, in keeping with that, I worked out a simpler theme for this blog. Let me know how it looks.