$ echo "DOCKER_OPTS='--dns 172.17.42.1 --dns 8.8.8.8 --dns-search service.consul'" >> /etc/default/docker
$
$ # 上記設定を変更するために再起動
$ docker stop
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
| <html> | |
| <head> | |
| <!-- Load c3.css --> | |
| <link href="http://cdnjs.cloudflare.com/ajax/libs/c3/0.4.7/c3.min.css" rel="stylesheet" type="text/css"> | |
| <!-- Load d3.js and c3.js --> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
| <script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script> | |
| <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/c3/0.4.7/c3.min.js"></script> | |
| <script type="text/javascript"> |
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
| <html> | |
| <head> | |
| <title>DataSheet</title> | |
| <style> | |
| table, td, th { | |
| border-collapse: collapse; | |
| border: 1px solid #ddd; | |
| text-align: left; | |
| } |
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
| yum install docker |
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
| Stream.of("1", "2", null, "3", "4", "5") | |
| .map( x -> Optional.ofNullable(x)) | |
| .map(x -> Integer.parseInt(x.orElse("0"))) | |
| .map(x -> x * 2) | |
| .forEach( x -> System.out.println(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
| interface ToStringModule<T> { | |
| default String toString() { | |
| StringBuilder sb = new StringBuilder(); | |
| sb.append(this.getClass().getSimpleName()); | |
| sb.append("["); | |
| Field[] fields = this.getClass().getDeclaredFields(); | |
| for (Field field : fields) { |
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
| long count = IntStream.rangeClosed(1, 100) | |
| .mapToObj(n | |
| -> ((n % 15 == 0)) ? "FizzBuzz" | |
| : (n % 3 == 0) ? "Fizz" | |
| : (n % 5 == 0) ? "Buzz" | |
| : String.valueOf(n)) | |
| .peek(x -> System.out.println("debug: " + x)) // print debug | |
| .filter(x -> "FizzBuzz".equals(x)) | |
| .count(); |
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
| /** | |
| * Java 8 New Style. | |
| */ | |
| public static void useStreamAPI() { | |
| IntStream.rangeClosed(1, 100) | |
| .mapToObj(n | |
| -> ((n % 15 == 0)) ? "FizzBuzz" | |
| : (n % 3 == 0) ? "Fizz" | |
| : (n % 5 == 0) ? "Buzz" | |
| : String.valueOf(n)) |
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 static void useList() { | |
| List<String> result = fizzbuzz(list(1, 100)); | |
| for (String x : result) { | |
| System.out.println(x); | |
| } | |
| } | |
| public static List<String> fizzbuzz(List<Integer> source) { | |
| List<String> result = new ArrayList<>(); |