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
npm install azure-cli -g | |
azure account download |
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
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install docker -y | |
choco install nodejs.install -y | |
choco install rsync -y | |
choco install openssl.light -y |
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
for i in 1 2 3 4 5; do | |
sudo docker run --name="postgres-$i" -d postgres | |
done |
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
Vagrant.configure("2") do |config| | |
config.vm.define "vm1" do |vm1| | |
vm1.vm.box = "puppetlab-centos-64-nocm" | |
end | |
config.vm.define "vm2" do |vm2| | |
vm2.vm.box = "puppetlab-centos-64-nocm" | |
end | |
config.vm.define "vm3" do |vm3| |
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
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.apache.shiro.codec.Hex; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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
public class MapApplication { | |
// case 1 | |
public static <I, O> List<O> mapUsingCollect(Stream<I> stream, Function<I, O> mapper) { | |
return stream.collect(ArrayList::new, (acc, element) -> acc.add(mapper.apply(element)), ArrayList::addAll); | |
} | |
// case 2 | |
public static <I, O> List<O> mapUsingReduce(Stream<I> stream, Function<I, O> mapper) { | |
return stream.reduce(new ArrayList<>(), (acc, element) -> { |
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
{ | |
"@timestamp": "2015-01-23T10:38:18.065+00:00", | |
"@version": 1, | |
"@message": "0:0:0:0:0:0:0:1 - - [2015-01-23T10:38:18.065+00:00] \"GET /t HTTP/1.1\" 200 43", | |
"@fields.method": "GET", | |
"@fields.protocol": "HTTP/1.1", | |
"@fields.status_code": 200, | |
"@fields.requested_url": "GET /t HTTP/1.1", | |
"@fields.requested_uri": "/t", | |
"@fields.remote_host": "0:0:0:0:0:0:0:1", |
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
task dockerPushImage(type: Exec, dependsOn: dockerBuildImage) { | |
environment 'DOCKER_HOST', 'tcp://127.0.0.1:2375' | |
commandLine "${project.dockercmd}", "push", "${project.dockerhub}/dmp-web:${dockerTagVer}" | |
} |
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
14:11:09 study-mbpr: Downloads$ ./darwin create -d azure --azure-publish-settings-file="Study Lab.-12-9-2014-credentials.publishsettings" --azure-password="------------" --azure-username="study" study-docker | |
INFO[0000] Creating Azure host... | |
INFO[0058] Waiting for SSH... | |
INFO[0143] Waiting for docker daemon on host to be available... | |
INFO[0194] "study-docker" has been created and is now the active machine. Docker commands will now run against that machine. | |
14:14:55 study-mbpr: Downloads$ ./darwin ls | |
NAME ACTIVE DRIVER STATE URL | |
study-docker * azure Running tcp://docker-host-87211309ea05.cloudapp.net:4243 |
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
+ Creating VM | |
error: Windows Azure is currently performing an operation with x-ms-requestid c890872725eb3f6b8a763353e5a88296 on this deployment that requires exclusive access. | |
info: Error information has been recorded to azure.err | |
error: vm create command failed | |
./attach-disk.sh rtb-cassandra88 tenmaxdb2 4 100 |