Skip to content

Instantly share code, notes, and snippets.

@werdnum
werdnum / homelab-rants.md
Last active August 11, 2023 04:38
Andrew's homelab rants

Storage

In a low power homelab environment, all storage is a trade-off.

Shared drive

Most people coming to homelabs initially want a big shared replicated volume that is stored redundantly across the cluster and operates for all intents and purposes as if it's independently attached to each node.

This setup has the following properties:

  • Consistency: Medium
@werdnum
werdnum / arp.py
Created September 27, 2015 13:38
#!/usr/bin/env python
from scapy.all import *
import calendar
import requests
import time
import yaml
last_triggered = {}
with open("buttons.yaml", "r") as stream:
@werdnum
werdnum / fix_subtree_submodules.sh
Created May 7, 2015 10:08
Simple script to fix git submodules inside subtrees
#!/bin/bash
find . -name .gitmodules | grep -v './.gitmodules' | while read file;
do
$dir = `dirname $file`
git config -f $file --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f $file --get "$url_key")
#!/usr/bin/env python3
import csv
import json
import re
import requests
data = {}
def append_data(name, newData, source):
/**
* This is more or less an IconWidget that can be flagged
* @class
* @extends OO.ui.IconWidget
* @mixins OO.ui.FlaggedElement
* @constructor
* @param {Object} [config] Configuration options
*/
OO.ui.IconDemoWidget = function OoUiIconDemoWidget( config ) {
config = config || {};
vagrant:lib/ (extrawikis✗) $ RUBYLIB=. hiera -c test_hiera.yaml role::extrawikis::wikis -d [8:47:08]
DEBUG: 2015-03-17 08:47:10 +0000: Hiera YAML backend starting
DEBUG: 2015-03-17 08:47:10 +0000: Looking up role::extrawikis::wikis in YAML backend
DEBUG: 2015-03-17 08:47:10 +0000: Looking for data source common
DEBUG: 2015-03-17 08:47:10 +0000: Cannot find datafile /var/lib/hiera/common.yaml, skipping
nil
#!/usr/bin/env ruby
class Hiera
module Backend
class Extrawiki_backend
def initialize
begin
require 'net/http'
require 'json'
rescue LoadError
elastic+ 9328 0.0 0.0 15940 940 ? Ss Mar14 0:00 /tmp/heimao24
elastic+ 9333 0.0 0.0 15940 940 ? S Mar14 0:03 /tmp/heimao24
elastic+ 9334 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9335 0.0 0.0 15940 940 ? S Mar14 1:08 /tmp/heimao24
elastic+ 9336 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9337 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9339 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9340 0.0 0.0 15940 940 ? S Mar14 0:30 /tmp/heimao24
elastic+ 9763 0.2 0.0 85500 1216 ? Ssl Mar11 18:42 /tmp/Conr
elastic+ 16042 0.0 0.0 16964 976 ? Ss Mar12 0:00 /tmp/Linux24 > /dev/null 2>&1
elastic+ 9328 0.0 0.0 15940 940 ? Ss Mar14 0:00 /tmp/heimao24
elastic+ 9333 0.0 0.0 15940 940 ? S Mar14 0:03 /tmp/heimao24
elastic+ 9334 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9335 0.0 0.0 15940 940 ? S Mar14 1:08 /tmp/heimao24
elastic+ 9336 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9337 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9339 0.0 0.0 15940 940 ? S Mar14 0:00 /tmp/heimao24
elastic+ 9340 0.0 0.0 15940 940 ? S Mar14 0:30 /tmp/heimao24
elastic+ 9763 0.2 0.0 85500 1216 ? Ssl Mar11 18:42 /tmp/Conr
elastic+ 16042 0.0 0.0 16964 976 ? Ss Mar12 0:00 /tmp/Linux24 > /dev/null 2>&1
#!/bin/zsh
DIRS=(`echo ~/wm-dev/vagrant{,/mediawiki{,/extensions/*,/skins/*}}`)
for dir in $DIRS; do
test -d $dir || continue;
test -e $dir/.git || continue;
(
cd $dir &&
git pull --rebase || echo "Pull failed on $dir" && break