だったので紹介
percol は入力の1行を1候補として,部分一致かつ AND 検索で絞り込みし,選択した候補を出力するコマンドです.端的に言えば Emacs の anything.el のコマンド版です.
#!/usr/bin/env ruby | |
# This script is intended to preprocess a knife ec2 server create command and | |
# generate a user_data script in the /tmp folder that will rename the host | |
# to match whatever the node name is before the chef bootstrapping process | |
# begins. It then splits the knife command in front of the --node-name or -N | |
# options and inserts "--user-data /tmp/server-01.userdata" (in the example | |
# below) and execs the command. | |
# | |
# Usage: |
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB | |
#/32 = 496630545 = 473MB | |
#/64 = 248315272 = 236MB | |
#/128 = 124157636 = 118MB | |
#/256 = 62078818 = 59MB | |
#/512 = 31039409 = 29MB | |
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762 | |
#/25165760 = 623 # half of max_connections = 1993.6MB | |
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608 | |
#*(3/4) #default innodb pool size = 11922309120 |
#!/usr/local/bin/ruby | |
# -*- encoding: utf-8 -*- | |
require 'net/http' | |
require 'uri' | |
require 'pp' | |
configs = [ | |
{ desc: '正常', url: 'http://mikeda.jp/wiki/', regex: /MikedaWiki/, timeout: 1}, | |
{ desc: '中身がおかしい', url: 'http://mikeda.jp/wiki/', regex: /XXXYYYZZZ/, timeout: 1}, |
2024-04-11
時雨堂
2024.4
時雨堂クラウドサービスを支える技術
function searchAndSave() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[0]; | |
var offset = 0; | |
var limit = 500; | |
while (true) { | |
var threads = GmailApp.search('(subject:日報 AND [report) after:2013/5/31 before:2013/7/1', offset, limit); | |
offset += limit; |
AWS
ではポピュラーツールJava
版と Python
版がある#!/bin/bash | |
for keg in /usr/local/Library/LinkedKegs/*; do | |
kegname="$(basename $keg)" | |
dir="$(find $keg/ -maxdepth 1 -type d | grep '\/\(sbin\|bin\|etc\|var\|lib\|include\|libexec\|share\)$' | head -n1)" | |
[ -z "${dir}" ] && continue | |
testee="$(find $dir -type f | head -n1 | sed -e "s|${keg}||")" | |
[ -f /usr/local/$testee ] || (echo $keg && brew unlink $kegname; brew link --force $kegname) | |
done |