Skip to content

Instantly share code, notes, and snippets.

@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 表示这次是因为别的包依赖而安装的,在将来没有其他包依赖他时会自动删除
- 删除
_ 彻底删除
= 固定版本
@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 / 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 / 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 / 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 / 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 / .conf
Last active August 29, 2015 14:06
openvpn 和 anyconnect 所用路由
## openvpn 路由 ##
server 10.168.2.0 255.255.255.0 #客户端使用的IP段,不要与你本机的网段冲突#
;push "redirect-gateway"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "route 172.68.2.0 255.255.255.0 vpn_gateway"
push "route 3.0.0.0 255.0.0.0 vpn_gateway"
push "route 4.0.0.0 255.0.0.0 vpn_gateway"
push "route 8.0.0.0 255.0.0.0 vpn_gateway"
@shellexy
shellexy / glade2py.py
Created June 27, 2014 10:06
从 glade-2 界面文件生成 pygtk 代码,并使用 pygtkcompat 来支持 gtk3
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#@license: LGPL-3
"""由 glade 文件生成 python 源码
使用 i18n gettext 国际化
i18n.py 示例:
--
@shellexy
shellexy / gtkswitchbutton.py
Last active August 29, 2015 14:03
GtkSwitch for PyGtk2
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
'''GtkSwitch for PyGtk2
@author: Shellexy <[email protected]>
@license: LGPLv3+
@see:
'''
import gtk, gobject
:not([class*=icon]) {
font-family: "Droid Sans Fallback", "WenQuanYi Micro Hei", "Microsoft Yahei Mono", "Microsoft Yahei", sans-serif, "Simsun" !important;
}