Skip to content

Instantly share code, notes, and snippets.

View geekdada's full-sized avatar

Roy Li geekdada

View GitHub Profile
@geekdada
geekdada / create db and grant.mysql
Created June 16, 2014 08:58
新建一个 DB 并授权
DROP DATABASE IF EXISTS `<db name>`;
CREATE DATABASE `<db name>`
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
USE 'mysql';
GRANT ALL PRIVILEGES ON <db name>.* TO '<username>'@'localhost' IDENTIFIED BY '<password>'
WITH GRANT OPTION;
FLUSH PRIVILEGES;
@geekdada
geekdada / gist:53eb32e1032325a2ee60
Last active February 10, 2016 07:18
My Chrome Extensions
1Password: Password Manager and Secure Wallet https://agilebits.com/onepassword
Adblock Plus https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdccddilifddb
Alisec Extension https://chrome.google.com/webstore/detail/lapoiohkeidniicbalnfmakkbnpejgbi
AngularJS Batarang https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk
Awesome Screenshot: Capture &amp; Annotate https://chrome.google.com/webstore/detail/alelhddbbhepgpmgidjdcjakblofbmce
@geekdada
geekdada / blacklist
Last active August 29, 2015 14:08
翻墙代理列表
.aaron-powell.com
.akafms.net
.akamai.net
.akamaihd.net
.akamaistream.net
.cdn1-rdio.com
.cdn2-rdio.com
.cdn3-rdio.com
.cdn4-rdio.com
.cdn5-rdio.com
@geekdada
geekdada / whitelist
Last active April 27, 2016 07:40
域名白名单(GoagentX 导入)
*.cn DirectConnection
.0x110.com DirectConnection
.10010.com DirectConnection
.10050.net DirectConnection
.115.com DirectConnection
.115img.com DirectConnection
.123cha.com DirectConnection
.126.com DirectConnection
.126.net DirectConnection
.163.com DirectConnection
@geekdada
geekdada / main.conf
Last active August 19, 2022 10:16
Surge 配置文件
[General]
loglevel = notify
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.84.0.0/16, localhost, *.local, *.jd.com, *.direct
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.1
### Keybase proof
I hereby claim:
* I am geekdada on github.
* I am geekdada (https://keybase.io/geekdada) on keybase.
* I have a public key whose fingerprint is 7395 FE13 1689 A44A 170A 5867 1880 F8C1 41E4 8CE1
To claim this, I am signing this object:
@geekdada
geekdada / get-keys-for-github-user.sh
Created February 13, 2017 15:50 — forked from rtlong/get-keys-for-github-user.sh
Put public keys for a github user in ~/.ssh/authorized keys with mucho ease
IFS="$(printf '\n\t')"
mkdir -p ~/.ssh
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
user=$1
@geekdada
geekdada / delete_branches_older_than.sh
Last active December 3, 2018 05:45 — forked from redthor/delete_branches_older_than.sh
Script to delete branches older than a certain date, modification of 4586456
# Copy of https://gist.github.com/antonio/4586456
# With a modification to collect all the branch names so we can make one git request
# Set DRY_RUN=1 to get an echo of the command
# Format that works with `git log --since`, e.g. 2018-01-01
date=$1
branches=
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/remotes\///' | grep feature | grep -v 'master$'); do
if [[ "$(git log $branch --since $date | wc -l)" -eq 0 ]]; then
@geekdada
geekdada / hulu_ads_script.js
Created July 18, 2019 06:50
Redirect Hulu ads
let headers = $response.headers;
headers['Location'] = 'https://dada-oss.dacdn.top/teehee-network-files/block.mp4';
$done({
status: 301,
headers,
});
@geekdada
geekdada / handler.js
Created November 4, 2019 02:21
Deploy Surgio gateway to Azure Function
const createHandler = require("azure-function-express").createHandler;
const gateway = require("surgio/build/gateway");
// Binds the express app to an Azure Function handler
module.exports = createHandler(gateway.createHttpServer());