Skip to content

Instantly share code, notes, and snippets.

View ziyunli's full-sized avatar
:shipit:
shipit

Ziyun "Stephen" Li ziyunli

:shipit:
shipit
View GitHub Profile
@ziyunli
ziyunli / letsencrypt_2016.md
Created May 18, 2016 00:25 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

@ziyunli
ziyunli / after
Created May 5, 2016 02:41
let's encrypt
# /etc/nginx/sites-available/default
server {
listen 80;
server_name <domain name>;
return 301 https://<domain name>$request_uri;
}
server {
listen 80;
server_name www.<domain name>;
@ziyunli
ziyunli / Getting-Cheat-Sheet.md
Last active January 4, 2017 20:54 — forked from akras14/Getting-Cheat-Sheet.md
Git Cheat Sheet
@ziyunli
ziyunli / System Design.md
Created April 19, 2016 03:55 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ziyunli
ziyunli / keybase.md
Last active May 31, 2021 01:58
keybase.md

Keybase proof

I hereby claim:

  • I am ziyunli on github.
  • I am ziyunli (https://keybase.io/ziyunli) on keybase.
  • I have a public key ASC45PrZAO0zlgn9CASDEl8c6UzW5p3TQzhEvbtH_z0Mcwo

To claim this, I am signing this object:

@ziyunli
ziyunli / church.py
Created April 9, 2016 17:54 — forked from vivekhaldar/church.py
Church numerals in Python
#! /usr/bin/python
#
# Church numerals in Python.
# See http://en.wikipedia.org/wiki/Church_encoding
#
# Vivek Haldar <vh@vivekhaldar.com>
#
# https://gist.github.com/2438498
zero = lambda f: lambda x: x