- Install spf13-vim
sh <(curl https://j.mp/spf13-vim3 -L)
- Install Go bundle
echo "export PATH=\$PATH:\$(go env GOPATH)/bin" >> ~/.bashrc
# Create user with random password | |
$password = -join ((48..57) + (97..122) | Get-Random -Count 14 | % {[char]$_}) | |
$unattendPath = "$Env:ProgramData\Amazon\EC2-Windows\Launch\Sysprep\Unattend.xml" | |
$xml = [xml](Get-Content $unattendPath) | |
$targetElememt = $xml.unattend.settings.Where{($_.Pass -eq 'oobeSystem')}.component.Where{($_.name -eq 'Microsoft-Windows-Shell-Setup')} | |
$autoLogonElement = [xml]('<AutoLogon> | |
<Password> | |
<Value>{0}</Value> |
if defined?(ChefSpec) | |
def create_example_topic(resource_name) | |
ChefSpec::Matchers::ResourceMatcher.new(:example_topic, :create, resource_name) | |
end | |
end |
sh <(curl https://j.mp/spf13-vim3 -L)
echo "export PATH=\$PATH:\$(go env GOPATH)/bin" >> ~/.bashrc
#!/bin/bash | |
export GOLANG_VERSION=1.10.3 | |
export GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz | |
export GOLANG_DOWNLOAD_SHA256=fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 | |
apt-get update -qq | |
apt-get install -y --no-install-recommends \ | |
g++ \ |
global | |
# https://www.haproxy.com/blog/multithreading-in-haproxy/ | |
# https://thisinterestsme.com/speeding-up-haproxy-ssl-with-multiple-cpu-processes/ | |
nbproc 1 | |
nbthread 4 | |
cpu-map auto:1/1-4 0-3 | |
maxconn 1000 | |
# SSL configurations |
// coin change kata | |
fun largestCoin(coins: IntArray, amount: Int): Int? = | |
try { | |
coins.first { coin -> coin <= amount } | |
} catch (_: NoSuchElementException) { | |
null | |
} | |
fun coinChange(coins: IntArray, amount: Int): Int { |
#!/usr/bin/python | |
import ansible.inventory | |
import ansible.playbook | |
import ansible.runner | |
from ansible import utils | |
from ansible import callbacks | |
def run_playbook(**kwargs): |
kafka-connect: | |
image: confluentinc/cp-kafka-connect | |
depends_on: | |
- zookeeper | |
- kafka | |
- schema-registry | |
ports: | |
- 8083:8083 | |
- 8084:8084 | |
volumes: |
package main | |
import ( | |
"fmt" | |
) | |
type Error string | |
func (e Error) Error() string { return string(e) } |
2018-01-17 10:11:51 +0000 [info]: reading config file path="/etc/td-agent/td-agent.conf" | |
2018-01-17 10:11:51 +0000 [info]: starting fluentd-0.14.11 pid=1743 | |
2018-01-17 10:11:51 +0000 [info]: spawn command to main: cmdline=["/opt/td-agent/embedded/bin/ruby", "-Eascii-8bit:ascii-8bit", "/usr/sbin/td-agent", "--log", "/var/log/td-agent/td-agent.log", "--use-v1-config", "--group", "td-agent", "--daemon", "/var/run/td-agent/td-agent.pid", "--under-supervisor"] | |
2018-01-17 10:11:51 +0000 [info]: reading config file path="/etc/td-agent/td-agent.conf" | |
2018-01-17 10:11:51 +0000 [info]: starting fluentd-0.14.11 without supervision pid=1753 | |
2018-01-17 10:11:52 +0000 [info]: gem 'fluent-mixin-plaintextformatter' version '0.2.6' | |
2018-01-17 10:11:52 +0000 [info]: gem 'fluent-plugin-kafka' version '0.6.1' | |
2018-01-17 10:11:52 +0000 [info]: gem 'fluent-plugin-mongo' version '0.8.1' | |
2018-01-17 10:11:52 +0000 [info]: gem 'fluent-plugin-prometheus' version '1.0.0' | |
2018-01-17 10:11:52 +0000 [info]: gem 'fluent-plugin-prometheus' |