start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
""" | |
See http://opencountrycodes.appspot.com/python/ | |
state_names returns a state name for a state code, like 'AK': 'Alaska' | |
country_names returns a country name for a country code, like 'AD': 'Andorra' | |
state_codes and country_codes are just the reverse | |
""" |
#!comment: This is a list of the top 100,000 most frequently-used English words | |
#!comment: according to Wiktionary. | |
#!comment: | |
#!comment: It was compiled in August 2005 and coalesced into a handy list for | |
#!comment: use in John the Ripper. | |
#!comment: | |
#!comment: | |
#!comment: Pull date: Sun Jan 15 22:03:54 2012 GMT | |
#!comment: | |
#!comment: Sources: |
import paramiko | |
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
c = paramiko.SSHClient() | |
c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
print "connecting" | |
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
print "connected" | |
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
for command in commands: | |
print "Executing {}".format( command ) |
def gen_redis_proto(*args): | |
proto = '' | |
proto += '*' + str(len(args)) + '\r\n' | |
for arg in args: | |
proto += '$' + str(len(arg)) + '\r\n' | |
proto += str(arg) + '\r\n' | |
return proto |
function listToMatrix(list, elementsPerSubArray) { | |
var matrix = [], i, k; | |
for (i = 0, k = -1; i < list.length; i++) { | |
if (i % elementsPerSubArray === 0) { | |
k++; | |
matrix[k] = []; | |
} | |
matrix[k].push(list[i]); | |
} | |
return matrix; |
from multiprocessing.process import Process | |
import time | |
import redis | |
def pub(myredis): | |
for n in range(10): | |
myredis.publish('channel','blah %d' % n) | |
time.sleep(5) | |
def sub(myredis, name): |
<html> | |
<head> | |
<script src="/javascripts/CryptoJS/rollups/aes.js"></script> | |
<script src="/javascripts/CryptoJS/components/mode-cfb-min.js"></script> | |
<script src="/javascripts/encrypt.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
// License: MIT - https://opensource.org/licenses/MIT | |
// Author: Michele Locati <michele@locati.it> | |
// Source: https://gist.github.com/mlocati/7210513 | |
function perc2color(perc) { | |
var r, g, b = 0; | |
if(perc < 50) { | |
r = 255; | |
g = Math.round(5.1 * perc); | |
} | |
else { |