Skip to content

Instantly share code, notes, and snippets.

View graysonchen's full-sized avatar

Grayson Chen graysonchen

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:

@graysonchen
graysonchen / slack.sh
Last active February 10, 2018 07:57 — forked from andkirby/slack.sh
Shell/Bash script for sending slack messages.
#!/usr/bin/env bash
####################################################################################
# Slack Bash console script for sending messages.
####################################################################################
# Installation
# $ sudo curl -Ls http://dlj.bz/MCZmsa --output /usr/bin/slack
# $ sudo chmod +x /usr/bin/slack
####################################################################################
# USAGE
# Send message to slack channel/user
@graysonchen
graysonchen / nginx.conf
Created September 11, 2018 12:19 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@graysonchen
graysonchen / rails-api-template.rb
Created April 16, 2019 14:56 — forked from DotHide/rails-api-template.rb
Rails 5 API Application Template
require 'erb'
require 'ostruct'
# ====================
# 0. Helper
# ====================
def render_file(text, variables)
struct = OpenStruct.new(variables)
rendered_file = ERB.new(text).result(struct.instance_eval { binding })
@graysonchen
graysonchen / pi-dev-guide.md
Created March 23, 2026 18:07
Pi (pi.dev) — 终端 AI 编程助手使用指南