Skip to content

Instantly share code, notes, and snippets.

@ngyuki
ngyuki / codebuild-times.sh
Last active June 30, 2024 02:38
CodeBuild の実行時間をざっくり俯瞰するためのスニペット
aws codebuild list-builds-for-project --project-name XXXXX --max-items 100 \
| jq '.ids[]' -r \
| xargs aws codebuild batch-get-builds --ids \
| jq '.builds | sort_by(.buildNumber) | .[] | {buildNumber,startTime,buildStatus} * (.phases|map({key:.phaseType,value:.durationInSeconds})|from_entries)' \
| mlr --j2p cat
@ngyuki
ngyuki / gist:6c3dede6163cc92bad0005b02ea7dfdb
Created June 30, 2024 02:31
CodeBuild の実行時間をざっくり俯瞰するためのスニペット
aws codebuild list-builds-for-project --project-name XXXXX --max-items 100 \
| jq '.ids[]' -r \
| xargs aws codebuild batch-get-builds --ids \
| jq '.builds | sort_by(.buildNumber) | .[] | {buildNumber,startTime,buildStatus} * (.phases|map({key:.phaseType,value:.durationInSeconds})|from_entries)' \
| mlr --j2p cat
@ngyuki
ngyuki / .bootstrap-modals
Last active October 29, 2018 00:47
Bootstrap でモーダルを多重表示するサンプル
We couldn’t find that file to show.
function success(t){
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, t);
})
}
function error(t){
return new Promise((resolve, reject) => {
#!/usr/bin/env node
// @see https://qiita.com/soarflat/items/1a9613e023200bbebcb3
function sampleResolve(value) {
return new Promise(resolve => {
setTimeout(() => {
resolve(value);
}, 1000);
})
<?php
namespace strpos {
function startsWith($haystack, $needle) {
return (strpos($haystack, $needle) === 0);
}
function endsWith($haystack, $needle) {
return strrpos($haystack, $needle, 0) === strlen($haystack) - strlen($needle);
}
}
@ngyuki
ngyuki / README.md
Last active August 29, 2015 14:10
run script from user data on aws for centos

Install

curl -o /etc/init.d/auto-userscript \
  https://gist.githubusercontent.com/ngyuki/61bf0262dc1bf450499a/raw/auto-userscript

chmod +x /etc/init.d/auto-userscript

chkconfig --add auto-userscript
@ngyuki
ngyuki / autoissue
Last active September 18, 2020 07:29
auto generate issue for centos6
#!/bin/bash
#
### BEGIN INIT INFO
# Required-Start: $network
# Should-Start: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
#
# chkconfig: 2345 98 02
@ngyuki
ngyuki / autohostname
Created November 18, 2014 13:15
auto set hostname for centos
#! /bin/bash
#
# chkconfig: 2345 11 89
. /etc/init.d/functions
[ -x /sbin/ip ] || exit 1
[ "$EUID" != "0" ] && exit 4
case "$1" in
@ngyuki
ngyuki / daemontools
Last active August 29, 2015 14:09
daemontools ocf script for pacemaker and heartbeat
#!/bin/sh
#######################################################################
# TEST
#
# export OCF_ROOT=/usr/lib/ocf
# export OCF_RESKEY_service_dir=/service/dummy
# export OCF_RESKEY_svc_bin=/usr/bin/svc
# export OCF_RESKEY_svstat_bin=/usr/bin/svstat
#