Skip to content

Instantly share code, notes, and snippets.

View stenius's full-sized avatar

Paul Stenius stenius

View GitHub Profile

Mexican_food.R {#mexican_food.r .title .toc-ignore}

18646 {#section .author}

2019-10-20 {#section-1 .date}

2019/01/18 16:52:57 [INFO] Terraform version: 0.11.7 41e50bd32a8825a84535e353c3674af8ce799161
2019/01/18 16:52:57 [INFO] Go runtime version: go1.10.1
2019/01/18 16:52:57 [INFO] CLI args: []string{"/home/pauls/.local/bin/terraform", "apply", "--auto-approve"}
2019/01/18 16:52:57 [DEBUG] Attempting to open CLI config file: /home/pauls/.terraformrc
2019/01/18 16:52:57 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/01/18 16:52:57 [INFO] CLI command args: []string{"apply", "--auto-approve"}
2019/01/18 16:52:57 [INFO] command: empty terraform config, returning nil
2019/01/18 16:52:57 [DEBUG] command: no data state file found for backend config
2019/01/18 16:52:57 [DEBUG] New state was assigned lineage "ec2bf51c-13bf-4266-5c74-9eb50a359913"
2019/01/18 16:52:57 [INFO] command: backend initialized: <nil>
#include <RFM69.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled = Adafruit_SSD1306();
#define BUTTON_A 9
#define BUTTON_B 6
#define BUTTON_C 5
@stenius
stenius / toggle_zoneminder_axis_camera.py
Created April 30, 2016 05:55
connect to zoneminder and enable or disable the monitor and toggle the LED on an Axis camera
import requests
camera_ip = '127.0.0.1'
camera_password = ''
camera_username = 'root'
camera_url = 'http://%s:%s@%s/axis-cgi/param.cgi' % (camera_username, camera_pa>
zoneminder_ip = '127.0.0.1'
#get current camera status
@stenius
stenius / client.sls
Last active April 11, 2016 20:57
Salt Stack state file for setting up a Consul agent that binds to a VPN tunnel
/etc/consul.d:
file.directory:
- user: root
- group: adm
- mode: 0755
/etc/consul.d/client:
file.directory:
- user: root
- group: adm
@stenius
stenius / solr.sls
Created March 17, 2016 04:41
salt solr install state
debconf-utils:
pkg.installed
base:
pkgrepo.managed:
- humanname: Unoffical Java PPA
- name: deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main
- dist: precise
- file: /etc/apt/sources.list.d/java.list
- keyid: EEA14886
@stenius
stenius / mpd_client.py
Last active March 12, 2016 02:33
Hey Athena MPD Module
from athena.classes.module import Module
from athena.classes.task import ActiveTask
from athena.apis import api_lib
from mpd import MPDClient
client = MPDClient()
client.connect("192.168.0.150", 6600)
class PauseSongTask(ActiveTask):
def __init__(self):
@stenius
stenius / ses_lambda_forward.py
Last active February 22, 2021 18:34
AWS Lambda function for forwarding inbound emails from SES and sending outbound with SES
import json
import boto3
import os
from __future__ import print_function
from email.parser import Parser
os.environ['AWS_DEFAULT_REGION'] = 'us-east-1'
# this is the email address you want the inbound mail forwarded to
# check depth of keys
#
a = {
'key1': 1,
'key2': {
'key3': 1,
'key4': {
'key5': 4
}
}
class Node:
def __init__(self, value, parent):
self.value = value
self.parent = parent
def ancestors(node):
# return all parent nodes including this node
ancestor_nodes = []
ancestor_nodes.append(node)
parent = node.parent