Skip to content

Instantly share code, notes, and snippets.

View iwinux's full-sized avatar
👽

Limbo Peng iwinux

👽
View GitHub Profile
@iwinux
iwinux / gist:ef756e22e288595eed6d
Last active August 29, 2015 14:12
mtr --report douban.com
$ mtr -u --report douban.com
HOST: zerus Loss% Snt Last Avg Best Wrst StDev
1.|-- 115.182.xx.x 0.0% 10 0.3 0.3 0.3 0.3 0.0
2.|-- 60.195.255.109 0.0% 10 0.6 0.6 0.6 0.8 0.1
3.|-- 219.239.92.10 30.0% 10 49.4 37.8 2.2 63.4 22.2
4.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
5.|-- 10.244.1.25 90.0% 10 16.7 16.7 16.7 16.7 0.0
6.|-- ms-a-02-vlan10.dxt-idc.ne 70.0% 10 11.1 6.9 1.9 11.1 4.7
7.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
@iwinux
iwinux / sumup.py
Created August 23, 2014 05:29
中国联不通每月通话时间统计
#!/usr/bin/env python
# coding: utf-8
'''
中国联不通每月通话时间统计
用法:
1. 去 http://iservice.10010.com/ 下载通话详单(Excel 格式),导出为 CSV
2. ./sumup.py *.csv
'''
@iwinux
iwinux / jdk-deb-build.sh
Created June 15, 2014 10:55
build Oracle JDK deb package with fpm
#!/bin/bash
PACKAGE=oracle-jdk-7
PACKAGE_VIRTUAL=oracle-jdk
VERSION_MAJOR=7
VERSION_MINOR=60
VERSION="${VERSION_MAJOR}u${VERSION_MINOR}"
BUILD=b19
PKG_BASENAME="jdk-$VERSION-linux-x64.tar.gz"
@iwinux
iwinux / pep8.rst
Last active December 20, 2015 13:09
just for rst preview - -
@iwinux
iwinux / argparse.cpp
Created June 15, 2013 10:25
A naive implementation of command argument parser in C++
#include <iostream>
#include <map>
#include <stdexcept>
#include <sstream>
#include <string>
#include <vector>
using std::cout;
using std::endl;
using std::istringstream;
@iwinux
iwinux / xdg-open.py
Created June 3, 2013 16:26
sudo ln -s $PWD/xdg-open.py /usr/bin/xdg-open
#!/usr/bin/env python
from os.path import isdir, splitext
from urlparse import urlparse
from urllib import unquote
import sys
import os
@iwinux
iwinux / gist:5578188
Last active October 11, 2023 19:49
Go's html/template with better subdirectory support.
package templates
import(
"html/template"
"io"
"os"
"strings"
"path/filepath"
)
openssl s_client -connect github.com:443 -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sed -ne '1,/-END CERTIFICATE-/p' > /tmp/github.com.pem
openssl x509 -in /tmp/github.com.pem -sha1 -noout -fingerprint
;; Usage: racket quick-find.rkt < pairs.txt
#lang racket/base
(require racket/list)
(require racket/string)
(require profile)
(provide make-qf-set qf-connected? qf-find qf-count qf-items qf-connect!)
(module+ main (profile-thunk main))