Skip to content

Instantly share code, notes, and snippets.

View MitchRatquest's full-sized avatar

Mitchell Dokken MitchRatquest

View GitHub Profile
@MitchRatquest
MitchRatquest / display-board.py
Last active January 23, 2018 03:06
ncurses-hardware-helper
#!/usr/bin/python
import subprocess, curses, curses.panel, os
from time import sleep
from menus import * #get all those stats
#################################################
#AVAILABLE BOARDS: opipc, opiz, opione, neo
board = neo
############################################
COLUMNS=79 #default tty size - 1
LINES=24
@MitchRatquest
MitchRatquest / okpg-inst.sh
Last active April 10, 2018 15:44
install script for opkg
sudo apt-get install -y gcc \
pkg-config \
libarchive13 \
libarchive-dev \
libcurl3 \
libcurl3-dev \
libgpgme11 \
libgpgme11-dev \
autogen \
autoconf \
@MitchRatquest
MitchRatquest / elinks-scrape.sh
Last active June 8, 2018 15:11
using elinks to scrape google for ecommerce
@MitchRatquest
MitchRatquest / organelle-clone-july5.ino
Created July 6, 2018 00:43
organelle clone controller stm32 blue pill
#include <OSCBundle.h>
#include <SLIPEncodedSerial.h>
#include <OSCMessage.h>
SLIPEncodedSerial SLIPSerial(Serial);
// encoder stuff below vvvvv
#define MAXENCODERS 1
volatile uint32_t encstate[MAXENCODERS];
volatile uint32_t encflag[MAXENCODERS];
@MitchRatquest
MitchRatquest / win10.ipxe
Created December 27, 2018 20:19
ipxe windows 10 boot config
#!ipxe
set serverip 172.18.0.1
set tftpboot tftp://${serverip}
:menu
menu iPXE boot menu
item --key w win10 Le Windows 10 Boot
choose os
goto ${os}
@MitchRatquest
MitchRatquest / stm32_ghx_test.ino
Last active January 22, 2019 16:16
osc ili9341 control stm32
/***************************************************
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
@MitchRatquest
MitchRatquest / change_path.sh
Last active January 6, 2020 17:08
Change shared library path on a binary
#!/bin/sh
BINARY='htop'
SHLIB_DEST="usr/lib/$BINARY"
if [[ $UID != 0 ]]
then
echo "please run as root"
exit 1
fi
@MitchRatquest
MitchRatquest / forward
Last active April 17, 2019 14:09
iptables forwarding script, basic and working
#!/bin/bash
if [ $UID != 0 ]; then echo "Please run as root"; exit 1; fi
SUBNET_ADDRESS='10.0.0.1'
SUBNET_RANGE='10.0.0.2,10.0.0.100,12h'
INTERNET="eno1" #upstream
SUBNET="enp7s0f0" #downstream
ifconfig "$SUBNET" "$SUBNET_ADDRESS" #set your ip for downstream
#ip addr add "$SUBNET_ADDRESS" dev "$SUBNET"
@MitchRatquest
MitchRatquest / setup_routes
Created May 2, 2019 21:36
general routing setup
#!/bin/bash
#assuming appliance is a dns server on another network
#and you want to be able to talk to those clients on that network
#and you can ssh into the appliance
#this might be useful if you dont want to use iptables
appliance="192.168.100.76"
route add -net 172.18.0.0 netmask 255.255.0.0 gw "$appliance"
ssh root@"$appliance" route add -net 172.18.0.0 netmask 255.255.0.0 gw 172.18.0.1; echo "1" > /proc/sys/net/ipv4/ip_forward;
@MitchRatquest
MitchRatquest / build-deb-kernel.sh
Created May 19, 2019 02:56
cdebootstrap script for armhf
#!/bin/bash
#build kernel as debian package
MAJ=4
MIN=13
VER=11
PATCH_DIR="/home/user/kernel-patches"
BUILD_DIR="/home/user/build/kernel"
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${MAJ}.${MIN}.${VER}.tar.gz
tar xvf linux-${MAJ}.${MIN}.${VER}.tar.gz