Skip to content

Instantly share code, notes, and snippets.

@N6UDP
N6UDP / morseopenhab.sh
Last active March 11, 2017 04:54
Morse Code OpenHab 2/Z-wave lights
#!/bin/bash
function dimmer {
curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "$1" "http://localhost:8080/rest/items/KitchenLight_Dimmer"
}
dit=0.1
dash=0.25
space=0.25
char=0.25
for i in `morsegen <(echo "$1")`; do

Keybase proof

I hereby claim:

  • I am n6udp on github.
  • I am lburton (https://keybase.io/lburton) on keybase.
  • I have a public key ASBwRcCxJgsc9coUfCJ-kQK1zy1YJi26-29DeLL4MEExego

To claim this, I am signing this object:

@N6UDP
N6UDP / network_restart.sh
Created June 10, 2019 09:09
libvirt network restart
#!/bin/bash
# Lee Burton <lburton@lburton.org>
# Based on public domain work by
# Yury V. Zaytsev <yury@shurup.com>
# http://web.archive.org/web/20150205231851/http://git.zaytsev.net/?p=anubis-puppet.git;a=blob;f=manifests/files/common/network-restart
# This script is also public domain
# Deps: bash4+, xpath, egrep, virsh
set -e
set -u
@N6UDP
N6UDP / ansibletmux
Last active February 1, 2023 09:12
single file version with group handling
#!/usr/bin/env python3
#heavily modified from https://gist.github.com/hdknr/222067185374f4ff6626
from ansible.inventory.manager import InventoryManager
from ansible.parsing.dataloader import DataLoader
loader = DataLoader()
import argparse
#lines = list(open('/etc/ansible/vaultpass'))
#loader.set_vault_password(lines[0].strip())
import os
@N6UDP
N6UDP / factorio_monitor.ps1
Last active October 31, 2024 19:55
Monitors factorio servers via the matchmaking API to notify you when people are playing
#Generic Factorio Server Monitoring Script
#Your factorio username
#$username=""
#Token from https://factorio.com/profile
#$token=""
#Add game ids, server ids, and/or names below (it's the union of them)
#Game ids are dynamic across service restarts but server ids are not as far as I can tell
#if you already have the game ids you don't need to fill your username/token as that API is unauthenticated
#but the game ids will change so best to use server_ids or server_names