Skip to content

Instantly share code, notes, and snippets.

@zenozeng
zenozeng / dns_logger.rb
Created November 17, 2013 14:49
DNS Logger
# encoding: utf-8
require 'rubygems'
require 'rubydns'
require 'yaml'
require 'socket'
require 'awesome_print'
require 'logger'
if RExec.current_user != "root"
$stderr.puts "Sorry, this command needs to be run as root!"
@zenozeng
zenozeng / zjuvpn.sh
Created November 17, 2013 14:53
zjuvpn (modified for openwrt)
#!/bin/sh
# 脚本出处
# http://www.cc98.org/dispbbs.asp?boardID=212&ID=4011172
## LAC name in config file
L2TPD_LAC=zjuvpn
L2TPD_CONTROL_FILE=/var/run/xl2tpd/l2tp-control
L2TPD_INIT_FILE=/etc/init.d/xl2tpd
@zenozeng
zenozeng / .gitconfig
Last active December 29, 2015 21:19
.gitconfig
[user]
name = Zeno Zeng
email = zenoes@qq.com
[color]
#开启着色功能
status = auto
diff = auto
branch = auto
interactive = auto
@zenozeng
zenozeng / hosts.d.sh
Created December 14, 2013 02:51
hosts.d.sh
cat /etc/hosts.d/* > /etc/hosts
@zenozeng
zenozeng / 评教.js
Last active January 1, 2016 17:39
自动评教脚本(部分)
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript= document.createElement("script");
oScript.type = "text/javascript";
oScript.src="https://code.jquery.com/jquery-2.1.4.min.js";
oScript.onload = function() {
jQuery('input[value="5"], input[value="优秀"]').each(function() {
console.log(jQuery(this));
jQuery(this).click();
});
$('#Button1').click();
@zenozeng
zenozeng / gtk-update-icon-cache.sh
Created January 17, 2014 16:39
gtk-update-icon-cache
#!/bin/bash
locates=`locate index.theme`
dirs=(${locates//\\n/ })
for i in ${dirs[@]}
do
echo $i
gtk-update-icon-cache `dirname $i`
gtk-update-icon-cache-3.0 `dirname $i`
done
@zenozeng
zenozeng / .profile_fcitx
Last active January 3, 2016 18:29
fcitx & lc_ctype in .profile
# Using FCITX to Input
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
# Start Emacs Daemon
LC_CTYPE=zh_CN.utf8 emacs --daemon
# Don't forget to install kimpanel for gnome shell
@zenozeng
zenozeng / local.conf
Created January 19, 2014 10:50
马大神的fontconfig
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file for local customizations -->
<fontconfig>
<!-- overall settings: autohint(slight), hinting, antialias, sub-pixel(rgb) -->
<match target="font">
<edit mode="assign" name="embeddedbitmap">
<bool>true</bool>
</edit>
<edit mode="assign" name="autohint">
@zenozeng
zenozeng / curl_zjuwlan.sh
Created January 20, 2014 06:24
curl script to login to zjuwlan
curl -d "action=login&username=USERNAME_HERE&password=PASSWORD_HERE&ac_id=3&type=1&wbaredirect=http://www.baidu.com/&mac=undefined&user_ip=&is_ldap=1&local_auth=1" "http://10.50.200.245/cgi-bin/srun_portal"
@zenozeng
zenozeng / 10.76.8.61
Last active January 3, 2016 21:09
IP Route for songsong and auto setup script
ip route add 10.76.8.61 via 192.168.1.1 dev br-wan