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 / printer_da.cfg
Last active June 14, 2025 17:12
Klipper config for a dual z-axis ender3 with skr 1.4 turbo
# This file contains common pin mappings for the BIGTREETECH SKR V1.4
# board. To use this config, the firmware should be compiled for the
# LPC1768 or LPC1769(Turbo).
# See docs/Config_Reference.md for a description of parameters.
[stepper_x]
step_pin: P2.2
dir_pin: !P2.6
enable_pin: !P2.1
@varunmehta
varunmehta / runout.cfg
Last active June 6, 2025 00:31
runout.cfg
[filament_switch_sensor runout_sensor]
pause_on_runout: True
runout_gcode:
M117 Out of Filament
M600
insert_gcode:
M117 Resuming
event_delay: 3.0
pause_delay: 0.5
switch_pin: !PC15
@varunmehta
varunmehta / printer_sa.cfg
Last active June 6, 2025 16:16
Klipper config for Ender3 on Glass Bed
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v2.0. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader" and USB communication. Also,
# select "Enable extra low-level configuration options" and configure
# "GPIO pins to set at micro-controller startup" to "!PA14".
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
@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"