... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| #!/usr/bin/env bash | |
| size=1024 # MB | |
| mount_point=$HOME/tmp | |
| name=$(basename "$mount_point") | |
| usage() { | |
| echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
| "(default: mount)" >&2 | |
| } |
| # OSX for Hackers (Mavericks/Yosemite) | |
| # | |
| # Source: https://gist.github.com/brandonb927/3195465 | |
| #!/bin/sh | |
| # Some things taken from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Ask for the administrator password upfront |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.
Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.
| package main | |
| type verbosityEnum int | |
| const ( | |
| NoneVerbosity verbosityEnum = 1 << iota | |
| ErrorVerbosity verbosityEnum = 2 | |
| WarningVerbosity verbosityEnum = 4 | |
| InfoVerbosity verbosityEnum = 8 | |
| AllVerbosity verbosityEnum = 16 |
| #!/usr/bin/ruby | |
| # encoding: utf-8 | |
| require 'optparse' | |
| require 'ostruct' | |
| # Generate random names | |
| class Zar # rubocop:disable ClassLength | |
| DEFAULT_LANGUAGE = :auto | |
| DEFAULT_SEPARATOR = '-' |
| #!/bin/bash | |
| CONSUL="localhost:8500" | |
| main() { | |
| case "$1" in | |
| info) | |
| curl -s "$CONSUL/v1/kv/$2" | jq -r .[] | |
| ;; | |
| get) |
| #!/usr/bin/ruby | |
| # encoding: utf-8 | |
| # Shamelessly stolen and adapted from https://github.com/raycchan/bazaar | |
| require 'erb' | |
| # Generate random names | |
| class Rasgele # rubocop:disable ClassLength | |
| RANDOM_FORMAT = '<%= superadjective %>-<%= supername %>-<%= random %>' |
| require 'will_paginate/view_helpers/link_renderer' | |
| module WillPaginate | |
| module ViewHelpers | |
| class LinkRenderer | |
| protected | |
| def page_number(page) | |
| page == current_page ? tag(:span, page, class: 'active item') : link(page, page, class: 'item', rel: rel_value(page)) | |
| end | |
| package bm | |
| import ( | |
| "testing" | |
| ) | |
| var mb = map[string]bool{ | |
| "alpha": true, | |
| "beta": true, | |
| "gamma": true, |