Skip to content

Instantly share code, notes, and snippets.

View zzl0's full-sized avatar

zzl zzl0

View GitHub Profile
@zzl0
zzl0 / coders.txt
Last active August 8, 2018 20:45
Name Description
Peter Norvig Director of Research at Google and author of the standard text on AI.
Alan Kay Inventor of Smalltalk. Coined the term "object-oriented programming".
Guy Steele Co-inventor of Scheme and part of the Common Lisp Gang of Five. Currently working on Fortress.
Donald Knuth Author of The Art of Computer Programming and TeX
Gerald Jay Sussman Co-creator of Scheme and co-author of The Structure And Interpretation of Computer Programs.
John McCarthy Invented Lisp
John Carmack Founder of id Software; lead programmer of Doom, Quake, and others.
Dennis Ritchie Invented C and contributed to development of UNIX
Joe Armstrong Inventor of Erlang
@zzl0
zzl0 / sshgo
Last active August 29, 2015 14:11
#!/usr/bin/env bash
#--------------------- start ----------------------
# Copy the flowwing to your .zshrc file.
# # COMPLETION SETTINGS
# # add custom completion scripts
# fpath=(~/.zsh/completion $fpath)
# # compsys initialization
# autoload -U compinit
@zzl0
zzl0 / cpu.py
Created November 21, 2014 06:19
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7775 zhuzhaol 20 0 642m 457m 3800 S 35 0.9 1490:09 twistd
4731 zhuzhaol 20 0 143m 125m 912 S 1 0.3 168:11.27 tmux
4030 zhuzhaol 20 0 620m 15m 3820 S 0 0.0 3:32.29 executor.py
22685 zhuzhaol 20 0 11180 1340 896 R 0 0.0 0:00.14 top
4732 zhuzhaol 20 0 15676 2188 1636 S 0 0.0 0:00.09 bash
1414661115
|
v
+---+---+---+---+---+---+
host=server0,cpu=0->| 8 | | | | | |
+---+---+---+---+---+---+
| | | | | | |
+---+---+---+---+---+---+
| | | | | | |
[('stats.counters.web.*.qps.rate', 16334),
('stats.counters.web.*.bandwidth.rate', 16328),
('stats.counters.web.*.code.504.rate', 3640),
('stats.counters.web.*.code.500.rate', 3630),
('stats.counters.web.*.code.502.rate', 3625),
('stats.counters.web.*.code.503.rate', 3608),
('stats.counters.fusible.*.*.*.fail.rate', 3345)
...
]
# server.mem.used -> server/mem/used.wsp
xFilesFactor = 0.6
aggregationMethod = average
retentions = 1s:4s,2s:10s
+------------------------+
| |
# ==> conf/storage-aggregation.conf <==
[default-aggregation]
pattern = .*
xFilesFactor = 0.6
aggregationMethod = average
# ==> conf/storage-schemas.conf <==
pattern = ^pidl\..*
retentions = 1s:1h,60s:2d,300s:7d,15m:25w,12h:5y
# coding: utf-8
def get_table_id(tbl_file):
"""
Get table id from .ctb file.
"""
with open(tbl_file, 'rb') as f:
f.seek(-4, 2) # seek to last 4 byte
bytes = f.read(4)
from flask import Flask
from flask import request
app = Flask(__name__)
#Normally this would be an external file like object, but here
#it's inlined
FORM_PAGE = """
<html>
<head>
<title>Flask Form</title>