start new:
tmux
start new with session name:
tmux new -s myname
想當年, | |
學長誆我在梯前, | |
糊塗進電研, | |
十七八青春宅窩獻, | |
枉費俺這俊俏臉, | |
辛酸直含淚。 | |
天無眼, | |
自忖力拚一兩年, | |
不眠也不睡, |
#!/bin/bash | |
if [ "$1" == "" ]; then | |
echo Usage: $0 pngfile | |
exit 0; | |
fi | |
FILE=`basename $1 .png` | |
if [ ! -e $FILE.png ]; then |
# SNAKES GAME | |
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting | |
import curses | |
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN | |
from random import randint | |
curses.initscr() | |
win = curses.newwin(20, 60, 0, 0) |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
WIDE_MAP = dict((i, i + 0xFEE0) for i in xrange(0x21, 0x7F)) | |
WIDE_MAP[0x20] = 0x3000 | |
def widen(s): | |
""" | |
Convert all ASCII characters to the full-width counterpart. |
#GNU Screen Cheat Sheet
##Basics
#!/bin/bash | |
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'` | |
for JAIL in $JAILS | |
do | |
fail2ban-client status $JAIL | |
done |
application: you-app-name-here | |
version: 1 | |
runtime: python | |
api_version: 1 | |
default_expiration: "30d" | |
handlers: | |
- url: /(.*\.(appcache|manifest)) | |
mime_type: text/cache-manifest |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |