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
#!/usr/bin/env perl | |
# -*- coding: utf-8 -*- | |
# for RHEL `sudo yum install perl-Sys-Syslog` | |
use strict; | |
use warnings; | |
use Sys::Syslog qw(:standard setlogsock); | |
use Time::HiRes qw(gettimeofday usleep); | |
use POSIX qw(strftime); | |
use constant TARGET => 'r1'; ### ** UPDATE HERE. hostname or IP *** | |
setlogsock('udp'); |
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
// 異なるポートで2つhttpdを立ち上げる。タイムアウトも設定してご安全に。 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"time" | |
) | |
func handler1(w http.ResponseWriter, r *http.Request) { |
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
from datetime import timezone, datetime | |
print(datetime.now(timezone.utc)) | |
# 「today() および utcnow() よりもこの関数を使う方が好ましいです」だそうです。 | |
# [datetime --- 基本的な日付型および時間型 — Python 3.8.1 ドキュメント](https://docs.python.org/ja/3/library/datetime.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
from datetime import timezone, datetime | |
print(datetime.now(timezone.utc).strftime("%Y%m%d%H%M%S%f")) |
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
%matplotlib inline | |
import numpy as np | |
import matplotlib.pyplot as plt | |
x = np.linspace(-10, 10, 1000) | |
y = np.sin(x) | |
plt.plot(x, y) | |
plt.show() |
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
package main | |
import ( | |
"fmt" | |
"golang.org/x/text/encoding/japanese" | |
"golang.org/x/text/transform" | |
"log" | |
) | |
func main() { |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"log" | |
"strings" | |
) |
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
- name: join and sequence example | |
hosts: localhost | |
become: no | |
gather_facts: False | |
vars: | |
data: [foo, bar, baz] | |
tasks: | |
- | |
name: join example | |
debug: msg="{{ data|join(', ') }}" |
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
- name: handler test | |
hosts: localhost | |
become: no | |
gather_facts: false | |
force_handlers: true | |
#------------- | |
tasks: | |
- name: Create working directory. | |
tempfile: | |
state: directory |
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
- name: jinja2 has not list comprehension. | |
hosts: localhost | |
become: no | |
gather_facts: false | |
vars: | |
data: [foo, bar, baz] | |
tasks: | |
- | |
debug: | |
msg: > |
OlderNewer