Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block wxiaoguang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
wxiaoguang /
Created May 14, 2020
Check whether Linux user's password is correct.
checkPassword () {
shadowLine=$(grep "^${user}:" /etc/shadow)
passwordSalted=$(strField "$shadowLine" ":" 2)
enc=$(strField "$passwordSalted" "$" 2)
wxiaoguang /
Last active Jan 17, 2020
A mysql & mariadb server helper (use downloaded generic binary package). You can run multi instances on one server, each instance uses their own data & log directory.
# how it works:
# put mysql.cnf and mysql.env in a directory for an instance, cd to this directory, run ` ...`
# or run `MYSQL_INSTANCE_ROOT=the_directory ...`
# mysql.cnf keeps all configurations except directory-related things (eg: do not set data or log dir in mysql.cnf)
# the mysql.cnf and directory-related configs will be automatically merged into the MYSQL_INSTANCE_CONFIG_FINAL file
wxiaoguang /
Last active Jul 16, 2019
python3 virtualenv/venv helper bash script (env init, env bootstrap, pip requirement installation, program exec)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export VIRTUAL_ENV="$DIR/.venv"
View My Karabiner Complex Config
"title": "Mine",
"rules": [
"description": "Simultaneously press Up/Down + Right to get a PageUp/Down",
"manipulators": [
"type": "basic",
"from": {
"simultaneous": [{"key_code": "up_arrow"}, {"key_code": "right_arrow"}],
You can’t perform that action at this time.