Skip to content

Instantly share code, notes, and snippets.

Running On My Way

Larry Liu g10guang

Running On My Way
View GitHub Profile
g10guang /
Last active Sep 9, 2020
config my new linux


config github/gitlab ssh key


ssh login with public key

View go_mmap_example.go
package main
import (
g10guang /
Last active May 7, 2020
sync local code to remote server
prepath=`dirname $PWD`
echo $(date)
echo "sshpass -p \"liuxiguang\"rsync -avr --delete ${PWD} phy:/home/liuxiguang/$prepath"
sshpass -p "liuxiguang" rsync -avr --delete --exclude=.git --exclude=.idea --exclude=.vscode --exclude=output ${PWD} phy:/home/liuxiguang/$prepath
g10guang / main.go
Last active Apr 10, 2020 — forked from manishtpatel/main.go
GoLang Encrypt string to base64 and vice versa using AES encryption.
View main.go
package main
import (


govendor fetch

go mod

go get
g10guang /
Last active Feb 1, 2020
python code create socket reuseaddr with subprocess and reuseaddr + reuseport
import os
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
print('create socket')
s.bind(('', 19823))

Remove untrace file.

git clean -fd
g10guang / remove_html_tag.go
Created Jan 18, 2020
golang remove html tag from string
View remove_html_tag.go
package utils
import (
// match html tag and replace it with ""
func RemoveHtmlTag(in string) string {
g10guang / .tmux.conf
Last active Jan 8, 2020
My tmux conf
View .tmux.conf
# cat << EOF > /dev/null
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see
# -- general -------------------------------------------------------------------
sudo apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo "deb xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt update
sudo apt install -y --allow-unauthenticated mongodb-org-shell