従来の Upstart/daemontools 等の init系プロセスでは、
- double forking による自身を デーモン化するプロセス
- Puma/Unicorn 等の Hot restart
#!/bin/bash | |
if [[ -z "${PACKAGE}" ]]; then | |
echo "error: PACKAGE is not assagined." | |
echo " usage) export PACKAGE=com.example; $(basename ${0})" | |
exit 1 | |
fi | |
while : | |
do |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; | |
public class Main { | |
public static void main(String[] args) { | |
SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日 E曜日", Locale.JAPAN); | |
Date now = new Date(); |
#!/usr/bin/env ruby | |
# usage: setusergroups [-h|--help] username child | |
# | |
# setuidgid w. support for supplementary groups | |
# ruby porting of https://gist.github.com/kazuho/6181648 | |
# | |
# see: http://d.hatena.ne.jp/hirose31/20130808/1375965331 | |
# see: https://gist.github.com/kazuho/6181648 |
user system total real | |
String#scan 1.774321 0.007220 1.781541 ( 1.799350) | |
String.unpack 0.665138 0.003861 0.668999 ( 0.678201) | |
String#chars.each_slice.map(join) 10.444911 0.023717 10.468628 ( 10.521092) | |
String#[] slice with times iteration 2.244066 0.006614 2.250680 ( 2.264310) | |
String#slice with times iteration 2.271120 0.005431 2.276551 ( 2.290473) |
$ echo HOST1 HOST2 | xargs -d ' ' -P2 -I{} ssh {} 'tail -F LOG_PATH | xargs -L 1 echo $(hostname): $1' |