This file contains hidden or 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
With confd sometimes you will want to join a bunch of keys together into a line with comma separated values. Here is a template snippet to do that: | |
servers={{range $index,$server := .myapp_servers}}{{if $index}},"{{$server.Value}}"{{else}}"{{$server.Value}}"{{end}}{{end}} | |
Credit for the technique goes to Jan Newmarch's tutorial page at http://jan.newmarch.name/go/template/chapter-template.html |
This file contains hidden or 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
# install sysbench with | |
# sudo yum --enablerepo=epel install -y sysbench | |
targetDir=/data/benchmark # pick a directory inside your target file system | |
fileSize=300G # pick large enough size that you aren't using FS cache effectively | |
threads=128 | |
test=rndrw # can also use rndrd | |
blockSize=4096 | |
This file contains hidden or 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
ec2ssh() { | |
# ec2-54-187-110-140.us-west-2.compute.amazonaws.com -> 54-187-110-140 | |
hostname=`echo $1 | perl -pe 's/\..*//; s/ec2-//; s/-/./g'` | |
ssh $hostname | |
} |
NewerOlder