This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parallel performs the given actions with `n` actions in parallel. | |
// Make `n == len(actions)` to perform all actions in parallel. | |
// | |
// Arguments | |
// actions - The functions you want to execute. Error results will be reported to the errors channel. | |
// n - the number of parallel actions to execute in maximum. Must be positive. | |
// errors - Optional channel to report errors back to. Will be closed. | |
// cancel - Optional channel to signal abortion of processing. | |
func parallel(actions []func() error, n int, errors chan<- error, cancel <-chan struct{}) { | |
if len(actions) == 0 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
function visit(node, state) { | |
// console.log('visit', node.Path); | |
if (node.Value == "") { | |
return; | |
} | |
state.push({ | |
key: node.Path, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"flag" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=S1 | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/bin/bash -c 'sleep 30; echo OK' | |
[X-Fleet] | |
X-ConditionMachineOf=service2.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
goHystrix "github.com/ZeissS/goHystrix" | |
) | |
type DeleteTransactionCommand struct { | |
TransactionId string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./etcd -v -f -data-dir /var/lib/etcd -bind-addr 0.0.0.0 -addr 192.168.53.2:4001 -peer-addr 192.168.53.2:7001 -peer-bind-addr 0.0.0.0 -discovery https://discovery.etcd.io/86bf5ce860eef35b94f9f616fb55964f -name dockzero-01 | |
[etcd] Mar 10 10:19:40.979 DEBUG | open /var/lib/etcd/snapshot: permission denied | |
[etcd] Mar 10 10:19:40.982 INFO | Discovery via https://discovery.etcd.io using prefix /86bf5ce860eef35b94f9f616fb55964f. | |
[etcd] Mar 10 10:19:42.081 INFO | Discovery _state was empty, so this machine is the initial leader. | |
[etcd] Mar 10 10:19:42.081 INFO | Discovery fetched back peer list: [] | |
[etcd] Mar 10 10:19:42.081 DEBUG | This peer is starting a brand new cluster based on discover URL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Create the interested streams by touching: | |
# $ touch somafm_groovesalad.m3u | |
# $ touch somafm_covers.m3u | |
for x in somafm_*.m3u | |
do | |
PLAYLIST_FILE=$x | |
STREAM=$(echo $PLAYLIST_FILE | sed -e 's/^somafm_//' -e 's/\.m3u$//') | |
echo Checking $STREAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Args struct { | |
Values []string `json:values` | |
} | |
type Service int | |
// {"id": 1, "method": "echo2.Echo2", "params": {"values": ["hello", "world"]}} | |
func (this *Service) Echo2(params *Args, response *string) error { | |
*response = "Hello World" | |
return nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {"id": 1, "method": "echo2.Echo", "params": ["hello", "world"]} | |
package main | |
import ( | |
"log" | |
"fmt" | |
"net" | |
"net/rpc" | |
"net/rpc/jsonrpc" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
BOX_NAME = ENV['BOX_NAME'] || "ubuntu" | |
BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64.box" | |
VF_BOX_URI = ENV['BOX_URI'] || "http://files.vagrantup.com/precise64_vmware_fusion.box" | |
AWS_REGION = ENV['AWS_REGION'] || "us-east-1" | |
AWS_AMI = ENV['AWS_AMI'] || "ami-d0f89fb9" | |
FORWARD_DOCKER_PORTS = ENV['FORWARD_DOCKER_PORTS'] |