- author
Weisi Dai (weisi@cmu.edu)
- date
Apr 28, 2014
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 python | |
# Weisi Dai <weisi@x-research.com> | |
t = 0 | |
swaps = 0 | |
def check(a, i): | |
global swaps | |
t = i |
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
# 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 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 <weisi@cmu.edu> | |
# | |
# Usage: bash dns_ttl.sh 8.8.8.8 | |
# | |
# Dependencies: mtr dig iptables bc | |
DOMAIN=twitter.com | |
DNS=$1 |
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 | |
# Weisi Dai <multiple1902@gmail.com> | |
# 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 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 <multiple1902@gmail.com> | |
# | |
# 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 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 <multiple1902@gmail.com> | |
% 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 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 <jdthood@yahoo.co.uk> | |
# and Chris Hanson | |
# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. |