This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substitutions: | |
device_name: "saw-clamp" | |
friendly_name: "Saw AMP Clamp" | |
timezone: "Europe/London" | |
main_icon: "saw" | |
esphome: | |
name: ${device_name} | |
platform: ESP8266 | |
board: d1_mini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to open an app if not already open | |
open_app() { | |
local app_id="$1" | |
local profile_dir="$2" | |
swaymsg -t get_tree | rg "$app_id-$profile_dir" > /dev/null || \ | |
chromium --app-id="$app_id" --profile-directory="$profile_dir" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: cert-manager-webhook | |
namespace: kube-system | |
spec: | |
template: | |
spec: | |
containers: | |
- name: cert-manager-webhook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Alec Jacobson http://www.alecjacobson.com/weblog/?p=3816 | |
// clang -Wall -g -O3 -ObjC -framework Foundation -framework AppKit -o impbcopy impbcopy.m | |
#import <Foundation/Foundation.h> | |
#import <Cocoa/Cocoa.h> | |
#import <unistd.h> | |
BOOL copy_to_clipboard(NSString *path) | |
{ | |
// http://stackoverflow.com/questions/2681630/how-to-read-png-image-to-nsimage | |
NSImage * image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
substitutions: | |
device_name: mcintosh | |
friendly_name: "McIntosh C2500" | |
timezone: "Europe/London" | |
main_icon: "amp" | |
activity_threshold: "5" # Threshold (number) that the device will change from `Idle` to `Active` if power is greater than or equal to | |
esphome: | |
name: ${device_name} | |
platform: ESP8266 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# monitor asound status changes and trigger mqtt events | |
SND_STATUS="/proc/asound/card1/pcm0p/sub0/status" | |
MQTT_TOPIC="shellies/shelly1-xxxxx/relay/0/command" | |
MQTT_HOST="mqtt.home" | |
while true ; do | |
value=`cat $SND_STATUS | egrep 'state|closed'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Roon manifest for k8s | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: roon | |
name: roon | |
namespace: home | |
annotations: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Sway fade effect for windows | |
# Credit https://www.reddit.com/r/swaywm/comments/e6ihm8/smooth_fading_in_sway/ | |
# /u/jake_is_a_legend | |
from i3ipc import Connection, Event | |
from threading import Thread | |
from time import sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Credit: /u/sellibitze | |
# https://www.reddit.com/r/WireGuard/comments/emjgp0/bypass_certain_ip_from_going_into_wireguard_tunnel/fdqjr9w/ | |
from ipaddress import ip_network | |
start = '0.0.0.0/0' | |
exclude = ['8.8.8.8', '10.8.0.0/24'] |
NewerOlder