This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Setting up DNS according to OpenVPN dhcp-option | |
# used with openvpn --up | |
mv /etc/resolv.conf /etc/resolv.conf.old | |
for (( i=1; 1; i++)) | |
do | |
optname="foreign_option_$i" | |
option=${!optname} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Restore original DNS settings | |
# used with openvpn --down | |
if [ -f /etc/resolv.conf.old ] | |
then | |
rm /etc/resolv.conf | |
mv /etc/resolv.conf.old /etc/resolv.conf | |
echo "resolv.conf restored" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#sunpinyin_speedup.sh | |
# Sunpinyin Speedup Script (by memory caching using shm, and no data loss) | |
# You can run this script in background on GNOME logging in. | |
# Hexcles Ma(http://robotshell.org/), Published in Public Domain | |
# Capture the exit signal, make sure it is the FIRST uncommented line. | |
trap "do_exit" SIGHUP SIGINT SIGQUIT SIGTERM | |
# Backup checking interval(seconds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PPP_TIMEOUT=15 | |
L2TPD_TIMEOUT=5 | |
L2TPD_CONTROL_FILE=/var/run/xl2tpd/l2tp-control | |
VPN_ACCOUNT=zjuvpn-a | |
function start_xl2tpd | |
{ | |
systemctl start xl2tpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Replace ugly Chinese bitmap fonts with system default sans-serif. | |
* ATTENTION: this will intentionally change the appearance of web pages! | |
* Most Chinese websites do not mean to use serif fonts, especially for these ugly ones. | |
*/ | |
@font-face { | |
font-family: "宋体"; | |
src: local("sans-serif"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PPP_TIMEOUT=30 | |
L2TPD_TIMEOUT=5 | |
L2TPD_CONTROL_FILE=/var/run/xl2tpd/l2tp-control | |
VPN_ACCOUNT=zjuvpn | |
function start_xl2tpd | |
{ | |
systemctl start xl2tpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// public url_base64_encode(bin) {{{ | |
/** | |
* url_base64_encode 生成URL安全的Base64编码 | |
* | |
* @param string $bin | |
* @access public | |
* @return string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Abort when curl fails | |
set -e | |
USERNAME= | |
PASSWORD= | |
echo -n "Force logging off: " | |
curl 'https://net.zju.edu.cn/rad_online.php' -H 'Origin: https://net.zju.edu.cn' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: */*' -H 'Referer: https://net.zju.edu.cn/srun_port1.php?url=http://www.example.com/' --data "action=auto_dm&username=${USERNAME}&password=${PASSWORD}" >/dev/null 2>&1 | |
echo "success!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from sys import argv | |
from os import path, system | |
from urllib.parse import unquote | |
if len(argv) == 1: | |
print("Usage: urldecode.py FILES...") | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .ycm_extra_conf.py for kernel | |
import os | |
# Attention: | |
# File path not starting with / or = will be expanded. | |
flags_c = [ | |
'-Wall', | |
'-Wundef', | |
'-Wstrict-prototypes', |
OlderNewer