Skip to content

Instantly share code, notes, and snippets.

View MrHuxu's full-sized avatar

xhu MrHuxu

View GitHub Profile
@MrHuxu
MrHuxu / [nas] nginxConfigurations
Last active April 28, 2020 17:21
[nas] nginxConfigurations
volumes
docker/nginx/index.html:/usr/share/nginx/html/index.html
docker/nginx:/etc/nginx/conf.d
port
8008:80
# expose the 22 port for ssh login
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
# launch ss server and export port
ssserver -d start -c /etc/shadowsocks.json
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8398 -j ACCEPT
mkdir -p /root/work/nginx/logs
cd /root/work/nginx
git clone [this repo] conf.d
@MrHuxu
MrHuxu / [vps] dockerCompose
Last active April 15, 2020 04:34
vps scripts
git clone [this repo] docker-compose && cd docker-compose
docker-compose up
@MrHuxu
MrHuxu / History|-108b8d0b|G7vX.json
Last active April 29, 2022 01:52
Visual Studio Code Settings Sync Gist
{
"sync.gist": "76f3e5a767908ed2f8060b54f0072ed1",
"workbench.editor.revealIfOpen": true,
"window.title": "${activeEditorLong}",
"editor.fontFamily": "Iosevka SS18",
"editor.wordWrap": "on",
"eslint.run": "onSave",
"editor.tokenColorCustomizations": {
"[Noctis*]": {
"textMateRules": [
@MrHuxu
MrHuxu / context-test.go
Last active April 9, 2018 06:01
[go context] a demo of go context package #demo
package main
import (
"context"
"fmt"
"time"
)
func main() {
ctx1, cancel1 := context.WithCancel(context.Background())
@MrHuxu
MrHuxu / .zshrc
Last active April 5, 2018 12:39
[zsh] zsh custom confuration #configuration
#################### Oh My Zsh Configuration #######################
ZSH_THEME="ys"
plugins=(
git, go, node, npm, nvm
)
###################### Custom Configuration ########################
@MrHuxu
MrHuxu / launch.sh
Created April 4, 2018 16:15
[on ubuntu restart] scripts needed to run when restart ubuntu on vultr #scripts
# expose the 22 port for ssh login
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
# launch ss server and export port
ssserver -d start -c /etc/shadowsocks.json
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8398 -j ACCEPT
# launch nginx
sudo nginx
@MrHuxu
MrHuxu / colorize.go
Created April 4, 2018 05:57
[color in console] print text with color in console #demo
package main
import (
"fmt"
)
var colors = map[string]string{
"black": "0;30",
"red": "0;31",
"green": "0;32",
@MrHuxu
MrHuxu / .eslintrc
Last active April 16, 2018 03:07
[eslint rules] basic eslint configuration #configuration
{
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},