Skip to content

Instantly share code, notes, and snippets.

@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 / 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

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 / 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