Skip to content

Instantly share code, notes, and snippets.

View fearoffish's full-sized avatar

Jamie van Dyke fearoffish

View GitHub Profile
BEGIN MESSAGE. │
jFmBIVnmuPbwMU0 8dKoOSrR4yNomDk YxfYOl8IDH86g7c slH4seKPgOtNjV9 │
NEMua3OKqloX8m8 9z7sex7eFb6TCKq 6Xr2MZHgg4XTUBu 6aFJ5yLPOVC9Y4p │
0TOJjkbUBCQOLtn 47cNPafyYvYbFIr AKQGkrQgRzjcAuO xjtiWVyBu3a9V4M │
AtzgFgTh6YlZKgV wuILVR61S9O9mid 2tI2e7tiSkCT. │
END MESSAGE.
# cli to build for multiple arches (example)
$ docker buildx build --platform linux/amd64,linux/386,linux/arm/v7 -t fearoffish/okteto:7 --push .
# devenv/bin/Dockerfile
FROM okteto/remote:0.2.5 AS remote
FROM okteto/supervisor:0.1.0 AS supervisor
FROM okteto/clean:0.1.0 AS clean
@fearoffish
fearoffish / check_state.sh
Last active March 27, 2020 14:25
Check terraform state in a set subdirectories `./check_state.sh staging`
#!/usr/bin/env bash
# Stop on ctrl-c
trap 'exit 130' INT
ENV=$1
# Check the remote cluster state against terraform state
function check_state() {
@fearoffish
fearoffish / create_labels.sh
Last active November 7, 2017 14:32 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/local/bin/bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
# Updates for making it work on OS X with a homebrew bash and ignoring null errors
###
# Label definitions
###
declare -A LABELS
@fearoffish
fearoffish / init.sh
Created October 26, 2016 14:05
Resin init script for Home-Assistant
#!/bin/sh
#
# Script options (exit script on command fail).
#
set -e
#
# Define default Variables.
#
@fearoffish
fearoffish / Dockerfile.template
Created October 26, 2016 14:04
resin.io template for getting Home-Assistant running (WIP)
FROM resin/%%RESIN_MACHINE_NAME%%-python:3.4-wheezy
ENV INITSYSTEM=on
MAINTAINER jamie@fearoffish.com
WORKDIR /usr/src/app
RUN useradd -ms /bin/bash homeassistant
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
@fearoffish
fearoffish / home-assistant@pi.service
Created April 21, 2016 11:40
Home Assistant Startup Script
# This is a simple service file for systems with systemd to tun HA as user.
#
[Unit]
Description=Home Assistant for %i
After=network.target
[Service]
Type=simple
User=%i
# Enable the following line if you get network-related HA errors during boot
@fearoffish
fearoffish / configuration.yaml
Created April 3, 2016 22:12
Home Assistant Config Example - Motion detected lights (for 10 mins) with a 'manual mode' toggle that stops them turning off
# Input boolean for deactivating the script that turns off the lights after no movement for 10 mins
input_boolean:
living_room_light_manual_mode:
name: Living Room Lights Manual Mode
initial: off
# Automation: When there is motion in the living room, activate a script to turn on the lights (shown next)
- alias: Turn on living room lights when there is movement
trigger:
- platform: state
@fearoffish
fearoffish / Makefile
Created March 29, 2016 20:25
My Makefile to get openzwave-control-panel working
#
# Makefile for OpenzWave Control Panel application
# Greg Satz
# GNU make only
.SUFFIXES: .cpp .o .a .s
CC := $(CROSS_COMPILE)gcc
CXX := $(CROSS_COMPILE)g++