Skip to content

Instantly share code, notes, and snippets.

View r1cebank's full-sized avatar
🎯
Focusing on rust

Siyuan Gao r1cebank

🎯
Focusing on rust
View GitHub Profile

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:

@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 / siege
Created March 13, 2017 18:30 — forked from MikeNGarrett/siege
Siege with JSON POST data
siege -c50 -t60S -H 'Content-Type: application/json' 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}'
@r1cebank
r1cebank / custom-error.js
Created February 9, 2017 23:11 — forked from justmoon/custom-error.js
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
#!/usr/bin/env python3
# Python 3 code that will read, decompress, and then recompress the UE4 game
# save file that Astroneer uses.
#
# Though I wrote this for tinkering with Astroneer games saves, it's probably
# generic to the Unreal Engine 4 compressed saved game format.
import zlib
import sys
@r1cebank
r1cebank / tiny Promise.js
Created February 29, 2016 18:22 — forked from unscriptable/tiny Promise.js
A minimalist implementation of a javascript promise
// (c) copyright unscriptable.com / John Hann
// License MIT
// For more robust promises, see https://github.com/briancavalier/when.js.
function Promise () {
this._thens = [];
}
Promise.prototype = {
@r1cebank
r1cebank / doc.md
Created September 22, 2015 21:59 — forked from aj-r/doc.md

REST Service for LoL spectators

This is an unofficial, uncomplete and (pretty sure) wrong documentation of the RESTful service which powers the League of Legends spectator mode.

This documentation is desgined to be community driven and should be extended by everyone. If you find things missing, add them please!

How it works

Riot's spectator mode works by requesting replay data via HTTP form a service. The data is split in chunks which usually contain about 30 seconds of gameplay. Additionally there are key frames which seem to contain more information then a single chunk. They seem to be used to support

let colorSpace = CGColorSpaceCreateDeviceRGB()
let componentCount : UInt = 4
let components : [CGFloat] = [
0, 0, 0, 0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
0, 0, 0, 0
]
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#include <iostream>
#include <boost/smart_ptr.hpp>
typedef struct node{
int value;
boost::shared_ptr<struct node> next;
}NODE;
boost::shared_ptr<NODE> Null = boost::shared_ptr<NODE>();