jq -r '.[] | to_entries | map("\(.key):\(.value)") | join("\t")'
Tags がないとき用に .Tags[]?
にしておく
#!/bin/bash | |
epoch=$(sed -n 's/^btime //p' /proc/stat) | |
clk_tck=$(getconf CLK_TCK) | |
now=$(date +%s) | |
seconds=300 | |
for pid in $(ps aux | grep jav[a] | awk '{print $2}'); do | |
start_time=$(awk '{print $22}' /proc/${pid}/stat) | |
ps_uptime=$(($now - ( $epoch + ($start_time / $clk_tck) ) )) |
#!/usr/bin/env ruby | |
require "net/http" | |
require "uri" | |
require "json" | |
require "optparse" | |
@args = {} | |
OptionParser.new do |opt| | |
opt.on("-p PORT", "--port PORT", "Port"){|v| @args[:port] = v } |
FYI: https://qiita.com/sfujiwara/items/b227b3ca6a1e8f104bc9
$ date +%z
+0900
$ /path/to/resty start_time.lua
1970-01-01T09:00:00+09:00
<source> | |
type forward | |
port 24224 | |
</source> | |
<match **> | |
type forward | |
<server> | |
host test-server | |
</server> |
#!/bin/bash | |
INSTANCE="${1}" | |
instance_id() { | |
CODE="${2}" | |
if [ "${CODE}" = "" ]; then | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=${1}" | jq -r ".Reservations[].Instances[].InstanceId" | |
else |
Summary: Authentication via nginx with ngx_http_auth_request_module, or h2o with mruby | |
Name: go-nginx-oauth2-adapter | |
Version: 0.1.0 | |
Release: 1%{?dist} | |
License: MIT | |
Group: Applications/Services | |
URL: https://github.com/shogo82148/go-nginx-oauth2-adapter | |
%description | |
Authentication via nginx with ngx_http_auth_request_module, or h2o with mruby. |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
now := time.Now() | |
// current timezone & offset |
#!/bin/bash | |
sleep 2 && echo "bar" & | |
sleep 1 && echo "foo" & | |
wait | |
echo "hogehoge" |