Skip to content

Instantly share code, notes, and snippets.

server {
listen 80;
listen [::]:80;
root /home/public;
index index.html index.htm index.php;
server_name localhost;
location / {
server {
server_name domain.tld www.domain.tld;
listen 80;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name domain.tld www.domain.tld;
ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/whk/public;
index index.php index.html index.htm;
server_name server_domain_or_IP;
location / {
@zue666
zue666 / encode.sh
Created April 24, 2017 00:40 — forked from lisamelton/encode.sh
This is the shell script I use to drive HandBrakeCLI to re-encode video files in a format suitable for playback on Apple TV, Roku 3, iOS, OS X, etc.
#!/bin/bash
# encode.sh
#
# Copyright (c) 2013 Don Melton
#
# This version published on June 7, 2013.
#
# Re-encode video files in a format suitable for playback on Apple TV, Roku 3,
# iOS, OS X, etc.
@zue666
zue666 / balance.go
Created March 25, 2018 12:33 — forked from darkhelmet/balance.go
Simple TCP load balancer in Go.
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)
@zue666
zue666 / ws-client.go
Created March 27, 2018 11:05 — forked from diorahman/ws-client.go
golang websocket example with basic auth
package main
import (
"log"
"net/http"
"encoding/json"
"golang.org/x/net/websocket"
"fmt"
)
@zue666
zue666 / proxy_copy.go
Created July 11, 2018 13:54 — forked from jbardin/proxy_copy.go
Go TCP Proxy pattern
package proxy
import (
"io"
"log"
"net"
)
func Proxy(srvConn, cliConn *net.TCPConn) {
// channels to wait on the close event for each connection
@zue666
zue666 / default.conf
Created July 19, 2018 15:45
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@zue666
zue666 / mysql-docker.sh
Created December 10, 2018 22:23 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
package main
import (
"flag"
"log"
"net/http"
"strings"
)
// FileSystem custom file system handler