Skip to content

Instantly share code, notes, and snippets.

@shellexy
shellexy / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shellexy
shellexy / ocserv.conf
Created January 22, 2015 13:39
anyconnect 所用路由
dns = 8.8.8.8
max-clients = 0
max-same-clients = 5
route = 172.68.2.0/255.255.255.0
route = 3.0.0.0/255.0.0.0
route = 4.0.0.0/255.0.0.0
route = 8.0.0.0/255.0.0.0
route = 17.0.0.0/255.0.0.0
route = 198.0.0.0/255.0.0.0
@shellexy
shellexy / server.conf
Created July 25, 2015 13:00
这个 /etc/openvpn/server.conf 配置带了墙外地址路由,不影响国内网站
local 192.168.1.101 #这里替换成你的vps的IP#
port 10037 #相应的端口
proto udp
dev tun
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
ifconfig-pool-persist ipp.txt
@shellexy
shellexy / Atd_grammar_checking.vim
Created March 5, 2016 15:30
atd 英语语法检查
" atd 英语语法检查 https://bitbucket.org/shellexy/my-bin-script/src/tip/atd_grammar_checking.py
function! Atd_grammar_checking()
browse confirm up
let makeprg_=&makeprg
set makeprg=atd_grammar_checking.py\ %
silent make
copen
let &makeprg=makeprg_
endfunction
map <F6> <ESC>:call Atd_grammar_checking()<CR>
@shellexy
shellexy / vimrc
Created July 21, 2016 06:09
可能有用的 vimrc 片段
" 用 Alt+左右方向键 来切换多文件
map <silent><A-Right> :bn<CR>
map <silent><A-Left> :bp<CR>
"要在命令行上实现 Emacs 风格的编辑操作: >
" 至行首
cnoremap <C-A> <Home>
" 后退一个字符
cnoremap <C-B> <Left>
" 删除光标所在的字符
@shellexy
shellexy / gist:ab964a34251482614843cbc5da9b176e
Created September 15, 2016 10:30
apt 一行命令里同时安装删除多个软件
#ubuntu #apt 一行命令里同时安装删除多个软件
$ sudo apt install xxx yyy ooo- zzz-
会安装 xxx、yyy 并删除 ooo、zzz
+ 表示安装
+M 表示这次是因为别的包依赖而安装的,在将来没有其他包依赖他时会自动删除
- 删除
_ 彻底删除
= 固定版本
修改 wifi 验证服务器地址
安卓 5.0~6.0 可以
adb shell settings put global captive_portal_server google.cn
安卓 7.0~7.1 同上并需要服务器支持 https
安卓 7.1.1 可以
adb shell settings put global captive_portal_https_url https://google.cn/generate_204
上述 google.cn 可以也换成 www.qualcomm.cn 高通中国的验证服务器
@shellexy
shellexy / winetricks-zh.diff
Last active May 21, 2017 15:21
让 winetricks-zh 使用思源黑体 Noto Sans CJK SC
diff --git a/winetricks-zh b/winetricks-zh
--- a/winetricks-zh
+++ b/winetricks-zh
@@ -9857,6 +9857,20 @@ w_metadata fakechinese fonts \
load_fakechinese()
{
+ fc-list | grep -q "Noto Sans CJK SC Thin" && {
+ w_register_font_replacement "Microsoft JhengHei" "Noto Sans CJK SC Thin"
+ w_register_font_replacement "Microsoft YaHei" "Noto Sans CJK SC Thin"
配置
安装::
sudo aptitude install openvpn udev lzop easy-rsa
生成 CA 证书::
sudo su
make-cadir /etc/openvpn/easy-rsa/2.0
@shellexy
shellexy / wol.py
Last active December 8, 2017 15:37
wake on lan 远程唤醒计算机
#!/usr/bin/python
# -*- coding: utf-8 -*-
# wol.py 远程唤醒计算机
# 参见 http://code.activestate.com/recipes/358449-wake-on-lan/
# https://github.com/bentasker/Wake-On-Lan-Python
# 原作者 Fadly Tabrani, B Tasker,协议 PSF
## 可以改为自己需要远程唤醒的计算机的 MAC 地址
MACADDRESS = '00:13:0d:e4:60:61'