First create an overlay network:
docker network create -d overlay uber-net
Now deploy two stacks:
""" | |
An updated version of https://gist.github.com/markshannon/da7588db3c883dc2006a727a10e00ca5. | |
""" | |
import timeit | |
import sys | |
def foo(): | |
for i in range(100_000): | |
if i == 50_000: |
import time | |
import threading | |
def set_timeout(delay, callback): | |
def target(): | |
time.sleep(delay) | |
callback() | |
threading.Thread(target=target).start() |
#!/use/bin/env perl | |
use strict; | |
# Usage: | |
# ls -l <path> | perl lsbasename.pl | |
while (<STDIN>) { | |
chomp; | |
my $original = $_; | |
my @chunks = split / /; |
{ | |
"Ansi 5 Color" : { | |
"Red Component" : 1, | |
"Color Space" : "sRGB", | |
"Blue Component" : 1, | |
"Alpha Component" : 1, | |
"Green Component" : 0.58823529411764708 | |
}, | |
"Tags" : [ |
""" | |
An arithmetic expression evaluator in Python. | |
The language grammar: | |
prog : expr ; | |
expr : NUMBER ('+'|'-' NUMBER)* NEWLINE; | |
NUMBER : '0'..'9'+ ; | |
NEWLINE : '\n' ; |
{ | |
"global": { | |
"check_for_updates_on_startup": false, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
#!/usr/bin/env python | |
# ndvi.py red.tif nir.tif output-ndvi.tif | |
# Calculate NDVI (see Wikipedia). Assumes atmospheric correction. | |
# (Although I use it without all the time for quick experiments.) | |
import numpy as np | |
from sys import argv | |
from osgeo import gdal, gdalconst |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers