Category: snippets

IOT Push Button (Like Amazon Dash)

Amazon Dash button is an incredible piece of hardware and another example of “applied engineering” in Amazon, just like Kindle. The inspiration for this project isn’t directly derived from amazon dash, I wasn’t aware of it until I started digging the internet but at end, I had to set the performance goal to Amazon dash, because …

Continue reading

Adding a display over network !

You are doomed if your laptop has only one HDMI Port & you are running Linux in that box. Unlike windows – where there are tons of easy to run solution, & there are still tons of solutions if you have big numbers in your pocket. Certainly – I neither wish to spend money on external VGA/HDMI …

Continue reading

Kindle Universal Dashboard

Kindle is Super awesome ! Because of its e-ink display. I wanted a display to present data which has – Least power consumption, Not painful to eyes & obviously one which doesn’t emit blue light. E-Ink displays fit perfectly to my requirement – acquiring a display which can be driven using Raspberry Pi or Arduino is hard, …

Continue reading

Custom Nginx with PageSpeed

Pulling nginx from source, customizing & auto updating across servers is a pain,  We use pagespeed & custom header modules across all our servers, it autominifies resources & increases page performance without giving pain. Below is script we use :

Continue reading

Offline Wikipedia with Elasticsearch and MediaWiki

Wikipedia is Awesome ! It’s open, its free – Yea. & its huge in size, millions of articles  but as developer how to exploit the free knowledge. I started digging internet just to find ways to exploit my fresh 9+ GB of XML Gzipped archive which seemed to me of no use as even a simple …

Continue reading

Maintaining JS Libs – Changing bower path

If you are web developer it becomes hard to manage all js libraries if you aren’t using any package manager. Few folks created bower to make the job easier. (As far as functionality is concerned, it works same as npm, if you have used.) Steps for installations are just for linux guys – windows people …

Continue reading

Optimal way of scheduling long job – nodejs/js

If you are using nodejs for some backend stuff to schedule some-work, probably you will hate scheduling because of two factors You can’t set long timeout Timers are removed when process restart You would probably favor cronjobs for scheduling – or may be polling database for regular interval. Loading nodejs script every 5min is a …

Continue reading

Javascript Domless events

Using jQuery or nodejs makes you addicted to pubsub (publish/subscribe) model. Nodejs has nattive support for event emitters but javascript doesn’t have. Events are only binded to a DOM, using which doesn’t make sense and its also adds to performance cost. To solve the problem i wrote a custom class which implements `on` and `emit` …

Continue reading

Converting Opensource Dictionary to JSON

Folddoc provide free online computer dictionary but they don’t have any standard tool or format to import dictionary in database or so. Dictionary can be downloaded form http://foldoc.org/Dictionary.txt Run the following nodejs code it will dump dictionary to OUTPUT.json and don’t forget to remove initial lines of disclaimer or they will add to your dictionary. …

Continue reading

Backup Server Configurations to Git

When you have multiple servers it pain to remember every configuration and it may take hours to configure servers again incase you need. It is also impractical to copy each files. There are few tools available but they come with overhead attached moreover its fun to write custom solutions 🙂 1. Create directory 2. cd …

Continue reading