Posts

Showing posts with the label gist

Install motion eye on Raspberry Pi for surveillance.

Image
Decided to go on a month long vacation leaving the home all by itself. This was the perfect opportunity to put a home surveillance system in place. There was nothing I could do remotely if anything happened, but would not want to let go the jackasses who broke in! Hardware in use Raspberry Pi 2 (will work with 3 too!) Logitech 720p old web cam Sony PS3 Eye 480p web cam 64GB SD card for OS and data capture.  I tore the "Easy carry Ziplock" box on the sides for the cables to pass thru. It was placed near the window, and I did not want to leave the pi running naked, since I did not have a proper enclosure, put it in this box. Placed two cameras around the room, one on the lamp, which would monitor 4 entry/exit points in the house, and the other one near the porch to monitor if anyone was approaching the front door.  Steps to install MotionEye 

Script to re-index elasticsearch.

We started off with the default 5 shards of Elasticsearch and then suddenly realized, it was way beyond what we warranted for. After a conversation with the ES support team (which by the way is awesome! I definitely recommend them), we decided to downsize our shard level to 1. I've used elasticdump to carry out the task. It is fairly quick and versatile tool. The script assumes you have modified elasticsearch.yml to have the desired shard/index size, and have restarted the cluster for the property to take effect. The script is just a general reindexing script, it backups up the data, deletes the indices backed up and then restores from the backup. Check the script for more info.