Skip to content

Instantly share code, notes, and snippets.

View andrewshulgin's full-sized avatar
👾

Andrew Shulgin andrewshulgin

👾
View GitHub Profile
@andrewshulgin
andrewshulgin / buildroot-docker-compose.yml
Created January 10, 2024 02:32
Docker Compose File for Buildroot
services:
set-permissions:
image: alpine
user: root
volumes:
- buildroot:/mnt/buildroot
command: chown -R 1000:1000 /mnt/buildroot
build:
image: buildroot/base:20211120.1925
volumes:
@andrewshulgin
andrewshulgin / wg-apply
Last active October 13, 2021 11:11
Apply Wireguard configuration without restart
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <WG_IFACE>" > /dev/stderr
exit 1
fi
wg addconf wg0 <(wg-quick strip wg0)
function clickWhilePresent() {
let found = false;
for (let btn of document.getElementsByTagName('button')) {
if (btn.innerText == 'View More') {
btn.click();
setTimeout(clickWhilePresent, 500);
found = true;
break;
}
}

Keybase proof

I hereby claim:

  • I am andrewshulgin on github.
  • I am andrewshulgin (https://keybase.io/andrewshulgin) on keybase.
  • I have a public key whose fingerprint is 157B 4CE1 6509 14C7 D42A 8AB1 1EA7 91C4 E275 3DB1

To claim this, I am signing this object:

#!/usr/bin/env python3
import datetime
import fcntl
import glob
import html.parser
import logging
import os
import re
import shutil
import socket
/*
* gcc -fPIC -Wall -ldl -shared -o pwd_override.so -Wl,-soname,pwd_override.so pwd_override.c
*/
#define _GNU_SOURCE
#include <pwd.h>
#include <stdio.h>
#include <dlfcn.h>
@andrewshulgin
andrewshulgin / vbox-sysrq.sh
Last active January 7, 2019 07:34
A script to send SysRq key sequence to a VirtualBox guest
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo "usage: $0 <uuid|vmname> <key>" > /dev/stderr
exit 1
fi
case "$(echo "$2" | tr '[:upper:]' '[:lower:]')" in
0 ) K1='0B';;
1 ) K1='02';;
2 ) K1='03';;
3 ) K1='04';;
@andrewshulgin
andrewshulgin / bspatch.patch
Last active December 24, 2018 21:29
KingstVIS 3.1.1 dark theme fix
import eventlet
eventlet.monkey_patch()
from eventlet import wsgi
from app.wsgi import application
from optparse import OptionParser
def run_wsgi_app(app, address='', port=8080, max_threads=25):
wsgi.server(eventlet.listen((address, port)), app, max_size=max_threads)
@andrewshulgin
andrewshulgin / contact.lua
Last active December 5, 2017 05:49
Contact Form with NGINX, Lua, Python and SMTP
ngx.req.read_body()
local fp = assert(io.popen('/usr/local/bin/contact.py >> /var/log/nginx/contact-form.log 2>&1', 'w'))
fp:write(ngx.var.remote_addr)
fp:write('\r\n')
fp:write(ngx.req.get_body_data())
assert(fp:close())