Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Slowly thinking...

Alex Chen Cnly

💭
Slowly thinking...
View GitHub Profile
View my.vpnc
#! /bin/bash
INTERNAL_IP4_NETMASK=255.0.0.0
INTERNAL_IP4_NETMASKLEN=8
INTERNAL_IP4_NETADDR=10.0.0.0
shopt -s expand_aliases
alias set_default_route=disabled
alias reset_default_route=disabled
View zhidao.baidu.com.css
.open-task-list, .jump-top, .top-nav-bar, .divider, #userbar {
display: none !important;
}
.search-block {
position: absolute;
}
View baike.baidu.com.css
#lemmaWgt-secondsKnow,
#side-share,
.navbar-bg-top,
.navbar-bg,
.navbar-wrapper,
.topbar,
.help,
.wgt-footer-main > .content,
.arrow,
.toggle-button,
View wenku.baidu.com.css
.doc-upload, .nav-wrap, .docBubble, .wk-other-new-cntent, .doc-tag-wrap, .reader-back2top-wrap, .reader-tools-bar-wrap, .ugctest, .fix-searchbar-wrap {
display: none !important;
}
.header-wrap {
background: #FCFCFC;
}
View lguvpn.vpnc
#! /bin/bash
INTERNAL_IP4_NETMASK=128.0.0.0
INTERNAL_IP4_NETMASKLEN=8
INTERNAL_IP4_NETADDR=10.0.0.0
shopt -s expand_aliases
alias set_default_route=disabled
alias reset_default_route=disabled
@Cnly
Cnly / rpi-mptcp-build.sh
Last active Dec 12, 2019
Automatically fetch and [cross] compile MPTCP for Raspberry Pi, yielding an easy-to-use install script.
View rpi-mptcp-build.sh
#! /usr/bin/env bash
RPI_BRANCH=rpi-4.14.y
MPTCP_BRANCH=mptcp_v0.94
# For Pi 1, Pi 0, Pi 0 W, or Compute Module:
#KERNEL=kernel
#DEFCONFIG=bcmrpi_defconfig
# Or, for Pi 2, Pi 3, or Compute Module 3:
KERNEL=kernel7
@Cnly
Cnly / makedeployzip.sh
Last active Jan 4, 2018
Make deploy.zip for AWS Lambda
View makedeployzip.sh
#! /usr/bin/env bash
rm -f deploy.zip
zip -9 -r deploy.zip . --exclude 'venv/*' '.*/*' '.*' '__pycache__/*'
cd venv/lib/python*/site-packages || exit 1
zip -9 -r ../../../../deploy.zip * --exclude 'setuptools-*/*' 'setuptools/*' 'pip-*/*' 'pip/*' 'pkg_resources-*/*' 'pkg_resources/*' 'wheel-*/*' 'wheel/*' '__pycache__/*' '*-info/*' 'easy_install.py'
cd ../../../../
@Cnly
Cnly / xkbwime.sh
Created Dec 20, 2017
Remap keys on Gnome (E.g. Swap Alt and Ctrl) without screwing up input methods
View xkbwime.sh
#! /usr/bin/env bash
ALL_SOURCES="`gsettings get org.gnome.desktop.input-sources sources`"
SOURCE_COUNT="`echo $ALL_SOURCES | tr -d -c ')' | awk '{ print length; }'`"
CURRENT_SOURCE_STR="`gsettings get org.gnome.desktop.input-sources current`"
CURRENT_SOURCE="${CURRENT_SOURCE_STR#uint32 }"
next_source() {
if [ "$CURRENT_SOURCE" -lt $((SOURCE_COUNT - 1)) ]; then
gsettings set org.gnome.desktop.input-sources current $((CURRENT_SOURCE + 1))
View ip138.py
#! /usr/bin/env python
# Partial original code came from https://www.oschina.net/code/snippet_20912_46623
import urllib2
import re
import sys
import traceback
if len(sys.argv) < 2:
@Cnly
Cnly / jdfcr
Last active Jul 7, 2016
JD-decompiled File Cleaning Regex
View jdfcr
Search and replace all occurrences with empty string to clean up file(s) decompiled with JD.
\/\* \d+ \*\/ |\/\*\s+?\*\/ |\/\* Location:.+\n.+\n.+\n \*\/