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
import org.apache.commons.collections4.IterableUtils; | |
import java.util.function.Function; | |
public class Iterables { | |
public static <F, T> Iterable<T> map( | |
Iterable<F> iterable, | |
Function<F, T> mapper) { | |
return IterableUtils.transformedIterable(iterable, (x) -> mapper.apply(x)); | |
} |
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
Feb 5 09:01:01 localhost systemd: Started Session 81 of user root. | |
Feb 5 09:01:01 localhost systemd: Starting Session 81 of user root. | |
Feb 5 09:01:01 localhost systemd: Removed slice user-0.slice. | |
Feb 5 09:01:01 localhost systemd: Stopping user-0.slice. | |
Feb 5 10:01:01 localhost systemd: Created slice user-0.slice. | |
Feb 5 10:01:01 localhost systemd: Starting user-0.slice. | |
Feb 5 10:01:01 localhost systemd: Started Session 82 of user root. | |
Feb 5 10:01:01 localhost systemd: Starting Session 82 of user root. | |
Feb 5 10:01:01 localhost systemd: Removed slice user-0.slice. |
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
azure vm docker create -e 22 -l 'West US' VM_NAME "b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140618.1-en-us-30GB" ACCOUNT PASSWORD |
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
npm install azure-cli -g | |
azure account download |
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
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 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
for i in 1 2 3 4 5; do | |
sudo docker run --name="postgres-$i" -d postgres | |
done |
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
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 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
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 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
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 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
{ | |
"@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", |