Last week I posted about potentially using my fitbit Charge HR for presence, and was looking for some way to figure out its MAC address. Here are some ways to do it. BLE scan First make sure the tracker is not connected to your phone. The simplest way is to turn off bluetooth on the phone (or force-close the fitbit app). Once this is done, the tracker not connected to any host app, starts advertising using bluetooth low energy. Then from some linux host with BLE enabled adapter (in my case ra...| Posts on Sajal Kayan
How to programmatically detect whether I am at home or not? - That’s the problem I am currently trying to solve. In this post I will outline what methods I am using and what I have tried/considered. I use this presence information to automatically switch off lights when I leave my home, and turn them on when I return. By return I mean when my state changes from not-present to present Previous Solution (Wi-Fi) For about a year, I used my phone being present on my Wi-Fi network as an indicato...| Posts on Sajal Kayan
A lot of web-content these days passes thru untrusted intermediaries, especially plain text traffic which is often intercepted by ISP proxies for caching (and other purposes ;) ). A compromise at these places can subject your users to malicious payload, mostly in the form of javascript. The obvious solution to these issues is to use TLS i.e. https:// sites, which is more accessible these days thanks to Lets Encrypt. But even this does not give complete end-to-end coverage because many sites u...| Posts on Sajal Kayan
I have a use-case to run an external Go binary from within an Android app. By external i mean something that was not bundled inside the APK, but rather (in my case) downloaded from the Internet. The reason for not bundling in-APK is that I need to be able to auto-upgrade the binary without upgrading the APK. APK updates either require user-action or play store or root - all three are not possible for my use-case. I spent an entire day on the issue(android n00b here), which turned out to be a ...| Posts on Sajal Kayan
tl;dr version One of the new features of upcoming Go 1.5 release is the awesome tooling around building Android (and iOS) apps using Go code. Recently after playing with Ivy - an app made by Go mobile team - I wanted to give it a go (pun intended). Ivy is supposedly written in pure Go, unfortunately the source of it’s mobile implementation is not open yet. Since I don’t know Java, my original goal was to try and make the whole app in Go, but thats not really possible. So I ended up using ...| Posts on Sajal Kayan
I am starting to read the draft http/2 spec and realized its quite strict and leaves little to interpreter’s imagination. Here are the wordcounts for various specs for following words : MUST, REQUIRED, SHALL, SHOULD, RECOMMENDED, MAY, OPTIONAL RFCTotalMUSTSHOULDMAYSHALLREQUIREDRECOMMENDEDOPTIONAL rfc2616 (http/1.1)799348 (43.55%)256 (32.04%)180 (22.53%)2517 rfc723[0-5] (superseeds rfc2616)668344 (51.50%)163 (24.40%)126 (18.86%)126710 http2-17 (http/2)296219 (73.99%)31 (10.47%)41 (13.65%)211...| Posts on Sajal Kayan
I recently purchased a WT1520 router for $15 from Aliexpress to play with. I have a project in mind which would require few nodes running my custom Go code spread out throughout the world. A Raspberry Pi (almost $40 if you include SD card, etc) fits perfectly for my purpose, but I am looking to be cheap. Not to be dissing on the pi, its awesome and LOT more powerful than the WT1520, I’m just trying to find the cheapest device for my purpose. Raspberry Pi ($35+) and WT1520 ($15 shipped) doin...| Posts on Sajal Kayan
Over the last few months I’ve been playing with MultiPath TCP and in this post I will show how I use it to leverage my humble True ADSL line at home. For performance and security reasons, I tunnel all my traffic thru a VPN. This is not necessarily to circumvent censorship, but to circumvent the evil transparent proxies my ISP puts in middle. The total bandwidth available is ~10 mbps down / ~1 mbps up. Introduction to MultiPath TCP MultiPath TCP is an interesting effort to use multiple inter...| Posts on Sajal Kayan
After 2 years of neglecting this blog, I’ve moved away from wordpress and am hosting it on Github Pages. The site is built using Hugo. Source repo : https://github.com/sajal/sajalblog Built pages : https://github.com/sajal/sajal.github.io Some links, especially RSS URLs might be broken currently.| Posts on Sajal Kayan
tl;dr version : This is how I spent a Saturday evening. <blink>Warning: If you like to write Java, stop reading now. Go back to using Hadoop. It's a much more mature project.</blink> As a part of my job, I do a lot of number processing. Over the course of last few weeks, I shifted to doing most of it using MapReduce using Disco. Its a wonderful approach to processing big data where the time to process data is directly proportional to the amount of hardware you throw at it and the quantity of ...| Posts on Sajal Kayan
I've been using True ADSL for years, and I absolutely love their service (and especially the transparent proxy). Here are some of the reasons why :- CensorshipProtecting me from bad stuff - Interwebs has a lot of "bad" things out there. My ISP takes good care of me by not letting me access things I am not supposed to see... Even sites not explicitly blocked by court-order. I don't know what I would do without them. My head would probably explode if I saw porn, and my feelings would get hurt i...| Posts on Sajal Kayan
Yesterday, DFP launched asynchronous ad loading. For the past few months ive beentrying to load ads in a manner where it doesn't affect rest of the page load, this new development is like a dream come true. (The tests above were run on webpagetest.org on IE8 at Dulles, VA) Thank you Google! You just made my day.| Posts on Sajal Kayan
Many Asian ISPs do not provide clean internet. They route all HTTP sessions thru a transparent proxy. Here is a simple way to check if you are behind one. sajal@sajal-laptop:~$ ping -c 4 www.cdnplanet.com PING www.cdnplanet.com (107.20.181.99) 56(84) bytes of data. 64 bytes from ec2-107-20-181-99.compute-1.amazonaws.com (107.20.181.99): icmp_req=1 ttl=42 time=314 ms 64 bytes from ec2-107-20-181-99.compute-1.amazonaws.com (107.20.181.99): icmp_req=2 ttl=42 time=313 ms 64 bytes from ec2-107-20-...| Posts on Sajal Kayan
Recently, I was evaluating CDN options for a client with some unique challenges. We ended up using Amazon CloudFront, but ill detail the options we looked at and what let us to this decision. Some things to note:- We would serve CSS, JS, Images referred to from stylesheets and some website images thru the CDN. Due to the nature(trust me) of the site we expect a higher than normal miss rate. The access is spread across a wide number of urls, some may get lower hits. Speed is important. Website...| Posts on Sajal Kayan
Today, I was looking into web performance issues for a new client who wishes to remain anonymous and saw an interesting example of value provided by improving performance. One of the first things I do when looking into a new site is look at Google Analytics to understand a little about the sites visitors. This helps in prioritizing changes which affects the majority of users. An interesting observation :- Pageviews for all visitorsAverage Pageviews for all visitors Adsense revenue also follow...| Posts on Sajal Kayan
Using Cloudflare's 1.1.1.1 might lead to slower CDN performance| www.sajalkayan.com
In a CDN'd world, OpenDNS is the enemy!| www.sajalkayan.com
Check if you are behind a transparent proxy| www.sajalkayan.com