Skip to content

Instantly share code, notes, and snippets.

View HuakunShen's full-sized avatar

Huakun Shen HuakunShen

View GitHub Profile
@HuakunShen
HuakunShen / dockerize_nginx_ssl.md
Last active January 22, 2021 05:16
dockerize(nginx+ssl)

dockerize(nginx+ssl)

Web App Deployment with docker, Nginx and SSL

ubuntu+nginx+certbot - Dockerfile

FROM ubuntu:18.04

RUN apt update -y \
@HuakunShen
HuakunShen / vmware-mount-folder.md
Last active March 13, 2021 07:40
VMWARE mount shared folders

Mount shared folders with vmware

VM Machine -> Settings -> Options -> Shared Folders -> Always enabled -> Add Host Folders

sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop
sudo vmhgfs-fuse .host:/ /mnt/ -o allow_other -o uid=1000
@HuakunShen
HuakunShen / nginx-non-443-https.md
Last active March 13, 2021 07:39
HTTPS on Non-Default Port (Nginx)

HTTPS on Non-Default Port

Obtain an SSL certificate, https://zerossl.com/ is an option.

Get the following 3 files

  • ca_bundle.crt
  • certificate.crt
  • private.key

Combine the certificates

@HuakunShen
HuakunShen / nginx-static-hosting.md
Last active September 29, 2021 23:23
Nginx host static files

Nginx host static files

server {
    listen 8080 default_server;
    listen [::]:8080 default_server;

    root /var/www/html;

 index index.html index.htm index.nginx-debian.html;
package main
import (
"encoding/hex"
"fmt"
"net"
"strings"
)
func main() {
@HuakunShen
HuakunShen / remote-jupyter-notebook.md
Last active July 2, 2021 05:54
Remote Jupyter notebook

Option 1

Run this command on server

jupyter notebook --no-browser --ip <private ip> --port 8888

Access with http://<private ip>:8888

@HuakunShen
HuakunShen / openvpn3-usage.md
Last active December 28, 2023 14:49
openvpn3 Usage

openvpn3 Usage

Install openvpn3 from this website.

If you look at the man page of openvpn3, there are 2 main concepts:

  1. config: a configuration of vpn where you connects to
  2. session: a vpn session

Config

Suppose you have a configuration file called vpn.ovpn that’s connecting to a server in New York.

@HuakunShen
HuakunShen / README.md
Last active June 19, 2021 21:28
GitHub OAuth 2.0 Device Flow
@HuakunShen
HuakunShen / README.md
Last active June 19, 2021 21:27
GitHub OAuth 2.0 Web Flow
@HuakunShen
HuakunShen / Nginx-Load-Balancer.md
Last active July 18, 2021 01:06
Nginx Load Balancer

A simple Nginx Load Balancer implemented with 3 Nginx docker containers.