Skip to content

Instantly share code, notes, and snippets.

View masahide's full-sized avatar

YAMASAKI Masahide masahide

View GitHub Profile
@masahide
masahide / __init__.py
Created February 14, 2014 20:20
Ansibleのsudo ask-sudo-pass はどう実装されているか ref: http://qiita.com/yamasaki-masahide/items/454d81be6ca632f39758
def make_sudo_cmd(sudo_user, executable, cmd):
"""
helper function for connection plugins to create sudo commands
"""
# Rather than detect if sudo wants a password this time, -k makes
# sudo always ask for a password if one is required.
# Passing a quoted compound command to sudo (or sudo -s)
# directly doesn't work, so we shellquote it with pipes.quote()
# and pass the quoted string to the user's shell. We loop reading
# output until we see the randomly-generated sudo prompt set with
if err := session.Run("/usr/bin/scp -qrt ./"); err != nil {
@masahide
masahide / piping.go
Created February 18, 2014 05:00 — forked from kylelemons/piping.go
package main
import (
"bytes"
"exec"
"log"
"os"
)
// Pipeline strings together the given exec.Cmd commands in a similar fashion
Subject: =?utf-8?B?6ZW344GE44K144OW44K444Kn44Kv44OI6ZW344GE44K144OW44K4?=
=?utf-8?B?44Kn44Kv44OI6ZW344GE44K144OW44K444Kn44Kv44OI6ZW344GE?=
=?utf-8?B?44K144OW44K444Kn44Kv44OI6ZW344GE44K144OW44K444Kn44Kv?=
=?utf-8?B?44OI6ZW344GE44K144OW44K444Kn44Kv44OI6ZW344GE44K144OW?=
=?utf-8?B?44K444Kn44Kv44OI?=
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Message-Id: <20140222115231.8DECE260593@st>
Date: Sat, 22 Feb 2014 20:52:31 +0900 (JST)
@masahide
masahide / config
Created February 23, 2014 07:42
go でmapや配列等を pretty print (var_dumpみたいな何か)と yaml の読み込み ref: http://qiita.com/yamasaki-masahide/items/327ad9c423de1e35215f
mail_from: masahide.y@gmail.com
to: [masahide.y@gmail.com]
var:
c: 2
d: [3, 4]
@masahide
masahide / docker
Created April 10, 2014 11:21
EC2上にdrone.ioのオープンソース版を載せて「Rebuild」ボタンを追加するパッチを当てる ref: http://qiita.com/yamasaki-masahide/items/686e20b614c838201636
ubuntu@drone:~$ cat /etc/default/docker
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4"
DOCKER_OPTS="-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock"
@masahide
masahide / file0.txt
Created April 13, 2014 02:14
Go言語 drone.ioで自動クロスコンパイル CI環境 #golang ref: http://qiita.com/yamasaki-masahide/items/b4348388267a703b4de5
pkg/os/error_unix.go:11: isExist redeclared in this block
previous declaration at pkg/os/error_posix.go:11
@masahide
masahide / file0.txt
Created April 22, 2014 01:16
VMware player NATで起動したゲストOSにssh接続する ref: http://qiita.com/yamasaki-masahide/items/ccb62e98dff99c2a22a1
host VMnet8 {
# ubuntu
hardware ethernet 00:0c:11:bb:cc:dd;
fixed-address 192.168.21.127;
}
#End
[BatchWriteItem] – 1 回のトランザクションとしてではなく、1回のリクエストで、複数のテーブル間で複数の項目を挿入、置換、削除します。Put または Delete で最大 25 項目のバッチをサポートし、合計リクエストサイズは最大 1 MB です。
@masahide
masahide / file0.txt
Last active August 29, 2015 14:00
S3へ最高のパフォーマンスでログを保存する ref: http://qiita.com/yamasaki-masahide/items/7c44ea17d9901601f38c
examplebucket/2013-26-05-15-00-00/host01/apache/access_log
examplebucket/2013-26-05-15-00-00/host02/apache/access_log
examplebucket/2013-26-05-15-00-00/host03/apache/access_log
examplebucket/2013-26-05-15-00-00/host04/apache/access_log