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
import time | |
import adafruit_dht | |
import board | |
from datetime import datetime | |
from stathat import StatHat | |
stathat = StatHat() | |
stathatKey = "foo@foo.com" |
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
import RPi.GPIO as gpio | |
import smbus | |
import time | |
import sys | |
import struct | |
from datetime import datetime | |
from stathat import StatHat | |
stathat = StatHat() |
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
import "sockaddr" | |
import "strings" | |
# todo - need to change logic to not `return false` on any hit of non-matching cidr | |
# as if multiple CIDRs here it will fail Sentinel rule any non-matching | |
allowed_cidrs = ["192.168.1.1/24","10.10.10.10/30"] | |
# First IP 192.168.1.0 | |
# Last IP 192.168.1.255 | |
# First IP 10.10.10.8 | |
# Last IP 10.10.10.11 |
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
# this goes with https://gist.github.com/mikegreen/74d98e87224508c242eac10d024426b9 | |
# cat dht22_test.py | |
import time | |
import adafruit_dht | |
import board | |
from datetime import datetime | |
# Initial the dht device, with data pin connected to: | |
dhtDevice = adafruit_dht.DHT22(board.D17) |
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
# this goes with https://gist.github.com/mikegreen/8a0860901c57e3b02277c82561754a1c | |
import RPi.GPIO as gpio | |
import smbus | |
import time | |
import sys | |
import struct | |
from datetime import datetime | |
bus = smbus.SMBus(1) |
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
#include <Wire.h> | |
#define SLAVE_ADDRESS 0x04 | |
#define LED 6 | |
int number = 0; | |
// Pin that input voltage and resistors are connected | |
// doc here resistor setup | |
int inputPin = A0 ; |
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 | |
time="1" # one second | |
int="ens3" # network interface | |
while true | |
do | |
txpkts_old="`cat /sys/class/net/$int/statistics/tx_packets`" # sent packets | |
rxpkts_old="`cat /sys/class/net/$int/statistics/rx_packets`" # recv packets | |
sleep $time |
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
# vault_config.hcl | |
# to start: $ vault server -config=vault_raft.hcl | |
ui=true | |
disable_mlock = true | |
storage "raft" { | |
path = "/opt/vault/" | |
node_id = "raft_01" | |
} | |
listener "tcp" { | |
address = "127.0.0.1:8200" |
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 | |
#Count TFE Metrics | |
#Requires TFE_TOKEN environment variable to be set to site admin api token | |
#Check for TFE_TOKEN | |
if [ -n "$TFE_TOKEN" ]; then | |
echo "----------------------------------" | |
echo "TFE Token detected!" | |
echo "----------------------------------" | |
else |
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 | |
# this was shared by Nick on the Vault gg, all credit to him | |
# https://groups.google.com/d/msg/vault-tool/hmejXvIFuOU/M3bKDKFBBwAJ | |
# Test Vault migration from consul to raft. | |
# Dependencies: vault, consul, nc (netcat) | |
# Writes to (and blows away) ~/migrate_consul_to_raft. | |
# Kills any running vault or consul processes. | |
# Tested on MacOS and Linux. |