Skip to content

Instantly share code, notes, and snippets.

@oldsharp
oldsharp / shadowsocks.pac
Last active August 29, 2015 14:21
customized proxy auto-config file, see https://github.com/clowwindy/gfwlist2pac
// Generated by gfwlist2pac
// https://github.com/clowwindy/gfwlist2pac
var domains = {
"gimpshop.com": 1,
"directcreative.com": 1,
"speedpluss.org": 1,
"mingpaovan.com": 1,
"wikinews.org": 1,
"joachims.org": 1,
@oldsharp
oldsharp / build-git-src.sh
Last active January 13, 2016 05:34
Build git from source
# Example procedures to build git from source.
# See https://github.com/git/git/blob/master/INSTALL for more info and
# detailed instructions.
#
# Author: Ray Chen <oldsharp@gmail.com>
# License: Public Domain
# Resolve dependency (administrative privileges may required):
# Red Hat Enterprise Linux 7 ("RHEL7") | CentOS 7:
yum install curl-devel expat-devel gettext-devel openssl-devel \
@oldsharp
oldsharp / yaswc.py
Created July 17, 2015 09:12
yet another stupid web crawler
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import re
import time
from bs4 import BeautifulSoup
from selenium import webdriver
@oldsharp
oldsharp / gitconfig
Last active December 26, 2016 07:27
gitconfig
# vi: set filetype=gitconfig :
[user]
name = Ray Chen
email = oldsharp@gmail.com
[core]
editor = vim
pager = less -+S
whitespace = trailing-space,space-before-tab,indent-with-non-tab,cr-at-eol
#
# Alpine configuration file
#
# vi: set filetype=pine :
#
# This file sets the configuration options used by Alpine and PC-Alpine. These
# options are usually set from within Alpine or PC-Alpine. There may be a
# system-wide configuration file which sets the defaults for some of the
# variables. On Unix, run alpine -conf to see how system defaults have been set.
# For variables that accept multiple values, list elements are separated by
# Options for GnuPG
# Copyright 1998, 1999, 2000, 2001, 2002, 2003,
# 2010 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
@oldsharp
oldsharp / git-format-patch.sh
Last active September 7, 2015 08:02
git-format-patch example script
# This example will tell git-format-patch to prepare patches for Alpine
git format-patch -M \
--no-cover-letter \
--in-reply-to="<alpine.DEB.2.20.1509071424250.21394@jagger>" \
--thread=shallow \
--from="Ray Chen <oldsharp@gmail.com>" \
--to="Ray Chen <oldsharp@163.com>" \
--cc="Ray Chen <oldsharp@gmail.com>" \
--add-header="MIME-Version: 1.0" \
--add-header="Content-Type: text/plain; charset=UTF-8" \
@oldsharp
oldsharp / git-send-email.sh
Last active September 7, 2015 08:03
git-send-email example script
git send-email --to="Ray Chen <oldsharp@163.com>" \
--cc="Ray Chen <oldsharp@gmail.com>" \
~/mail/drafts/ray/
@oldsharp
oldsharp / ddns.sh
Last active January 11, 2016 10:45
Dynamic DNS POST request that matches the API provided by Google Domains
#!/bin/sh
#
# Construct a Dynamic DNS POST request that matches Google Domains' API.
# The final URL format should looks like:
# https://username:password@domains.google.com/nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4
# See https://support.google.com/domains/answer/6147083
#
# Author: Ray Chen <oldsharp@gmail.com>
# License: Public Domain
@oldsharp
oldsharp / caps2ctrl.sh
Last active January 11, 2016 10:32
Turn Caps-Lock into an extra Control key
#!/bin/sh
#
# For GNOME Desktop: Turn Caps-Lock into an extra Ctrl key by changing
# the dconf value.
#
# Author: Ray Chen <oldsharp@gmail.com>
# License: Public Domain
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"