Skip to content

Instantly share code, notes, and snippets.

View se77en's full-sized avatar

Damon Zhao se77en

View GitHub Profile
@se77en
se77en / tmux-cheatsheet.markdown
Created November 19, 2015 07:34 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@se77en
se77en / instructions.md
Created December 3, 2015 06:51 — forked from darach/instructions.md
Pony on the Raspberry Pi v2

Instructions

The following instructions assume a debian jessie based distribution

0. Prerequisites

Install dependent tools and libraries

$ sudo apt-get update

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
[General]
# warning, notify, info, verbose
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local
bypass-tun = 0.0.0.0/8, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
# 默认 IP 和端口,不修改的话系统网络 HTTP 和 HTTPS 代理设置中就是 127.0.0.1:6152
interface = 0.0.0.0
port = 6152
@se77en
se77en / gprof2dot.py
Created May 18, 2016 10:21 — forked from WuXianglong/gprof2dot.py
Generate a dot graph from the output of several profilers.
#!/usr/bin/env python
#
# Copyright 2008-2014 Jose Fonseca
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@se77en
se77en / preprocessor_fun.h
Created June 30, 2016 09:31 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
[General]
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@se77en
se77en / user-rule.txt
Created December 29, 2016 06:31
Shadowsocks 用户自定义翻墙规则
@@||shimo.im
||livecoding.tv
||caniuse.com
@@||chinesemooc.org
@@||ninghao.net
@@||almuten.net
@@||daocloud.io
@@||xitu.io
@@||knewone.com
||geekuninstaller.com

DDNS_DNSPOD

###功能 基于DNSPOD (www.dnspod.com)的动态域名解析脚本:

适用于有域名在手,并且托管到dnspod的童鞋。

###原理 基于dnspod提供的api,提交信息。 如果IP地址没有改变,则不处理;如果改变了则提交新的IP地址。