Author: Chris Lattner
#Container Resource Allocation Options in docker-run
now see: https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources
You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.
##Dynamic CPU Allocation
-c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: kube-registry-v0 | |
namespace: kube-system | |
labels: | |
k8s-app: kube-registry | |
version: v0 | |
spec: | |
replicas: 1 |
#!/usr/bin/env python | |
"""Run `snort -A console` command using a pipe. | |
Warning! Alerts are delayed until snort's stdout buffer is flushed. | |
""" | |
from __future__ import print_function | |
from subprocess import Popen, PIPE, STDOUT | |
snort_process = Popen(['snort', '-A', 'console', '-c', 'snort.conf'], | |
stdout=PIPE, stderr=STDOUT, bufsize=1, |
This Gist is created in 2014, and it's highliy outdated now, according to one of mitmproxy
's manjor contributor (check his comment below). Thanks for letting us know, @mhils!
Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.
var AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: '{AWS_KEY}', | |
secretAccessKey: '{AWS_SECRET}', | |
region: '{SNS_REGION}' | |
}); | |
var sns = new AWS.SNS(); |
#!/usr/bin/env python | |
import re | |
import os | |
import sys | |
import threading | |
import subprocess | |
import getopt | |
import time |