Author: | Weisi Dai ([email protected]) |
---|---|
Date: | Apr 28, 2014 |
This file contains hidden or 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 python | |
# Weisi Dai <[email protected]> | |
t = 0 | |
swaps = 0 | |
def check(a, i): | |
global swaps | |
t = i |
This file contains hidden or 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
# tab-width: 4 | |
import sys | |
arr = ["Segment", "Fault"] | |
space = " " | |
nl = "\n" | |
for i in range(5): | |
for item in arr: | |
sys.stdout.write(item) |
This file contains hidden or 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 | |
# Weisi Dai <[email protected]> | |
# | |
# Usage: bash dns_ttl.sh 8.8.8.8 | |
# | |
# Dependencies: mtr dig iptables bc | |
DOMAIN=twitter.com | |
DNS=$1 |
This file contains hidden or 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 | |
# Weisi Dai <[email protected]> | |
# 09055029, Xi'an Jiaotong University | |
# Oct 11, 2012 | |
# Released under MIT License | |
# Reads a black-and-white Windows Bitmaap, parses it and converts it to CompuServe RLE format. | |
import struct | |
from types import * # assert |
This file contains hidden or 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 | |
# Written by multiple1902 <[email protected]> | |
# | |
# workaround for linux 3.3 SATA hotplug issue after suspend/resume | |
# | |
# gist page: | |
# https://gist.github.com/2420684 | |
# | |
# bug report: | |
# https://lkml.org/lkml/2012/2/19/70 |
This file contains hidden or 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
% multiple1902 <[email protected]> | |
% mcmthesis.cls | |
% This work is licensed under a Creative Commons Attribution 3.0 Unported License | |
% http://creativecommons.org/licenses/by/3.0/ | |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] | |
\ProvidesClass{mcmthesis} | |
[2012/2/6 0.9.9 Lightweight Template for Mathematical Contest in Modeling] | |
\LoadClass[11pt]{article} |
This file contains hidden or 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 | |
# | |
# Parses DHCP options from openvpn to update resolv.conf | |
# To use set as 'up' and 'down' script in your openvpn *.conf: | |
# up /etc/openvpn/update-resolv-conf | |
# down /etc/openvpn/update-resolv-conf | |
# | |
# Used snippets of resolvconf script by Thomas Hood <[email protected]> | |
# and Chris Hanson | |
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. |