Skip to content

Instantly share code, notes, and snippets.

@GreenFaith
GreenFaith / ulimit
Created August 27, 2014 23:46
系统限制定义
说明:
ulimit -u 10000 #设置各linux 用户的最大进程数
ulimit -n 204800 #每个进程可以打开的文件数目加大到4096,缺省为1024
ulimit -d unlimited #数据段长度
ulimit -m unlimited #最大内存大小
ulimit -s unlimited #堆栈大小
ulimit -t unlimited #CPU 时间
ulimit -v unlimited #虚拟内存
ulimit -c unlimited #core文件的大小
@GreenFaith
GreenFaith / app.py
Created August 22, 2014 01:18
wsgi app
def simple_app(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)
return ['Hello world!\n']
class AppClass:
"""Produce the same output, but using a class
@GreenFaith
GreenFaith / calc.scm
Created August 12, 2014 13:00
calculator
#lang racket
(define (calc exp)
(match exp
[(? number? x) x]
[(list op e1 e2)
(let ([v1 (calc e1)]
[v2 (calc e2)])
(match op
['+ (+ v1 v2)]
@GreenFaith
GreenFaith / setxkbmap.md
Last active August 29, 2015 14:05
arch setxkbmap
import sys, traceback
def run_user_code(envdir):
source = raw_input(">>> ")
try:
exec source in envdir
except:
print "Exception in user code:"
print '-'*60
traceback.print_exc(file=sys.stdout)
def run_with_cgi(application):
environ = dict(os.environ.items())
environ['wsgi.input'] = sys.stdin
environ['wsgi.errors'] = sys.stderr
environ['wsgi.version'] = (1, 0)
environ['wsgi.multithread'] = False
environ['wsgi.multiprocess'] = True
environ['wsgi.run_once'] = True
List of Chrome URLs
chrome://accessibility
chrome://appcache-internals
chrome://apps
chrome://blob-internals
chrome://bookmarks
chrome://cache
chrome://chrome
chrome://chrome-urls