Skip to content

Instantly share code, notes, and snippets.

@soudai
soudai / check_memory.php
Created January 21, 2019 15:24
Mackerelのメトリック監視に合わせてメモリーを数値化する
<?php
/**
* [plugin.checks.check_memory]
* command = "php /usr/local/bin/check_memory.php -c 90"
* max_check_attempts = 5
* check_interval = 1
* action = { command = "/etc/init.d/httpd graceful" }
* memo = "httpdによってmemoryが圧迫されたらhttpdをgracefulする"
**/
@soudai
soudai / addSpreadsheetToTrelloCard.gs
Last active June 22, 2018 15:41
Google SpreadsheetからTrelloに自動登録する
var scriptProp = PropertiesService.getScriptProperties().getProperties();
var trelloKey = scriptProp.TRELLO_API_KEY;
var trelloToken = scriptProp.TRELLO_TOKEN;
var username = scriptProp.TRELLO_USERNAME;
var trelloBaseURL = scriptProp.TRELLO_BASE_URL;
function addTrelloCard(){
var values = getSpreadsheet();
// リクエスト用のURL文字列を作成
127.0.0.1
ServerVersion: Apache/2.4.27 (Amazon) PHP/5.6.31
ServerMPM: prefork
Server Built: Sep 24 2017 23:19:50
CurrentTime: Tuesday, 28-Nov-2017 08:25:28 UTC
RestartTime: Monday, 27-Nov-2017 03:20:01 UTC
ParentServerConfigGeneration: 6
ParentServerMPMGeneration: 5
ServerUptimeSeconds: 104726
ServerUptime: 1 day 5 hours 5 minutes 26 seconds
@soudai
soudai / metadata-rpm-packages.php
Last active June 4, 2017 19:03
yumのインストールパッケージを雑にmackerelのmetadataとして登録する
<?php
$list = explode("\n", `yum list installed`);
foreach ($list as $key => $val) {
if (empty($val)) {
continue;
}
$base_list = array_filter(explode(" ", $val));
$json_base[$key]['name'] = array_shift($base_list);