Skip to content

Instantly share code, notes, and snippets.

@shirou
shirou / site.yml
Created August 19, 2013 08:46
Ansible-awx site.yml
---
# This playbook deploys the AWX application (database, web and worker) to a
# single server.
- hosts: all
tasks:
- name: group hosts by distribution
group_by: key="{{ ansible_distribution }}-{{ ansible_distribution_version }}"
- hosts: RHEL-6*:CentOS-6*:SL-6*
@shirou
shirou / expected
Last active December 21, 2015 05:28
ansible日本語テスト
(ansible)%ansible-playbook -i host.ini test.yml [~/tmp/ansible]
__________________
< PLAY [localhost] >
------------------
\ ,__,
\ (oo)____
(__) )\
||--|| *
@shirou
shirou / main.go
Last active March 4, 2018 10:19
ansible module written in go-lang. This is almost same as http://ansible.cc/docs/moduledev.html#reading-input
package main
import (
"fmt"
"os"
"io/ioutil"
"strings"
"time"
"encoding/json"
)
@shirou
shirou / diff.patch
Created April 3, 2013 06:32
tinkerer dirhtml patch
diff -r f1a8f84556d7 tinkerer/cmdline.py
--- a/tinkerer/cmdline.py Tue Apr 02 23:28:06 2013 +0700
+++ b/tinkerer/cmdline.py Wed Apr 03 15:31:24 2013 +0900
@@ -54,7 +54,7 @@
# silence Sphinx if in quiet mode
if quiet or filename_only:
flags.append("-q")
- flags += ["-d", paths.doctree, "-b", "html", paths.root, paths.html]
+ flags += ["-d", paths.doctree, "-b", "dirhtml", paths.root, paths.html]
@shirou
shirou / original rst file
Created March 23, 2013 14:23
sphinxcontrib-reviewbuilder
= ひとつめの章
== 節
節です
=== 項
項です。
==== 段(見出し)
段(見出し)です。
== 箇条書き
* 第一の項目 -1
@shirou
shirou / deploy.py
Last active December 14, 2015 09:09
deploy tinkerer to S3 . Original author is mercurial.jp
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import socket
import argparse
import hashlib
from boto.s3.connection import S3Connection
from boto.s3.key import Key
@shirou
shirou / gist:4992102
Created February 20, 2013 02:07
misspellings
% find . -name "*.py" | misspellings -f -
./blockdiag/imagedraw/filters/linejump.py:34: reciever -> "receiver"
./blockdiag/imagedraw/filters/linejump.py:36: reciever -> "receiver"
./blockdiag/imagedraw/filters/linejump.py:62: Reciever -> "Receiver"
@shirou
shirou / ltsv.erl
Last active December 12, 2015 07:28
ltsv erlang
see https://github.com/shirou/erlang-ltsv
@shirou
shirou / kill a riak node
Created January 29, 2013 14:17
kill a riak node but still alive or not???
%./dev/dev1/bin/riak start
%./dev/dev2/bin/riak start
%./dev/dev3/bin/riak start
%./dev/dev2/bin/riak-admin cluster join dev1@127.0.0.1
Success: staged join request for 'dev2@127.0.0.1' to 'dev1@127.0.0.1'
%./dev/dev3/bin/riak-admin cluster join dev1@127.0.0.1
Success: staged join request for 'dev3@127.0.0.1' to 'dev1@127.0.0.1'
%./dev/dev1/bin/riak-admin cluster plan
=============================== Staged Changes ================================
Action Nodes(s)
@shirou
shirou / ErrorHandling
Last active December 10, 2015 23:39
SphinxErrorhandling document
エラーハンドリング
=======================
拡張を書いているときに、エラーを出したいときがあります。こういう時には、
sphinx.errorsで定義されている例外を使いますと、通常の例外よりも表示が
親切になります。
sphinx.errorsには以下の例外が定義されています。
- SphinxError