Skip to content

Instantly share code, notes, and snippets.

View MitchRatquest's full-sized avatar

Mitchell Dokken MitchRatquest

View GitHub Profile
@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 / 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 / quickAP.sh
Last active May 13, 2019 11:09
install dhcp server and wifi ap on orangepi board
#
# Sample configuration file for ISC dhcpd for Debian
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
@MitchRatquest
MitchRatquest / get_depends
Last active August 21, 2019 05:50
dev machine setup
#!/bin/bash
function get_packages() {
packages="dnsmasq audacious elinks filezilla build-essential \
lua5.3 screen tmux vim tree libpython-dev python-pip python-setuptools \
python-django postgresql x11vnc libqt5webkit5 patchelf rpm2cpio \
libatasmart-bin smartmontools shellcheck libqt5webkit5 cmake scons tox \
qconf xserver-xorg-dev bison linux-headers-$(uname -r).* libssl-dev \
libmicrohttpd-dev net-tools john wamerican-insane file patch diffutils \
iw libjsoncpp-dev libcurl4-openssl-dev shellinabox figlet toilet i3 \
clang device-tree-compiler rsync luakit qt5-default geany cifs-utils \
@MitchRatquest
MitchRatquest / osc_fb.c
Last active November 28, 2019 18:32
simple osc framebuffer beginnings
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/fb.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <inttypes.h>
#include <math.h>
#include "lo/lo.h"
@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 / 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 / make_sdcc_stm8gal
Created December 10, 2020 03:58
sdcc and stm8gal install
#!/bin/bash
set -e
cd /tmp
#get the sdcc master branch, make, and install to /opt/sdcc
git clone https://github.com/swegener/sdcc.git && cd sdcc
export CFLAGS=-static; export LDFLAGS=-static;
./configure --disable-mcs51-port --disable-z80-port --disable-z180-port --disable-r2k-port --disable-r2ka-port --disable-r3ka-port --disable-gbz80-port --disable-tlcs90-port --disable-ez80_z80-port --disable-z80n-port --disable-ds390-port --disable-ds400-port --disable-pic14-port --disable-pic16-port --disable-hc08-port --disable-s08-port --disable-pdk13-port --disable-pdk14-port --disable-pdk15-port --prefix=/opt/sdcc