启动新会话:
tmux [new -s 会话名 -n 窗口名]
恢复会话:
tmux at [-t 会话名]
| -- a quick LUA access script for nginx to check IP addresses against an | |
| -- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
| -- | |
| -- allows for a common blacklist to be shared between a bunch of nginx | |
| -- web servers using a remote redis instance. lookups are cached for a | |
| -- configurable period of time. | |
| -- | |
| -- block an ip: | |
| -- redis-cli SADD ip_blacklist 10.1.1.1 | |
| -- remove an ip: |
| location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { | |
| etag off; #关闭etag | |
| expires 1d; #有效期一天 | |
| # expires的单位可以使用 | |
| # ms: 毫秒 | |
| # s: 秒 | |
| # m: 分钟 | |
| # h: 小时 | |
| # d: 天 | |
| # w: 星期 |
| -- Tit Petric, Monotek d.o.o., Tue 03 Jan 2017 06:54:56 PM CET | |
| -- | |
| -- Delete nginx cached assets with a PURGE request against an endpoint | |
| -- supports extended regular expression PURGE requests (/upload/.*) | |
| -- combine single,all,match three mode | |
| -- updated by nosun [email protected] | |
| local md5 = require 'md5' | |
| function file_exists(name) |
| #!/usr/bin/env python | |
| """ | |
| Rudimentary Spotify Web Proxy using mitmproxy. | |
| Use it by your own responsibility!! | |
| This was only entertainment!! | |
| """ | |
| import random | |
| import hashlib |
The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.
| upstream api_example_net { | |
| server api.example.net:4000; | |
| keepalive 600; | |
| } | |
| proxy_cache_path /var/cache/nginx/tag levels=1:2 keys_zone=tag:10m inactive=1d max_size=10g; | |
| server { | |
| listen 80; | |
| server_name api.example.net; |
| USERNAME [a-zA-Z0-9._-]+ | |
| USER %{USERNAME} | |
| EMAILLOCALPART [a-zA-Z][a-zA-Z0-9_.+-=:]+ | |
| EMAILADDRESS %{EMAILLOCALPART}@%{HOSTNAME} | |
| INT (?:[+-]?(?:[0-9]+)) | |
| BASE10NUM (?<![0-9.+-])(?>[+-]?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))) | |
| NUMBER (?:%{BASE10NUM}) | |
| BASE16NUM (?<![0-9A-Fa-f])(?:[+-]?(?:0x)?(?:[0-9A-Fa-f]+)) | |
| BASE16FLOAT \b(?<![0-9A-Fa-f.])(?:[+-]?(?:0x)?(?:(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?)|(?:\.[0-9A-Fa-f]+)))\b |
| /* Exercise: Loops and Functions #43 */ | |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| func Sqrt(x float64) float64 { | |
| z := float64(2.) |