Skip to content

Instantly share code, notes, and snippets.

View MTN-RowinAndruscavage's full-sized avatar

Rowin Andruscavage MTN-RowinAndruscavage

View GitHub Profile
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / partyparrot.py
Last active February 6, 2024 23:46
DeskPi PicoMate Party Parrot
# Party Parrot adapted to DeskPi PicoMate
# from https://learn.adafruit.com/iot-twitter-listener-party-parrot/coding-the-iot-party-parrot
import os, microcontroller, board, time
import busio, digitalio, displayio, rotaryio, terminalio, asyncio
import adafruit_imageload
from adafruit_display_text import label
import adafruit_displayio_ssd1306
from adafruit_ssd1306 import SSD1306_I2C
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / process_mtr.py
Created October 30, 2023 16:47
mtr json output to csv
#!python
# Convert mtr json logs to a csv report for graphing
# Collect data intermittently from mtr with:
# while true; do mtr -j 8.8.8.8 > mtr_$(date +'%Y-%m-%d_%H:%M:%S').json; sleep 30; done
import os,datetime
import glob
import json
#!/usr/bin/python3
import argparse
import re
parser = argparse.ArgumentParser(
description = "netstat output files to graph"
)
parser.add_argument('--inputs', nargs='*')
version: '3.3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.2
ports:
- target: 9200
published: 9200
protocol: tcp
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / cf.yml
Created January 18, 2018 06:15
Ansible cloudformation creator
---
- set_fact:
cf_stack_name: "{{ item }}"
- name: Delete cloudformation for {{ cf_stack_name }}
include: cf_delete.yml
# heh, careful with this
when: ( cf_stack_name in cf_stack_names_to_delete )
tags:
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / nginx.conf.j2_openresty
Created January 18, 2018 05:42
Example nginx.conf for openresty with HTTP data rewrite
#user nobody;
worker_processes auto;
#error_log logs/error.log;
error_log logs/error.log notice;
#error_log logs/error.log info;
#error_log logs/error.log debug;
#pid logs/nginx.pid;
#!/bin/sh
#TODO.md
if [ "$1" = "-v" ]; then
ANSIBLE_VERSION="${2}"
fi
yum_makecache_retry() {
tries=0
until [ $tries -ge 5 ]
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / armedge.c
Last active April 12, 2020 08:35
OWI Robotic ARM USB for Linux
/* from http://notbrainsurgery.livejournal.com/38622.html?page=1 */
/* To compile on debian/ubuntu :
sudo apt-get install gcc pkgconf libusb-1.0-0-dev
gcc armedge.c `pkg-config --libs --cflags libusb-1.0` -o armedge
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / .bashrc
Last active August 29, 2015 14:24
BASH prompt
PS1=$'\[\033[01;36;44m\]# $( EC=$?; [ $EC -eq 0 ] && echo -n "\[\033[01;32;44m\]Exit:$EC" || echo -n "\[\033[00;31;44m\]Exit:$EC" ) \
\[\033[00;37;44m\]$(date +%Y-%m-%d\ %H:%M:%S) \[\033[01;34;49m\] \
\[\033[01;30;49m\][\[\033[00;35;49m\]\u\[\033[01;30;49m\]@\[\033[01;34;49m\]\h\[\033[01;30;49m\]:\
\[\033[00;33;49m\]\w\[\033[00;36;49m\]\[\033[01;30;49m\]]\[\033[01;34;49m\]\n\
\[\033[01;36;49m\]\$\[\033[01;30;49m\](: !\! )\[\033[00;00;00m\] '
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;\W\a\]$PS1"
@MTN-RowinAndruscavage
MTN-RowinAndruscavage / metaballs.rb
Last active August 29, 2015 14:20
chef-spaghetti
## loosely based on https://github.com/miketheman/knife-role-spaghetti
require 'graphviz' # gem install graphviz
config = {}
# 'png' is easier to view
# 'svg' is smaller / faster / searchable
config[:graphformat] = 'png'
# false is faster and more organized/orthogonal
config[:neatograph] = false