Skip to content

Instantly share code, notes, and snippets.


Mitchell Dokken MitchRatquest

View GitHub Profile
MitchRatquest /
Last active Jan 25, 2022
Calishot downloader
# See here for more info:
#pip install pyfzf
from pyfzf.pyfzf import FzfPrompt
import requests, json
from pprint import pprint as p
OUTPUT_DIRECTORY = '/home/raul/books2import/'
MitchRatquest /
Last active Jan 16, 2023
Setup a local gitea server with nginx proxy
#this script sets up a git user, installs gitea, a systemd service, and an nginx subdomain redirect
#inspired by
DOMAIN=EXAMPLE.COM #Please put your actual domain here
GIT_HOME=/opt/git #/home/git in the above tutorial
GITEA_PORT=3000 #default, but you can change it
if [[ $EUID -ne 0 ]]; then
echo "you need to be root"
exit 1
MitchRatquest / make_sdcc_stm8gal
Created Dec 10, 2020
sdcc and stm8gal install
View make_sdcc_stm8gal
set -e
cd /tmp
#get the sdcc master branch, make, and install to /opt/sdcc
git clone && 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
MitchRatquest / osc_fb.c
Last active Nov 28, 2019
simple osc framebuffer beginnings
View osc_fb.c
#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 / get_depends
Last active Aug 21, 2019
dev machine setup
View get_depends
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 /
Created May 19, 2019
cdebootstrap script for armhf
#build kernel as debian package
mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
tar xvf linux-${MAJ}.${MIN}.${VER}.tar.gz
MitchRatquest / setup_routes
Created May 2, 2019
general routing setup
View setup_routes
#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
route add -net netmask gw "$appliance"
ssh root@"$appliance" route add -net netmask gw; echo "1" > /proc/sys/net/ipv4/ip_forward;
MitchRatquest / forward
Last active Apr 17, 2019
iptables forwarding script, basic and working
View forward
if [ $UID != 0 ]; then echo "Please run as root"; exit 1; fi
INTERNET="eno1" #upstream
SUBNET="enp7s0f0" #downstream
ifconfig "$SUBNET" "$SUBNET_ADDRESS" #set your ip for downstream
#ip addr add "$SUBNET_ADDRESS" dev "$SUBNET"
MitchRatquest /
Last active Jan 6, 2020
Change shared library path on a binary
if [[ $UID != 0 ]]
echo "please run as root"
exit 1
MitchRatquest / stm32_ghx_test.ino
Last active Jan 22, 2019
osc ili9341 control stm32
View stm32_ghx_test.ino
This is our GFX example for the Adafruit ILI9341 Breakout and Shield
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!