Skip to content

Instantly share code, notes, and snippets.

View wangjiezhe's full-sized avatar
🏠
Working from home

Jiezhe Wang wangjiezhe

🏠
Working from home
View GitHub Profile
@wangjiezhe
wangjiezhe / Xmodmap
Created May 8, 2014 06:31
~/.xmodmap
! 交换Escape和Alt_R
clear mod1
keycode 9 = Alt_R NoSymbol Alt_R
keycode 108 = Escape NoSymbol Escape
add mod1 = Escape Meta_L
@wangjiezhe
wangjiezhe / zshrc
Last active August 29, 2015 14:01
~/.zshrc
# Alias
alias duh="du -d 1 -h|sort -h"
alias gsubu="git submodule update --init --recursive"
alias gfu="git fetch upstream"
alias gmuo="git merge upstream/master origin/master"
alias gmms="git merge master src"
alias glga="git log --stat --decorate --graph --all"
alias lb="ls -B"
alias cman="man -L zh_CN.utf8" # Man in Chinese
alias ack-grep="ack"

关于学生和楼长及保安之间的关系的调查问卷

基本信息

  1. 你的性别
  1. 你所在的宿舍楼
  • ______
@wangjiezhe
wangjiezhe / yum_proxy_switch.sh
Last active August 29, 2015 14:04
a simple script to change proxy used in yum repo
#!/usr/bin/env bash
GOAGENT="proxy=http://127.0.0.1:8087"
SSLCACERT="sslcacert=/home/wangjiezhe/Downloads/googleappengine/goagent/local/CA.crt"
IPV6="proxy=http://pkuproxy.acg.gd:1898"
YUM_PATH="/etc/yum.repos.d"
error() {
echo "Usage: $(basename "$0") goagent|ipv6|none"
exit 1
@wangjiezhe
wangjiezhe / unzip3_gbk.py
Last active February 17, 2021 14:00
解决zip文件中文乱码问题
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
unzip3_gbk.py: Deal with zip files using encoding GB2312/GBK/GB18030
"""
import os
# import sys
import argparse
import zipfile
@wangjiezhe
wangjiezhe / advcp_install.sh
Last active October 23, 2022 22:42
install 'cp' and 'mv' utilities with progress bar patches
#!/usr/bin/env bash
set -e
tmpdir=$(mktemp -t -d advcp.XXXXXX)
cd ${tmpdir}
wget https://aur.archlinux.org/packages/ad/advcp/advcp.tar.gz
tar xf advcp.tar.gz
source advcp/PKGBUILD
@wangjiezhe
wangjiezhe / dog_install.sh
Last active August 29, 2015 14:08
Install command 'dog'
#!/usr/bin/env bash
set -e
PROXY="--proxy http://127.0.0.1:8087"
tmpdir=$(mktemp -t -d dog.XXXXXX)
cd $tmpdir
# curl -O $PROXY https://launchpad.net/ubuntu/+archive/primary/+files/dog_1.7.orig.tar.gz
# curl -O $PROXY https://launchpad.net/ubuntu/+archive/primary/+files/dog_1.7-8.diff.gz
@wangjiezhe
wangjiezhe / dfc_install.sh
Last active August 29, 2015 14:08
Install command 'dfc'
#!/usr/bin/env bash
set -e
PROXY="--proxy http://127.0.0.1:8087"
check_and_preinstall() {
CHECKLIST=(${depends[*]} ${makedepends[*]})
num=0
for package in ${CHECKLIST[*]}
do
@wangjiezhe
wangjiezhe / add_wine_directory_to_dashboard.sh
Last active August 29, 2015 14:08
Add 'Wine' directory to dashboard on Gnome 3.14
#!/usr/bin/env bash
dconf write /org/gnome/desktop/app-folders/folder-children "['Utilities', 'Sundry', 'Wine']"
dconf load /org/gnome/desktop/app-folders/folders/ < 'wine_directory.conf'
@wangjiezhe
wangjiezhe / add_to_zshrc.sh
Last active August 29, 2015 14:08
pip upgrade all
#!/usr/bin/env bash
cat << EOF | tee ~/.zshrc
PIP_UPGRADE="$(pwd)/pip_upgrade.py"
alias pip-upgrade="sudo python \${PIP_UPGRADE}"
alias pip3-upgrade="sudo python3 \${PIP_UPGRADE}"
EOF