Skip to content

Instantly share code, notes, and snippets.

@mveinot
mveinot / Geiger.yaml
Created February 20, 2024 00:28
Geiger.yaml
esphome:
name: geiger-counter
friendly_name: Geiger Counter
external_components:
- source: github://TheStaticTurtle/esphome_syslog
components: [syslog]
esp8266:
board: nodemcuv2
@mveinot
mveinot / homeassistant.conf
Created February 16, 2024 22:59
Nginx config for homeassistant
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
# Update this line to be your domain
server_name homeassistant.domain.net;
# These shouldn't need to be changed
#!/opt/local/bin/perl
# ^ perl installed using Homebrew
# make it harder to suck
use strict;
use warnings;
# mediainfo command
my $height_cmd = "/usr/local/bin/mediainfo '--Inform=Video;%Height%' ";
; Configuration file for Duet WiFi (firmware version 1.20 or newer)
; executed by the firmware on start-up
;
; generated by RepRapFirmware Configuration Tool on Thu May 10 2018 12:24:40 GMT-0300 (ADT)
; General preferences
G90 ; Send absolute coordinates...
M83 ; ...but relative extruder moves
M667 S1 ; Select CoreXY mode
#!/usr/bin/perl
use strict;
use Roku::RCP;
use GD;
use Image::Resize;
# connect to Roku
my $rcp = new Roku::RCP('192.168.5.40');
@mveinot
mveinot / scrape.py
Last active November 30, 2016 17:02
#!/usr/bin/python3
import urllib.request
import lxml.html
import untangle
import sys
def rchop(the_string, sub_str):
if (the_string.endswith(sub_str)):
return the_string[:-len(sub_str)]
#!/usr/bin/python3
import untangle
doc = untangle.parse('/home/gpeverill/bryden.xml')
# use python's handy 'for item in list' syntax to traverse the list of Assets
for asset in doc.root.Dealership.Assets.Asset:
# save the VIN cdata value to a variable and print it
// ESP8266 with 20x4 i2c LCD
// Compatible with the Arduino IDE 1.6.4
// Library https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
// Bavensky :3
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/************************
Version history
0.99.14 - Jan 12/2016
Migrate to MQTT for notifications
0.99.13 - Jan 7/2016
Add /temperature route to just return text/plain current temperature
0.99.12 - Jan 2/2016
Add DS18B20 for temperature sensing and reporting
Use SPIFFS filesystem for hosting web assets
0.99.11 - Dec 25/2015
@mveinot
mveinot / sendLCDcommand.pl
Created November 28, 2015 14:31
Send commands to a connected LCD over serial
#!/usr/bin/perl -w
use strict;
use warnings;
chomp(my $status = `osascript -e 'tell application "iTunes" to player state as string'`);
if ($status eq 'playing')
{
chomp(my $artist = `osascript -e 'tell application "iTunes" to artist of current track as string'`);