Greetings, Earthling 🖖

I’m Shantanu, aka Shaan.

Your friendly neighborhood co-inhabitant of this tiny speck of dust, I maintain this site as a stochastic log of my calculations towards the futile aim of weeding out the anomalies from the equation that gives me my “42”.

In my Clark Kent mode, I spend my day at The Trade Desk, trying to crunch through petabytes of data and trillions of queries every day to understand the human behavior and make the advertising technology world a little bit better.

Before that, I spent a couple of decades in the Semiconductors world at Qualcomm and Google, building processors and AI accelerators, tinkering with chips, operating systems, device drivers, human interface devices, security et al.

When the lights go out everywhere, I like to don my maker hat and build stuff that no one wants.

I like to make and break things around me ranging from my smart toaster/TV to my web and phone apps to my car, strumming a bit of guitar, 3d printing stuff, and of course, shit-posting on twitter @shantanugoel.

Sometimes I post some of my travel and 3d print outputs on instagram, because I’ve been told by my gen-z interns that that’s a thing to do.

Do check out some of the other subdomains that I run.

Firefly / sqlite error “unable to open database file” Solution

Recently I came across a weird error while trying to run firefly itunes server (mt-daapd) on my router (Asus wl-500w). It had something to do with sqlite and gave a vague message “Unable to open database file”. After going bonkers for a short time, I solved it and this is how.

One of my hard disks crashed recently and unfortunately it was the one I had connected to my router to serve media to me all over the house (through PS3/laptop) or when I travel (through laptop/phone). I had all the data backed up but somehow didn’t preserve the firefly server. I rebuilt the server from source using my own guide (Thank God I did it. I wouldn’t have been able to preserve my sanity finding all that out the hard way again.). But after doing all the installation and reconfiguration, it gave me a weird error “unable to open database file” every time and exited. I checked the permissions on the songs3.db file (in /opt/var/cache/mt-daapd for me) and made it writable by all but the issue persisted. I changed its ownership to the user under which firefly was running but the issue was still there. Finally I found that the server (or maybe its an sqlite thing) was trying to create a temp file in the cache directory for the transactions and since the user with which it was started, didn’t own the directory it wasn’t able to create the file in it.

Android App Wi-Fi Keep Alive updated to 1.4.1

Update: Made a minor update for a small bug that can make wi-fi keep reconnecting in quick succession.

Pushed out a new update to my Android App Wi-Fi Keep Alive today. This update brings in another work around for the issue where the wi-fi is alive on the phone and it is also connected to the network but is somehow unable to send/receive any packets to the network. The new work around will automatically re-associate your phone with the wi-fi router if it detects such a situation. This seems to make it work properly again for sometime. When it fails again, the workaround kicks in automatically again. This is not an ideal “fix” as such because streaming apps like Pandora radio etc might have a hiccup because of this but it is unavoidable as of now and atleast the notifications for mails and other things etc will work fine because this state stops even the mobile data network from taking over since the phone perceives that wi-fi is connected but is not working actually.

Cannot Change Channel Problem With Asus WL-500W

Recently I found an issue with my asus wl-500w wi-fi router that I wasn’t able to change the channel on which it was transmitting. I moved to a new location which was totally jam-packed with other wi-fi networks using same channel as mine which was hampeing my connection. I tried for umpteen number of times. Changing the channel through the web configuration did not give any error but I found that it was still transmitting at channel 1. I confirmed by checking on the “Status & Log” page, checking the logs, and running “wl status” command through ssh and they all confirmed that it was transmitting at channel 1 only, no matter what I set it to in the configuration. I even opened an issue in the firmware project for the custom firmware (by oleg and lly) that I am using but they weren’t able to help me as the wi-fi drivers are binary only.

Mute (or Answer) Skype Calls with BT Headset Button in Linux

Skype on linux works great but the problem that I faced was that it does not handle the buttons on the bluetooth headsets. My wife uses skype to call into her work related conference calls and was pretty frustrated that she had to keep sitting in front of my laptop (her laptop didn’t allow to install skype) just to switch mute on and off. So, I whipped up this little trick to do so. Here is how:

BadTokenException Error In Android Dialog

If you are creating a custom Dialog for Android, and following the Android Developers’ Creating Dialogs tutorial, then most likely you would have faced a Force Close with this exception showing up in logcat. I did too. Although I figured it out quickly, it might not be easy to find out for many, so posting it here for reference. Basically, the code given in the tutorial goes something like this:

Context mContext = getApplicationContext();       
Dialog dialog = new Dialog(mContext); 
dialog.setContentView(R.layout.custom_dialog);       
dialog.setTitle("Custom Dialog"); 
TextView text = (TextView) dialog.findViewById(R.id.text);       
text.setText("Hello, this is a custom dialog!");        
ImageView image = (ImageView) dialog.findViewById(R.id.image);        
image.setImageResource(R.drawable.android);

All looks well, but when you execute it, you will get a Force Close. The error appearing in logcat would be something like this: