Skip to content

Instantly share code, notes, and snippets.

View micromaomao's full-sized avatar
👋

maowtm micromaomao

👋
View GitHub Profile
@micromaomao
micromaomao / pdnsd.conf
Last active August 29, 2015 14:16
pdnsd as a proxy (tcp) (use root dns) (break GFW)
global {
perm_cache=4096;
run_ipv4=off;
cache_dir=/var/cache/pdnsd;
server_ip = ::1;
server_port = 53;
query_method=tcp_only;
min_ttl=10m;
max_ttl=1w;
timeout=10;

GitHub don't support this stuff..

$$ a^2+2ab+b^2=(a+b)^2 $$

@micromaomao
micromaomao / findHash.py
Created May 2, 2015 09:56
FindZeroHash - My python beginning program, my first python program!
#!/usr/bin/python
import sha;
import sys;
import time;
def checkifzero(str, count):
sa = sha.new(str).digest();
return sa.startswith('\x00' * count);
if len(sys.argv) != 5:
@micromaomao
micromaomao / Baidu Online Input methods looks better.js
Last active August 29, 2015 14:20
Baidu Online Input methods looks better
// ==UserScript==
// @name BaiduShurufa better look
// @match http://shurufa.baidu.com/online.html
// @grant none
// ==/UserScript==
(function(){
var tld = function(){
$('.header, .onl_cques, .online_c_split, .maincont, .up_cont-bottom, #footer, #feedback, .btn').remove();
$('#experience').css({margin: "0"});
@micromaomao
micromaomao / loadJQuery.js
Last active August 29, 2015 14:22
loadJQueryStar
(function(){
if(!window.brainfucktapeAlertStyleLoaded){
var dcd = document.createElement('style');
dcd.innerHTML = ".dh-alert{z-index:999;box-shadow:0 0 32px rgba(0,0,0,.6),0 0 260px"+
" #000;font-size:110%;position:fixed;left:40px;right:40px;top:40%;height:auto;padding:"+
"16px;background-color:#fff;text-align:center}.dh-alert-close{font-size:80%;color:#bbb;"+
"font-weight:700;cursor:pointer;margin:2px}.dh-alert-close:hover{color:#888}"+
".dh-alert-bg{background-color:rgba(0,0,0,.1);position:fixed;top:0;right:0;bottom:0;left:0;z-index:998}";
document.body.appendChild(dcd);
window.brainfucktapeAlertStyleLoaded = true;
// ==UserScript==
// @name ICIBA better
// @match http://www.iciba.com/*
// @grant none
// ==/UserScript==
$(document).ready(function(){
$('.iciba_common_top, .header, .pendant, #ezfm, #side_bar').remove();
$('.dict_nav').children().not('ul').remove();
@micromaomao
micromaomao / rename.py
Created July 6, 2015 02:20
Rename file, remove web address prefix
#!/usr/bin/python
import os;
import fnmatch;
for file in os.listdir('.'):
if fnmatch.fnmatch(file, "WWW.DOWNVIDS.NET-*.mp3"):
os.rename(file, file[17:])
@micromaomao
micromaomao / Makefile
Created July 8, 2015 10:31
This is my first GUI program in linux!
everything:
rm -f a.out
g++ main.cc `pkg-config --cflags --libs gtk+-3.0`
./a.out
@micromaomao
micromaomao / client.cc
Created July 15, 2015 11:00
Linux socket test
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#define BUFLEN 10
int main( int argc, char **argv )
@micromaomao
micromaomao / draw.js
Last active August 29, 2015 14:25
Draw a picture on your github user page
var dates = "";
$('.day').click(function(){dates += $(this).data('date') + "\n"; console.info($(this).data('date'));$(this).attr("fill", "#00ff00")})