次のようなデータがあるとする。
$ cat data
# cat /proc/uptime | |
{ | |
insec = $1; | |
# insec = 20 # 20s | |
# insec = 2400; # 40min | |
# insec = 3600 * 2; # 2h | |
# insec = 4300; # 1h 12min <- 1h 11m 40s | |
# insec = 86400; # 1day | |
# insec = 86400 + 2400; # 1day <- 1d 40min | |
# insec = 86400 + 3600 * 2; # 1day 2h |
# - https://stackoverflow.com/questions/3795554/extract-the-time-from-a-uuid-v1-in-python | |
''' | |
import time | |
import datetime | |
import uuid | |
>>> uu = uuid.uuid1() | |
>>> uu | |
UUID('ca7f909e-6197-11eb-b755-fe8e2a52ce52') |
ubuntu@ubuntu:~$ puppet apply pretty.pp [12/46] | |
Notice: Scope(Class[main]): {one => 1, two => [dos, 2]} | |
Notice: Scope(Class[main]): | |
{ | |
"one": "1", | |
"two": [ | |
"dos", | |
"2" | |
] | |
} |
# 準備中 |
#!/bin/sh | |
set -e | |
main() { | |
local git_toplevel="$( git rev-parse --show-toplevel 2>/dev/null ||: )" | |
if [ -z "$git_toplevel" ]; then | |
echo "$0: not a git repository" >&2 | |
exit 1 | |
fi | |
git describe --tags HEAD 2>/dev/null | |