Skip to content

Instantly share code, notes, and snippets.

View jubaleth's full-sized avatar

Jubaleth jubaleth

View GitHub Profile
@jubaleth
jubaleth / auth_provider.py
Created November 15, 2022 01:29 — forked from sidoh/auth_provider.py
Custom HomeAssistant auth provider
import logging
import jwt
from urllib.parse import urlparse
import urllib.request
from collections import OrderedDict
from typing import Any, Dict, Optional, cast
import voluptuous as vol
@jubaleth
jubaleth / gmail_to_slack.js
Created October 28, 2022 00:22 — forked from andrewmwilson/gmail_to_slack.js
Google Apps Script: Send Gmail emails to Slack
// You will also need to create a gmail filter to add the 'send-to-slack' label
// to any emails you want sent to slack
function sendEmailsToSlack() {
var label = GmailApp.getUserLabelByName('send-to-slack');
var messages = [];
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
messages = messages.concat(threads[i].getMessages())
@jubaleth
jubaleth / keybase.md
Created May 18, 2018 07:21
keybase.md

Keybase proof

I hereby claim:

  • I am jubaleth on github.
  • I am jubaleth (https://keybase.io/jubaleth) on keybase.
  • I have a public key ASDnNh7gKxahGxh9IWqOdHNV8oC421S1kPfRens81T7wNwo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jlkaufman on github.
  • I am jubaleth (https://keybase.io/jubaleth) on keybase.
  • I have a public key ASDnNh7gKxahGxh9IWqOdHNV8oC421S1kPfRens81T7wNwo

To claim this, I am signing this object:

#! /bin/bash
# Should be run on a vanilla Debian install.
# This script will strip it down to bare minimum and yet bootable distro.
# Simulated run onlyi (--simulate). Uncomment this and Comment out the "Real Deal".
#apt-get --simulate purge $(dpkg-query -Wf '${Package;-40}${Essential}${Priority}\n'|awk '$2 ~ /nooptional|noextra/ {print $1}'|grep -v -E 'anacron|busybox|initramfs-tools|insserv|klibc-utils|libklibc|libsemanage-common|libsemanage1|libustr-1.0-1|libuuid-perl|linux-base|linux-image')
# Real deal.
apt-get purge $(dpkg-query -Wf '${Package;-40}${Essential}${Priority}\n'|awk '$2 ~ /nooptional|noextra/ {print $1}'|grep -v -E 'anacron|busybox|initramfs-tools|insserv|klibc-utils|libklibc|libsemanage-common|libsemanage1|libustr-1.0-1|libuuid-perl|linux-base|linux-image')
@jubaleth
jubaleth / gist:a19b7ccea5e8ce1d7587
Created January 31, 2015 08:40
Crosscompile issue
make: Warning: File 'Makefile' has modification time 226674 s in the future
make all-recursive
make[1]: Entering directory '/home/vagrant/ha-client'
make[1]: Warning: File 'Makefile' has modification time 226674 s in the future
Making all in src
make[2]: Entering directory '/home/vagrant/ha-client/src'
make[2]: Warning: File '.deps/haClient-mmapGpio.Po' has modification time 187238 s in the future
/home/vagrant/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -std=c++0x -I/home/vagrant/raspberrypi/rootfs/usr/include -static -L/home/vagrant/raspberrypi/rootfs/usr/lib -L/home/vagrant/raspberrypi/rootfs/lib -o haClient haClient-ha-client.o haClient-SignalHandler.o haClient-daemon.o haClient-config.o haClient-client.o haClient-mmapGpio.o -lboost_thread -lboost_program_options -lboost_system -lpthread
haClient-client.o: In function `boost::asio::detail::socket_ops::getaddrinfo(char const*, char const*, addrinfo const&, addrinfo**, boost::system::error_code&
@jubaleth
jubaleth / backup.sh
Created September 17, 2013 03:15 — forked from nherment/backup.sh
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`