Skip to content

Instantly share code, notes, and snippets.


Christopher Su csu

View GitHub Profile
soheilhy /
Last active Mar 6, 2021
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

kyledrake / ferengi-plan.txt
Last active Feb 21, 2021
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all:
# Current known FCC address ranges:
# Confirm/locate FCC IP ranges with this:
# In your nginx.conf:
location / {
LibertysYarn / timeline.css
Created Jan 30, 2014
Responsive Timeline - Bootstrap 3
View timeline.css
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
beeftornado / _Library_LaunchDaemons_com.beeftornado.ipfw.plist
Last active Mar 5, 2016
Limiting time machine bandwidth on my OSX Mavericks machine
View _Library_LaunchDaemons_com.beeftornado.ipfw.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST
1.0//EN" "">
<plist version="1.0">
jonbinney / Dockerfile
Last active Dec 13, 2017
Dockerfile for ROS hydro on ubuntu precise
View Dockerfile
FROM ubuntu:precise
# ubuntu precise image doesn't have universe repo
run echo "deb precise main universe" > /etc/apt/sources.list
run apt-get update
RUN apt-get install -y wget
# install ROS
RUN sh -c 'echo "deb precise main" > /etc/apt/sources.list.d/ros-latest.list'
RUN wget -O - | apt-key add -
View Dockerfile
# Ruby 1.9 using ruby-ni
# VERSION 0.0.1
FROM base
MAINTAINER Ivan Acosta-Rubio ""
ADD /etc/resolv.conf
# Installing basic stuf: wget, git, ruby
amberj /
Created Sep 25, 2013
Bash script to install/setup headless Selenium (uses Xvfb and Chrome)
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source:
larrybolt /
Last active Feb 17, 2021
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/
willurd /
Last active Mar 8, 2021
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
macton / chromebook_tips.txt
Last active Apr 4, 2016
Random tidbits for Chromebook
View chromebook_tips.txt
Turn off power down on time out
Turn off power down on lid close
$ sudo stop powerd
Open port 22 for ssh
$ sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
Set hostname
$ sudo hostname <new-hostname>