Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
import json
import os
import sys
import re
import fnmatch
import concurrent.futures
# https://stackoverflow.com/a/5141829/554150
def find_logs(target_path):
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package testsnmp4j;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Vector;
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import urllib2
from HTMLParser import HTMLParser
def write(value=''):
sys.stdout.write(str(value))
class MyHTMLParser(HTMLParser):
#!/usr/bin/python
from pprint import pprint as p;import subprocess as s;
def loop_list_print(cmds):
oo = [ s.Popen(['/bin/sh','-c', cmd], stdout=s.PIPE).communicate()[0] for cmd in cmds]
ooo = [ ( o, o.decode('unicode_escape',errors='replace'), o.decode('big5') ) for o in oo ]
for oo in ooo:
for o in oo:
print(o.strip())
@dieterplex
dieterplex / playdeb.sh
Created October 8, 2012 02:34 — forked from stefanbirkner/playdeb.sh
Playdeb builds a debian package of the play framework.
#!/bin/bash
# playdeb builds a debian package of the play framework. playdeb downloads
# the playframework by itself. You run it by
# playdeb.sh <version> <maintainer>
# Example:
# playdeb.sh 1.2.3 "Denny Colt <d.colt@eisner.qcg>"
#
# The script has been tested with version 1.2.3.
if [ -z $1 ]
@dieterplex
dieterplex / request_time.py
Created April 26, 2012 07:19 — forked from andrewwatts/request_time.py
urllib2 vs urllib3 vs requests
#!/usr/bin/env python2.7
import urllib2
import time
_ITERATIONS = 200
start_time = time.time()
for i in range(0, _ITERATIONS):
@dieterplex
dieterplex / gcin.spec
Created December 26, 2011 22:46
gcin-2.6.8 rpm spec for fedora
%define release liu_mdk
%define prefix /usr
%define name gcin
%define version 2.6.8
Summary: gcin : Chinese input method server
Name: %{name}
Version: %{version}
Release: %{release}