Instead of running cmake in tree such as:
cd ${WORKSPACE}
git clone http://github.com/WebAssembly/wabt
cd wabt
mkdir build
cd build
cmake ..
cmake --build .
## /etc/network/interfaces | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
source /etc/network/interfaces.d/* | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback |
/** Parse any IPv4 address or IPv6 address or domain name */ | |
def parsePeerAddress(value: String): Try[String] = | |
parseIPv4(value) orElse parseIPv6(value) orElse parseHostname(value) | |
/** Parse IPv4 address */ | |
def parseIPv4(value: String): Try[String] = | |
value.trim match { | |
case regexIPv4(_*) => Success(value) | |
case _ => Failure(new IllegalArgumentException(s"invalid IPv4 address name: ${value.trim}")) | |
} |
#!/bin/bash | |
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit | |
sudo apt-get update | |
sudo apt-get dist-upgrade -y | |
sudo apt-get install apt-transport-https ca-certificates -y | |
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list" | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D |
#!/bin/bash -eu | |
function linalg_matrix_dump { | |
local -n M=${1} | |
local -a data=(${M[data]}) | |
typeset -i rows=${M[rows]} | |
typeset -i cols=${M[cols]} | |
typeset -i i j | |
printf "%s:\n" ${1} | |
for ((i=0;i<rows;i++)) ; do |
#!/usr/bin/env python3 | |
import json | |
import requests | |
import argparse | |
import os | |
import sys | |
from git import Repo | |
## |
mod LinkedList { | |
type Link<T> = Option<Box<Node<T>>>; | |
struct Node<T> { | |
value: T, | |
next: Link<T>, | |
} | |
} | |
mod DoubleLinkedList { | |
use core::cell::RefCell; |
Instead of running cmake in tree such as:
cd ${WORKSPACE}
git clone http://github.com/WebAssembly/wabt
cd wabt
mkdir build
cd build
cmake ..
cmake --build .
#!/bin/bash -ex | |
# This script creates a Salt installation inside a virtual environment so that | |
# a steteful infrastructure aiming customer A is absolutely oblivious of customer B. | |
# | |
# No changes are required on configuration files, so that you can be sure that | |
# whatever you keep in the source control is valid in production. All you have to do | |
# in production is copying the trees /etc/salt and /srv/salt from the source control | |
# to their glorified places /etc/salt and /srv/salt in production. | |
# |
def contents(ssh, files): | |
for file in files: | |
path = '{}/{}'.format(ssh, file) | |
yield open(path).read().replace("\n", "") | |
def keysFor(args): | |
ssh = '{}/.ssh'.format(os.environ['HOME']) | |
extensions = [ '.pub' ] | |
files = [f for f in os.listdir(ssh) if os.path.splitext(f)[1] in extensions] | |
keys = [k for k in contents(ssh, files) if k.split(' ')[2] in args] |
def a: Try[String] = Failure(new RuntimeException) | |
def b: Try[String] = Failure(new RuntimeException) | |
def c: Try[String] = Success("C") | |
def d: Try[String] = Failure(new RuntimeException) | |
def e: Try[String] = Success("E") | |
def f: Try[String] = Failure(new RuntimeException) | |
val result = a orElse b orElse c orElse d orElse e orElse f | |
// result is Success("C") |