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
# https://trac.ffmpeg.org/wiki/Encode/H.264 | |
# https://trac.ffmpeg.org/wiki/Encode/AAC | |
# -map 0 -c copy: copy all remaining streams | |
# -pix_fmt yuv420p: be compatible with most players | |
# high quality video, high quality audio | |
avconv -i input.mov -map 0 -c copy -c:v libx264 -preset veryslow -pix_fmt yuv420p -crf 17 -c:a libfdk_aac -vbr 4 output.mov | |
# high quality *compatible* full-hd video, high quality audio |
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
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. | |
""" |
# coding=utf-8 | |
""" | |
LICENSE http://www.apache.org/licenses/LICENSE-2.0 | |
""" | |
import datetime | |
import sys | |
import time | |
import threading | |
import traceback | |
import SocketServer |
#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)) |
(ns echo-server | |
(:import (java.net InetAddress DatagramPacket DatagramSocket))) | |
(def udp-server (ref nil)) | |
(def port 12345) | |
(defn localhost [] (. InetAddress getLocalHost)) | |
(defn message [text] |
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, |
#!/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 |
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 |
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 |