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| { | |
| "blacklist": { | |
| "countries": [ | |
| "am", | |
| "az", | |
| "by", | |
| "ge", | |
| "kg", | |
| "kz", | |
| "md", |
| root@nami:~# tcpdump -r random_traffic_port_8082_udp.pcap | head | |
| reading from file random_traffic_port_8082_udp.pcap, link-type EN10MB (Ethernet) | |
| 19:40:58.250303 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.250640 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.251200 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.251358 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.251566 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.252529 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.252711 IP internationalhost.35447 > nami.8082: UDP, length 2048 | |
| 19:40:58.252975 IP internationalhost.35447 > nami.8082: UDP, length 2048 |
| Latency Comparison Numbers | |
| -------------------------- | |
| 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 |
| #!/bin/bash | |
| for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do | |
| git branch --track ${branch#remotes/origin/} $branch | |
| done |
| from BaseHTTPServer import BaseHTTPRequestHandler | |
| import urlparse, json | |
| class GetHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| parsed_path = urlparse.urlparse(self.path) | |
| message = '\n'.join([ | |
| 'CLIENT VALUES:', | |
| 'client_address=%s (%s)' % (self.client_address, |
| (ns echo-server | |
| (:import (java.net InetAddress DatagramPacket DatagramSocket))) | |
| (def udp-server (ref nil)) | |
| (def port 12345) | |
| (defn localhost [] (. InetAddress getLocalHost)) | |
| (defn message [text] |
| #lang racket | |
| (require racket/udp) | |
| (define count 0) | |
| (define s (udp-open-socket #f #f)) | |
| (udp-bind! s #f 12346) | |
| (define buffer (make-bytes 1024)) |
| # coding=utf-8 | |
| """ | |
| LICENSE http://www.apache.org/licenses/LICENSE-2.0 | |
| """ | |
| import datetime | |
| import sys | |
| import time | |
| import threading | |
| import traceback | |
| import SocketServer |
| import os | |
| from collections import namedtuple | |
| disk_ntuple = namedtuple('partition', 'device mountpoint fstype') | |
| usage_ntuple = namedtuple('usage', 'total used free percent') | |
| def disk_partitions(all=False): | |
| """Return all mountd partitions as a nameduple. | |
| If all == False return phyisical partitions only. | |
| """ |
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