Skip to content

Instantly share code, notes, and snippets.

View selfboot's full-sized avatar

selfboot selfboot

View GitHub Profile
# 你可以从该 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, 那么这些值会被写入到系统网络代理
# 设置中.)
@selfboot
selfboot / surge.conf
Created August 27, 2016 01:24
比较不错的配置文件
# 规则配置仅供参考,适用于 Surge iOS & Mac;
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计
# 屏蔽部分运营商劫持网页弹出流量统计
# 部分特性可能仅适用于最新的 TestFlight 版本
# 参数说明 zhHans.conf.ini http://bit.ly/29kwXlZ
# https://gist.githubusercontent.com/scomper/915b04a974f9e11952babfd0bbb241a8/raw/surge.conf
[General]
# warning, notify, info, verbose
loglevel = notify
@selfboot
selfboot / combine.sh
Created October 25, 2016 02:14
软件著作权代码格式处理(需要在项目的根目录运行)
#! /usr/bin/env sh
# Find all the src file in your project
py_files=`find . -name '*.py'`
html_files=`find . -name '*.html'`
css_files=`find . -name '*.css'`
for i in $py_files
do
filename=$(basename "$i")
@selfboot
selfboot / ximalaya.js
Created February 27, 2017 05:44
喜马拉雅专辑中的音频下载脚本:浏览器控制台运行下面代码,即可得到当前页面中的音频下载链接。然后在命令行下载即可
$(".album_soundlist ul li").each(function(i){
var sound_id = $(this).attr("sound_id");
var json_url = "http://www.ximalaya.com/tracks/" + sound_id + ".json";
$.get(json_url,function(json){
var save_name = json.nickname + "-" + json.title + ".m4a";
var down_cmd = "wget " + json.play_path_64 + " -O " + save_name
console.log(down_cmd);
})
})
@selfboot
selfboot / gitconfig
Last active March 9, 2017 03:52
git 配置文件
[user]
name = xuelangZF
email = xuezaigds@gmail.com
[core]
excludesfile = /Users/feizhao/.gitignore_global
editor = vim
quotepath = false
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
@selfboot
selfboot / getlinks.sh
Created March 17, 2017 02:31
获取优酷视频列表中所有视频播放链接
@selfboot
selfboot / sendMail.py
Created March 21, 2017 11:34
Python 简单发送邮件
#! /usr/local/bin/python
SMTPserver = 'smtp.sina.com'
sender = '<milanlanlanlan@sina.com>'
destination = ['1291023320@qq.com']
USERNAME = "milanlanlanlan@sina.com"
PASSWORD = "*******"
# typical values for text_subtype are plain, html, xml
@selfboot
selfboot / tmux.conf
Last active March 29, 2017 07:22 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@selfboot
selfboot / commands.md
Last active May 29, 2017 03:14
Linux commands often used.

Kernel Version

If you want kernel version information, use uname(1). For example:

$ uname -a
Linux cheapss 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Distribution Version

@selfboot
selfboot / tcpdump.md
Last active May 29, 2017 09:09
Quick doc about how to use tcpdump.

Tcpdump is a network packet analyzer that runs under the command line. It is used to create "dumps" or "traces" of network traffic. It allows you to look at what is happening on the network and really can be useful for troubleshooting many types of issues including issues that aren't due to network communications. Outside of network issues I use tcpdump to troubleshoot application issues all the time; if you ever have two applications that don't seem to be working well together, tcpdump is a great way to see what is happening. This is especially true if the traffic is not encrypted as tcpdump can be used to capture and read packet data as well.

Install

Since tcpdump is not included with most base systems, you will need to install it. However, nearly all Linux distributions have tcpdump in their core repositories. For Debian based distributions, the command to install tcpdump is:

apt-get install tcpdump