Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
from deployment.cuisine import * | |
from fabric.api import * | |
from fabric.context_managers import * | |
from fabric.utils import puts | |
from fabric.colors import red, green | |
import simplejson | |
import os |
import re | |
def strip_margin(text): | |
return re.sub('\n[ \t]*\|', '\n', text) | |
def strip_heredoc(text): | |
indent = len(min(re.findall('\n[ \t]*(?=\S)', text) or [''])) | |
pattern = r'\n[ \t]{%d}' % (indent - 1) | |
return re.sub(pattern, '\n', text) |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
#!/usr/bin/env perl | |
# | |
# mp3tag.pl - changes MP3 tag encoding (CP949 -> UTF-8) | |
# | |
# Changes MP3 tag encoding from CP949 to UTF-8. | |
# | |
# Copyright (C) 2012 by Seungwon Jeong | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
#!/usr/bin/env ruby | |
require 'faraday' | |
require 'json' | |
require 'gitlab' | |
module Redmine | |
Host = nil | |
APIKey = nil |
#!/bin/bash | |
# | |
# This is really just notes, but I put them in a shell script so I get | |
# free highlighting and easy cut/paste (in and out). | |
# | |
echo "Don't run this script! It's meant to be read. It will destroy your system!" | |
exit 1 | |
RAW="lucid-amd64-cdh3u4-raw" |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
/********************************************************************************************************* | |
* Windows Registered I/O (RIO) Sample Code (Echo Server) | |
* Minimum requirement: Windows 8 or Windows Server 2012 | |
* Author: @sm9kr | |
* | |
* Notice | |
* 몇몇 코드 조각들은 (http://www.serverframework.com/asynchronousevents/rio/)에서 가져옴. | |
* 그런데 여기도 제대로 완성된 코드가 있었던 것은 아니라서 상당 부분 기능을 추가하여 동작하도록 함. | |
* RIO의 사용법을 보여주기 위한 코드라 최대한 간단하게 필요한 부분만 넣었음. | |
* 그래서, 버그가 있을 수 있음... |
Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.
In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.
YMMV. Caveat usufructuarius.