Skip to content

Instantly share code, notes, and snippets.

View r1cebank's full-sized avatar
✈️
coding above sea level

Siyuan Gao r1cebank

✈️
coding above sea level
View GitHub Profile
@r1cebank
r1cebank / flask-upload
Created September 28, 2017 16:00 — forked from dAnjou/flask-upload
Flask upload example
<VirtualHost *>
ServerName example.com
WSGIDaemonProcess www user=max group=max threads=5
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi
<Directory /home/max/Projekte/flask-upload>
WSGIProcessGroup www
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
@r1cebank
r1cebank / mario.lua
Created January 5, 2018 01:57
marIO
-- MarI/O by SethBling
-- Feel free to use this code, but please do not redistribute it.
-- Intended for use with the BizHawk emulator and Super Mario World or Super Mario Bros. ROM.
-- For SMW, make sure you have a save state named "DP1.state" at the beginning of a level,
-- and put a copy in both the Lua folder and the root directory of BizHawk.
if gameinfo.getromname() == "Super Mario World (USA)" then
Filename = "DP1.state"
ButtonNames = {
"A",
@r1cebank
r1cebank / interval.py
Created August 13, 2018 23:38
python interval
import time, threading
StartTime=time.time()
def action() :
print('action ! -> time : {:.1f}s'.format(time.time()-StartTime))
class setInterval :
def __init__(self,interval,action) :
const SerialPort = require('serialport')
const Readline = require('@serialport/parser-readline')
var port = new SerialPort('/dev/ttyUSB0', {
baudRate: 115200
});
const parser = port.pipe(new Readline({ delimiter: '\r\n' }))
parser.on('data', (data) => {
console.log(JSON.parse(data));
})

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: