Skip to content

Instantly share code, notes, and snippets.

View hotta's full-sized avatar

HOTTA, Michihide hotta

View GitHub Profile
@hotta
hotta / custom_503.html
Created August 8, 2017 03:06
always return http status 503 with custom error page using nginx.
<!-- /var/www/http503/custom_503.html -->
<html>
<body>
<h1>custom_503.html</h1>
<img src='images/job_it_dokata.png' alt='IT Dokata'>
</body>
</html>
@hotta
hotta / Mailman2Groups.gs
Last active November 18, 2016 01:34
Mailman to Google Groups member list migration sample using Google Apps Script
/*********************************************************************************
* Mailman からのリスト移行サンプル using Google Apps Script
* 2015.09.07 M.Hotta
*
* Mailman における情報取得方法
* リスト一覧の取得 mailman:/usr/lib/mailman/bin$ sudo ./list_lists | nkf -w
* (文字化けする場合は管理画面から取得)
* 購読者一覧の取得 mailman:/usr/lib/mailman/bin$ sudo ./list_members リスト名
* 管理者一覧の取得 mailman:/usr/lib/mailman/bin$ sudo ./list_owners リスト名
*
@hotta
hotta / cvtlog.php
Last active August 8, 2017 03:09
Display data encoded as UTF-8 strings
#!/usr/bin/php
<?php
//---------------------------------------------------------------------
// Display data encoded as UTF-8 strings
//
// Usage: tail -f log-files-etc | cvtlog.php
//---------------------------------------------------------------------
function pack_func($matches) // $matches[] = array('\xXX', '\xXX');
{
$tmp = sscanf('0' . substr($matches[0], 1), "%x");
@hotta
hotta / phpdbg.md
Last active December 15, 2023 06:25
phpdbg 簡易マニュアル
#!/usr/bin/php
<?php
if ($argc == 1) {
printf("Retrieve JSON data from specified URl and then decode.\n");
printf("Usage: %s URL_that_returns_JSON\n", $argv[0]);
exit(0);
}
$a = file_get_contents($argv[1]);
$a = preg_replace('/^[\r\n\(]*/', '', $a);
$a = preg_replace('/\)$/', '', $a);
@hotta
hotta / base64decode.php
Last active August 29, 2015 14:01
a filter to conver the result of ldapsearch
#!/usr/bin/php
<?php
// base64encode.php by M.Hotta
// a filter to conver the result of ldapsearch command
//
function output($attr, $value, $encoded) {
if ($encoded) {
print $attr . ':: ' . base64_decode($value) . "\n";
} else {
print $attr . ':' . $value . "\n";