Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
居家办公

FbiGun Deo fbigun

🏠
居家办公
  • 虫子俱乐部
  • 中国
View GitHub Profile
@c9n
c9n / bash_profile.sh
Created Jan 14, 2015
ssh 自动补全别名
View bash_profile.sh
_complete_hosts () {
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
host_list=`{
for c in ~/.ssh/config
do [ -r $c ] && sed -n -e 's/^[[:space:]]*Host[[:space:]]//p' $c
done
} | tr ' ' '\n'|grep -v '*'`
COMPREPLY=( $(compgen -W "${host_list}" -- $cur))
return 0
@lanceliao
lanceliao / dnsmasq-gfwlist.py
Last active Jun 11, 2020
将gfwlist转换成带ipset的dnsmasq规则,适用于OpenWrt智能上网
View dnsmasq-gfwlist.py
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@wangjiezhe
wangjiezhe / advcp_install.sh
Last active Sep 3, 2018
install 'cp' and 'mv' utilities with progress bar patches
View advcp_install.sh
#!/usr/bin/env bash
set -e
tmpdir=$(mktemp -t -d advcp.XXXXXX)
cd ${tmpdir}
wget https://aur.archlinux.org/packages/ad/advcp/advcp.tar.gz
tar xf advcp.tar.gz
source advcp/PKGBUILD
@Forst
Forst / build.sh
Last active Jun 11, 2020
Ubuntu ISO with preseed.cfg generation script
View build.sh
#!/bin/bash
## FORSTWOOF UBUNTU PRESEED :: BUILD SCRIPT
# Quit on first error
set -e
# Temporary directory for the build
TMP="/var/tmp/ubuntu-build"
@fqrouter
fqrouter / readme.txt
Last active Mar 7, 2020
shadowsocks 公共代理的必要设置
View readme.txt
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
View gitcheats.txt
# shortform git commands
alias g='git'
# count lines of .js code in a repo
git ls-files | grep \\.js$ | xargs wc -l
# pretty tab'd git log
git log --graph --pretty="tformat:%h*(%ar)*<%an>*%d %s" $* | sed -Ee 's/(^[^<]*) ago\)/\1)/' | sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?\)/\1)/' | column -s '*' -t | cat
# change author of all git repos
View 关于 PAC 的书签夹.md
@xwmx
xwmx / kindlestrip.py
Created Aug 18, 2011
kindlestrip.py: for removing unnecessary portions of .mobi/.prc kindle files created with kindlegen
View kindlestrip.py
#!/usr/bin/python
#
# This is a python script. You need a Python interpreter to run it.
# For example, ActiveState Python, which exists for windows.
#
# This script strips the penultimate record from a Mobipocket file.
# This is useful because the current KindleGen add a compressed copy
# of the source files used in this record, making the ebook produced
# about twice as big as it needs to be.
#
View 0_urllib2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@chuangbo
chuangbo / README.md
Last active Jun 3, 2020
Python dynamic DNSPod DNS Script
View README.md

替换上你的 API Token,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获取 API Token 的方式

获得 domain_id 可以用 curl

curl -k https://dnsapi.cn/Domain.List -d "login_token=TOKEN"`
You can’t perform that action at this time.