New hobby

My 2014 Christmas started early with purchase of Lulzbot TAZ 4 3D printer. Already enjoying making some useful and not so much things.

So far i spent hours with Slic3r and Cura (I find Cura giving better prints out of the box), printed dozen of Tarot Gimbal bracket for IRIS+ drone and sold on eBay, learned basics of CAD in FreeCAD, OpenSCAD and Blender. Some of my original works:

Easy to make adapter allowing to use 3xAA batteries where D batteries are required:

How to price yourself?

This was a response to https://news.ycombinator.com/item?id=8409020 , decide to post it on my blog.

Simple approach which while took some time, did work great for me in long term:

Cloning typescript repo from codeplex

So trying to clone typescript repo from codeplex i am getting:

tasksel: aptitude failed (100)

So today I tried to swap some desktop packages and got not very helpful:

tasksel: aptitude failed (100)

Common solution if you google it is to run:

apt-get update

and fix whatever errors, if you get one. I guess most common would be missing GPG keys for some of repositories used. Another one would be to run:

apt-get -f install

to fix whatever broken packages are.

But in my case none of these helped. I found real reason why tasksel was failing by running it in test mode:

Why it is not necessary for a job candidate to disclose their current salary

This is actually a comment to the blog post at https://www.linkedin.com/today/post/article/20140603205337-223492-the-lo... , but I hope it will clarify my thoughts on interviewing for a new job.

Docker containers and dnsmasq on the host

I am using dnsmasq to orchestrate libvirt virtual machines and provide custom hostname resolve rules. To use dnsmasq you normally put "nameserver 127.0.0.1" into your /etc/resolv.conf .

Scalling app deployed to Dokku

I am trying various open source PaaS based on Docker and so far the easiest one is Dokku.

The problem with Dokku is that it does not manage scaling of your app by launching more containers with yours application. You can install third-party plugins, which will start multiple processes inside single docker container, but this doesn't work well for web apps listening on one port. And I could not find how to leverage SO_REUSEPORT in Express.js app.

How to reboot Motorola SURFboard modem from command line

I got this annoying problem - my cable modem start acting weird after a while. So I wanted to setup cron job to restart it sometimes around 3am each day, but the problem is - there is no SSH or any kind of API access. But there is admin panel where you can click "Reboot" button. To solve this problem I used Zombie.js module:

sudo npm install zombie -g

and wrote small script to login into admin interface and click Reboot button:

Libvirt, UFW and port forwarding via DNAT

I am running several virtual machines on my server for different applications. And I am using port forwarding to route connections to appropriate virtual server. For example, I have separate mail server and I map host's port 25 to this virtual server port 25.

MySQL not use indexes for subqueries used in IN clause

One of clients mentioned awful slow query from Drupal's Boost module:

DELETE FROM boost_crawler WHERE hash IN (
  SELECT ca.hash_url FROM boost_cache ca
  WHERE ca.expire BETWEEN 1 AND 434966399 OR ca.expire > 434966400
)

Running EXPLAIN query turns out MySQL ignores indexes for boost_crawler.hash column completely. And I am not alone:

Pages