Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gitrepo on github.
  • I am suifeng (https://keybase.io/suifeng) on keybase.
  • I have a public key whose fingerprint is B3A0 1400 5B14 DCCB 5FD6 CF14 265C 5810 93FE AD91

To claim this, I am signing this object:

@gitrepo
gitrepo / vpnc-script
Created May 28, 2013 18:01
vpnc-script no default route
#!/bin/sh
# List of parameters passed through environment
#* reason -- why this script was called, one of: pre-init connect disconnect reconnect
#* VPNGATEWAY -- vpn gateway address (always present)
#* TUNDEV -- tunnel device (always present)
#* INTERNAL_IP4_ADDRESS -- address (always present)
#* INTERNAL_IP4_MTU -- mtu (often unset)
#* INTERNAL_IP4_NETMASK -- netmask (often unset)
#* INTERNAL_IP4_NETMASKLEN -- netmask length (often unset)
#* INTERNAL_IP4_NETADDR -- address of network (only present if netmask is set)
199.59.148.0/22
199.16.156.0/22
@gitrepo
gitrepo / undo_fuckgfw.sh
Last active December 17, 2015 19:59
vpnc post-disconnect.d script for del censored ip from vpn route table.
#!/bin/sh
#del default gateway from vpn route table.
ip route del default dev tun0 table vpn
#del censored ip from vpn route table.
for line in `cat /etc/vpnc/fuckgfw.txt`
do
if [[ ${line:0:1} != "#" ]] ;then
ip rule del to $line table vpn
else
@gitrepo
gitrepo / fuckgfw.sh
Last active December 17, 2015 19:59
vpnc post-connect.d scripts for set censored ip to vpn route table.
#!/bin/sh
#set default gateway for vpn route table.
ip route add default dev tun0 table vpn
#add censored ip to vpn route table.
for line in `cat /etc/vpnc/fuckgfw.txt`
do
if [[ ${line:0:1} != "#" ]] ;then
ip rule add to $line table vpn
else
@gitrepo
gitrepo / vmware
Last active December 17, 2015 12:19
vmware虚拟机优化 vmk文件
sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
MemTrimRate = "0"
snapshot.disabled = "TRUE"
MemAllowAutoScaleDown = "FALSE"
unity.allowCompositingInGuest="TRUE"
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"