ISO-8601形式はパターンがいくつかあるが、下記の形式とする
2017-11-14T22:30:01+09:00
date +"%Y-%m-%dT%H:%M:%S%:z"
coreutils-8.25以降のdateコマンド 参考
| #!/bin/sh | |
| HOSTS_FILE="${HOME}/.hosts" | |
| CACHE_TIME="5" | |
| ROLES_SELECT="false" | |
| print_help() { | |
| cat <<-EOF >> /dev/stdout | |
| mackerel ssh command |
| import json | |
| def get_snmp_static(): | |
| """ /proc/net/snmp をparseして辞書形式を返す """ | |
| with open('/proc/net/snmp', 'r') as fh: | |
| protocols = [] | |
| statics = [] | |
| lines = fh.readlines() | |
| for line in zip(*[iter(lines)] * 2): |
| #!/bin/sh | |
| AWS_PROFILE=${AWS_PROFILE:="default"} | |
| AWS_ROLE_SESSION_NAME=$(date +%Y%m%d%H%M%S-session) | |
| DURATION="7200" | |
| print_help() { | |
| cat <<-EOF >> /dev/stdout | |
| Get and Set AWS_SESSION_TOKEN Environment |
| #!/bin/bash | |
| set -ex | |
| PROFILE=${AWS_PROFILE:="default"} | |
| REGION=${AWS_REGION:="ap-northeast-1"} | |
| print_help() { | |
| cat <<-EOF >> /dev/stdout | |
| Select and get log for cloudwatch logs |
| package main | |
| import ( | |
| "log" | |
| "time" | |
| ) | |
| func main() { | |
| size := 100 | |
| for num := range FibonacciGenerator(size, false) { |
ISO-8601形式はパターンがいくつかあるが、下記の形式とする
2017-11-14T22:30:01+09:00
date +"%Y-%m-%dT%H:%M:%S%:z"
| #!/bin/sh | |
| ##################### | |
| # for archlinux 2017/11/05 | |
| # depend | |
| sudo pacman -S libffi libyaml openssl zlib openssl-1.0 --noconfirm | |
| yay -S gcc6 --noconfirm | |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func main() { | |
| fmt.Println(time.Now().Format(time.RFC3339)) | |
| } |