Skip to content

Instantly share code, notes, and snippets.

http {
proxy_cache_path /tmp/nginx/cache
levels=1:2
keys_zone=main:10m
max_size=1g inactive=1d;
proxy_temp_path /tmp/nginx/tmp;
server {
listen 80;
server_name app.example.com;
http {
proxy_cache_path /tmp/nginx/cache
levels=1:2
keys_zone=main:10m
max_size=1g inactive=1d;
proxy_temp_path /tmp/nginx/tmp;
server {
listen 80;
server_name app.example.com;
@ianchen06
ianchen06 / ESPWebForm.ino
Created February 8, 2018 05:25 — forked from bbx10/ESPWebForm.ino
Demonstrate using an http server and an HTML form to control an LED. The http server runs on the ESP8266.
/*
* Demonstrate using an http server and an HTML form to control an LED.
* The http server runs on the ESP8266.
*
* Connect to "http://esp8266WebForm.local" or "http://<IP address>"
* to bring up an HTML form to control the LED connected GPIO#0. This works
* for the Adafruit ESP8266 HUZZAH but the LED may be on a different pin on
* other breakout boards.
*
* Imperatives to turn the LED on/off using a non-browser http client.
@ianchen06
ianchen06 / c720.sh
Created January 5, 2018 15:20
Chromebook C720 key remap for search capslock ctrl escape
ian@ian-Peppy:~$
ian@ian-Peppy:~$ cat .Xmodmap
clear control
clear mod4
keycode 133 = Control_L
add control = Control_L Control_R Super_L
add mod4 = Hyper_L Super_R
keysym Control_L control = Escape Control_L
@ianchen06
ianchen06 / sort_video_links.js
Created October 30, 2017 10:48
sort the archive.org list of UC Berkeley video links by course date
@ianchen06
ianchen06 / ipsec_ikev2.md
Last active July 5, 2022 11:37
ikev2 ipsec vpn with letsencrypt certificate and ios/macOS native vpn compatibility
@ianchen06
ianchen06 / tunnel.sh
Created October 25, 2017 05:38
Tunnel to docker port from remote
#!/bin/sh
set -e
REMOTE=xxxx@1.1.1.1
ssh -fNTL localhost:8080:$(ssh $REMOTE "docker inspect --format \
'{{ .NetworkSettings.IPAddress }}' some-rethink"):8080 $REMOTE
@ianchen06
ianchen06 / README.md
Created September 1, 2017 06:44 — forked from bsodmike/README.md
OC Nvidia GTX1070s in Ubuntu 16.04LTS for Ethereum mining

Following mining and findings performed on EVGA GeForce GTX 1070 SC GAMING Black Edition Graphics Card cards.

First run nvidia-xconfig --enable-all-gpus then set about editing the xorg.conf file to correctly set the Coolbits option.

# /etc/X11/xorg.conf
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
@ianchen06
ianchen06 / Dockerfile
Created August 9, 2017 09:09
Optimized Dockerfile for Python app
FROM alpine:3.5
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN apk add --no-cache nodejs python3 libstdc++ python3-dev libxml2-dev libxslt-dev linux-headers && \
npm install -g pm2 && \
apk add --no-cache \
--virtual=.build-dependencies \
g++ gfortran musl-dev git && \
@ianchen06
ianchen06 / useful.sh
Created August 3, 2017 09:44
useful linux commands
#!/bin/sh
# replace words in file recursively
grep -r 'hello' -l --null . | xargs -0 sed -i 's#hello#world#g'