Skip to content

Instantly share code, notes, and snippets.

View varunmehta's full-sized avatar
🎯
Focusing

Varun Mehta varunmehta

🎯
Focusing
View GitHub Profile
@varunmehta
varunmehta / intervalometer.py
Created May 9, 2018 18:28
Pi to click pics every 5 seconds.
# Run the file on boot;
#
# nano /etc/crontab
# @reboot root /path/to/script.sh
#
from picamera import PiCamera
from time import sleep
import time
import os
@varunmehta
varunmehta / logstash.conf
Created August 8, 2016 15:45 — forked from markwalkom/logstash.conf
Reindexing Elasticsearch with Logstash 2.0
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 1000
scroll => "5m"
docinfo => true
scan => true
}
@varunmehta
varunmehta / install-motioneye.sh
Created March 10, 2016 22:14
Gist to install motioneye and setup surveillance on a Raspberry Pi
# upgrade raspi-config
sudo raspi-config
# Install all the essentails required to get motioneye working.
# The command fails as ffmpeg does not exist on rpi repository, so you need to download and build it from scratch
apt-get install build-essential autoconf libjpeg-dev libavformat-dev libavcodec-dev libswscale-dev ffmpeg subversion git
sudo apt-get install build-essential autoconf libjpeg-dev libavformat-dev libavcodec-dev libswscale-dev ffmpeg subversion git
# Install ffmpeg source and compile
@varunmehta
varunmehta / reindex.sh
Last active March 28, 2019 14:06
Reindex elasticsearch to reduce shards from 5 to 1. Some manual work is needed before running the script.
#!/bin/bash
# Help menu for the script.
usage () {
echo "Usage: `basename $0` [-h] [-b] [-d] [-r] [-i] [-s] [http://es-ESname:9200]"
echo ""
echo "where: "
echo " -h Show this help text "
echo " -b Backup the elasticsearch indices to .json files "
echo " -d Delete the indices backed up"