Skip to content

Instantly share code, notes, and snippets.

View unixorn's full-sized avatar
💭
90% Snark by weight

Joe Block unixorn

💭
90% Snark by weight
View GitHub Profile
@unixorn
unixorn / docker-compose-zigbee.yaml
Created November 26, 2022 02:23
zigbee2mqtt & zwavejs2mqtt docker-compose.yaml
version: '3.3'
services:
zigbee2mqtt:
container_name: zigbee2mqtt
restart: unless-stopped
#image: koenkk/zigbee2mqtt:1.25.2
image: koenkk/zigbee2mqtt:latest
volumes:
- /data/zigbee2mqtt/data:/app/data
@unixorn
unixorn / template-sensor.yml
Created November 11, 2022 14:08
Home Assistant Template Example
garage_in_use:
friendly_name: "garage_in_use"
value_template: >-
{% if is_state('binary_sensor.garage_internal_motion01_occupancy', 'off') and is_state('cover.garagedoor','closed') %}
off
{% elif is_state('binary_sensor.garage_internal_motion01_occupancy', 'on') or is_state('cover.garagedoor','open') %}
on
{% else %}
{{ states('sensor.garage_in_use') }}
{% endif %}

Speaker Rider

by Tatiana Mac

Before I'll agree to a speaking event, I try to do as much research I can around the event to ensure it aligns with my ethos. I want to share this in case it's helpful to any other speakers.

👐 Speaking comes with immense privilege. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most marginalised and suppressed communities.

😫 I wish I didn't have to, but this is long because I provide a lot of explanations for those of you who never had to consider these things. And I will be honest, most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

1️⃣ All of these are based on my own ethos. I don't wish to or attempt to speak on behalf of all conference speake

@unixorn
unixorn / security-group-cleanup.py
Created October 6, 2017 01:21 — forked from TomRyan-321/security-group-cleanup.py
Security Group Cleanup using boto3 with RDS check fixed
#!/usr/bin/env python
import boto3
import argparse
def lookup_by_id(sgid):
sg = ec2.get_all_security_groups(group_ids=sgid)
return sg[0].name
#!/usr/bin/env bash
#
# Clean up an instance so packer can bake an AMI from it.
#
# Copyright 2017, Jiff Inc
# License: Apache 2.0
set -o pipefail
if [ ! -z "${DEBUG}" ]; then

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@unixorn
unixorn / cookbook_helper.rb
Created January 10, 2017 19:10
Make it easier to specify a directory's contents in a Berksfile for test-kitchen
# Scan a directory in the gitroot for cookbook directories
def cookbook_search(book_directory, exclusions=[])
git_root = %x[ git rev-parse --show-toplevel ].chomp
Dir.entries("#{git_root}/#{book_directory}")
.reject { |i| %w(. ..).include?(i) }
.select { |i| File.directory?(File.join("#{git_root}/#{book_directory}", i)) }
.each do |cb|
if cb != File.basename(Dir.pwd) # Don't add an entry for ourself or Berks will error
if not exclusions.include?(cb)
@unixorn
unixorn / sync-repo-to-s3.bash
Created October 12, 2016 17:51
Snippet that uploads a local repo directory to an s3-backed one
# Don't forget the trailing slash
REPO_BUCKET="s3://bucketname/"
sync-repo-to-s3() {
# Of course, this isn't as simple as just syncing the local repo to S3.
REPO_NAME=$(basename "$1")
SCRATCH_DIR="/tmp/daqri-repo-uploader.$$"
# We assume you've already run `dpkg-scanpackages` in the local copy of the repo
# Construct an s3 path that the s3 transport is happy with
@unixorn
unixorn / unpushed.gitconfig
Created April 20, 2016 19:54
Git rebase only unpushed commits
[alias]
rebase-unpushed = rebase -i @{u}
wip = rebase -i @{u}
work-in-progress = rebase -i @{u}
Verifying that +joeblock is my blockchain ID. https://onename.com/joeblock