Skip to content

Instantly share code, notes, and snippets.

alias gp="git pull"
alias gpr="git pull --rebase"
alias gc="git checkout ."
alias grs="git reset ."
alias gps="git push"
alias gpf="git push -f"
alias gcan="git commit --amend"
alias gcane="git commit --amend --no-edit"
alias gs="git status"
alias gd="git diff"
@HaskellZhangSong
HaskellZhangSong / config
Last active November 29, 2022 07:04 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = <Name>
email = <email>
username = <username>
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@HaskellZhangSong
HaskellZhangSong / gist:c9c7769587d87013cae16547d2519147
Last active July 17, 2021 06:29
Block Sougou InputMethod to access Internet on Windows
New-NetFirewallRule -DisplayName "Block Sougou ConfigIE TCP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ConfigIE.exe" -Protocol TCP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ConfigIE UDP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ConfigIE.exe" -Protocol UDP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ErrorReport TCP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ErrorReport.exe" -Protocol TCP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ErrorReport UDP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ErrorReport.exe" -Protocol UDP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ImeUtil TCP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWBInput\4.3.0.2160\ImeUtil.exe" -Protocol TCP -Action Block
New-NetFirewallRule -DisplayName "Block Sougou ImeUtil UDP" -Direction Inbound -Program "C:\Program Files (x86)\SogouWB
@HaskellZhangSong
HaskellZhangSong / ubuntu-alibabab-deb-src-config.sh
Last active January 5, 2020 15:50
Ubuntu配置阿里镜像源
cp /etc/apt/source.list /etc/apt/source.list.bak
rm /etc/apt/source.list
cat >>/etc/apt/sources.list<<EOF
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
@HaskellZhangSong
HaskellZhangSong / dynamic-nginx-module-ubuntu-18.04.sh
Created December 27, 2019 16:13 — forked from excid3/dynamic-nginx-module-ubuntu-18.04.sh
How to compile a dynamic nginx module for Ubuntu 18.04
# Install dependencies that nginx was originally compiled with
sudo apt install libperl-dev libgeoip-dev libgd-dev
# Get the nginx source
wget https://nginx.org/download/nginx-1.14.0.tar.gz
tar zxf nginx-1.14.0.tar.gz
# Get the module source
wget https://github.com/fdintino/nginx-upload-module/archive/master.zip
unzip master.zip
@HaskellZhangSong
HaskellZhangSong / ss_config_to_ss_url.sh
Created October 16, 2019 02:58
ss server config to ss url and qrcode
#! /bin/bash
method=`cat $1 | jq '.method'`
method1=`sed -e 's/^"//' -e 's/"$//' <<<"$method"`
password=`cat $1 | jq '.password'`
password1=`sed -e 's/^"//' -e 's/"$//' <<<"$password"`
server_port=`cat $1 | jq '.server_port'`
server_ip=`curl -s ip.sb`
url=$(echo -n "${method1}:${password1}@${server_ip}:${server_port}" | base64)