Skip to content

Instantly share code, notes, and snippets.

@cnaude
cnaude / cm1100.py
Created June 19, 2023 21:19
Gather Netgear CM1100 metrics and send them to InfluxDB V2
#!/usr/bin/env python3
"""Gather Netgear CM1100 metrics and send them to InfluxDB V2"""
import argparse
import re
import requests
from datetime import datetime
from influxdb_client import InfluxDBClient
@cnaude
cnaude / keybase.md
Created January 11, 2023 15:53
keybase verification

Keybase proof

I hereby claim:

  • I am cnaude on github.
  • I am chrisnaude (https://keybase.io/chrisnaude) on keybase.
  • I have a public key ASCTp3JwZvgLOEo7Mi9OHGUu4BQTx3LTon8nEg7qlISWBwo

To claim this, I am signing this object:

@cnaude
cnaude / crc-32-mpeg-2.go
Last active July 26, 2021 16:41
crc-32 mpeg-2 implementation in golang
package main
// based on https://stackoverflow.com/questions/54339800/how-to-modify-crc-32-to-crc-32-mpeg-2
import (
"fmt"
)
// crc32mpeg2 : calculate crc-32-mpeg-2 checksum
func crc32mpeg2(b []byte) uint32 {
@cnaude
cnaude / randomizer.go
Created June 28, 2021 18:34
create random strings based on file input
package main
import (
"bufio"
"flag"
"fmt"
"math/rand"
"os"
"strconv"
"time"
#!/bin/bash
for D in $(ls /sys/block/|grep ^sd); do
DEVS="${DEVS} --device=/dev/${D}"
done
export SCRUTINY_WEB=true
export SCRUTINY_COLLECTOR=true
docker run -it --rm -d -p 8081:8080 -v /run/udev:/run/udev:ro \
--cap-add SYS_RAWIO \
#!/usr/bin/python3
"""Gather Netgear CM600 metrics and send them to InfluxDB"""
import argparse
import httplib2
import re
from datetime import datetime
from influxdb import InfluxDBClient
graph aardvark_metro {
node [shape=box, style=filled]
edge [penwidth=4]
root = R02B05
rankdir = LR
node [color=crimson, fontcolor=gray10]
R01 [label="Rolling Hills"]
@cnaude
cnaude / ruby_hash_example.erb
Created June 25, 2018 15:42
example erb hash uiterate
Hello world.
<% node['attrname'].each |key,val| do -%>
KEY: <%= key %>
VAL: <%= val %>
<% end -%>
@cnaude
cnaude / dungeon.mc
Last active July 16, 2018 10:57
Minecraft Dungeon Commands
# inititalize
/effect @p 15 1000000 2
/playsound record.13 block @a ~ ~ ~
/say @p has entered the Dungeon!
/setblock -262 169 314 chest 5 destroy {Items:[{Count:1,Slot:1,id:iron_sword}]}
/setblock -259 169 311 trapped_chest 3 destroy {Items:[{Count:2,Slot:1,id:rotten_flesh},{Count:4,Slot:3,id:rotten_flesh},{Count:6,Slot:7,id:cooked_fish}]}
/setblock -245 159 315 chest 4 destroy {Items:[{Count:1,Slot:1,id:diamond_sword},{Count:1,Slot:2,id:beetroot_soup},{Count:1,Slot:3,id:beetroot_soup}]}
/setblock -252 174 306 trapped_chest 2 destroy {Items:[{Count:1,Slot:1,id:emerald},{Count:1,Slot:2,id:emerald},{Count:1,Slot:3,id:emerald},{Count:1,Slot:4,id:emerald}]}
/setblock -248 173 296 trapped_chest 5 destroy {Items:[{Count:1,Slot:1,id:iron_axe},{Count:1,Slot:3,id:mushroom_stew},{Count:1,Slot:6,id:mushroom_stew},{Count:1,Slot:5,id:mushroom_stew}]}
/setblock -252 185 298 chest 3 destroy {Items:[{Count:1,Slot:0,id:diamond_block},{Count:1,Slot:9,id:emerald_block},{Count:1,Slot:18,id:gold_block}]}
@cnaude
cnaude / install-optifine.sh
Created October 21, 2017 15:40
Install Optifine into MultiMC instance on Linux workstation
#!/bin/bash
MULTIMCDIR=/home/cnaude/Minecraft/MultiMC
if [[ -z "$2" ]]; then
echo "** Usage: $0 [Optifine.jar] [instance]"
exit 1
fi
FILE=$1
if [ ! -e "$FILE" ]; then