Riak Serious Talk 感想

id:tagomoris さん主催の Riak Serious Talk へ、いってきました。


参加者は招待制、遅刻したら入れない、Tweet禁止、他言無用というしばりの中
沢山の出席者があつまり、とても面白かったです。


id:tagomoris id:repeatedly の二人に、自分がLTやると書かれたので、
一応、ごにょごにょと、発表もしてきました。
まぁ、非公開なのでいいかなと、たいした話ではありませんでしたが、とても緊張しました。 (´・ω・`)


一番、よかったのは、中の人とポジショントークなしで、色々、ディスカッションできた事ですね。
こういうのは、大きなベンダーの集まりだと、なかなか、できません。
いや、そもそも、まぁ、開発者同士が、フラットに話す事が難しいですけど。。


試みとしては、良い感じだったと思います。


色々、感謝します。。

俺は伊達や酔狂で内製やってるんだ!-- 続

若干、1名、つづきを求めていたので、ちょっと、また、書く。
今日のテーマは、簡単な事。

ユーザの自己評価は、おりこうさん、か、おばかさん、どっち?

春一番が、掃除したての.... *1

通常、SIさんに任せているときは、当然、沢山の協力会社さんがいらっしゃります。
一括で、まるっと、お願いするパターンもあれば、行程毎にお願いする事もあるわけで。


そんなこんなで、おのずと、それぞれの単価や、能力もみえてくるってもんです。


ああ、内製なんかに、ヨロヨロとよろめくと、お別れのシーズンがくるのですよねぇ。。


下手すると、その辺の社員よりも、ながーーーく、業務を支えている協力会社さんも
いたりするわけで、それはそれは、大変です。。。


内製といっても、いくつかのパターンがあると思っています。*2

  1. プロマネの役割をユーザが行う
  2. 設計者、ユーザが行う
  3. 実装者もユーザがおこなう


いきなり、全てを自分の力だけでやる訳にはいかないので、
今まで、やってもらっていた「なにか」はユーザがやる。
となれば、当然、なにをやる=誰を切るになりまする。

風が、カムイの影をきーる *3

さて、何を切る?


色々な考えもあると思いますが、ここでは、単純化しましょう。*4
コストで、ハイ&ロウ!!!


月単価の高い方から切るか?安い方から切るか?
どっち?どっち?どっち?


自分の値段を決めるのに、等しい事だと、この時に気が付く人は多い。。。
痛々しいです。。。

わたし馬鹿よねぇ、おばかさんよねぇ...*5

普通、高い方から、切るんですよねぇ。。
そりゃ、そうだわ、だって、必要なのは誰にでも出来るくらいの金額の
人足なんですから!!
いままで、やってなかっただけで、やればできるんだからね!!

...........


...........



ない、ないわ、それ。。。


低い方から切ります。
そして、高い人に、育てる事も仕事としてお願いします。
数は、いりません。そのかわり、必死で、その人の程度を見極める修行をします。
そこは、誰も教えてくれません。
それが、身につけられなかったら、内製なんてできません。。


そのことが、自分たちは、無能であると、宣言するのと一緒だとしても
現実を受け止めることも出来ないのなら、何かを作ろうなんて資格はないっすよねぇ。。

まだまだあるけど

ちょっと、かわった感じの話を書いてみたので、この辺でおしまい。
また、読みたい人がいたら、考えます。

この話は、結構、考えるネタにはなるとおもうんよ。
でも、まぁ、実行するには、黒魔術がいるけどなぁ。。。

*1:春一番 (キャンディーズの曲) - Wikipedia

*2:必ずしも、これに賛同しているわけではないですの。でも、パターンとしては受け入れないと仕方ない

*3:カムイ外伝 - Wikipedia

*4:金と実力は違うときもあんだろう、とかは、十分承知。

*5:心のこり - Wikipedia

Python Fabric で、自動応答 -- pexpect

結局、Expectになった。

どうやら、Fabricは、プロンプトに対しての自動応答の提供は、やらない方針みたいだ。
まぁ、それが大変だから、こういう仕掛けを作っていると言えば、それもそうだ。


昔は、出来なかったが、今は、ptyへの入力ができるので、expectを使えば
自動応答は、可能だし。


ということで、やってみる。

def python_shell():

    run("python")

こういう、関数を作って、リモートホストに実行する。

MBA:fabric guutara$ fab python_shell
[] Executing task 'python_shell'
[] run: python
[] out: Python 2.7.3 (default, May 16 2012, 14:24:13) 
[] out: [GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
[] out: Type "help", "copyright", "credits" or "license" for more information.
[] out: >>> 

ここで、入力待ちになって止まるので、以下を入力すると、実行が終了する。

[] out: >>> exit()
[] out: 


Done.
Disconnecting from xxxxxxxx@xxxxxxxx.sakura.ne.jp... done.

さて、これを自動応答させてみる。
思いっきりベタですが。。

import pexpect

env.use_ssh_config = True
env.hosts = ['xxxxxxxx']

env.shell = "/usr/local/bin/bash -l -c "

def expect():

    cmd= "fab python_shell"

    child = pexpect.spawn(cmd)
    child.logfile = sys.stdout

    child.expect('>>>*')
    child.sendline('exit()')

  
def python_shell():

    run("python")

で、実行してみる。

MBA:fabric guutara$ fab expect
[] Executing task 'expect'
[] Executing task 'python_shell'
[] run: python
[] out: Python 2.7.3 (default, May 16 2012, 14:24:13) 
[] out: [GCC 4.2.1 20070719  [FreeBSD]] on freebsd7
[] out: Type "help", "copyright", "credits" or "license" for more information.
[] out: >>> exit()

Done.
MBA:fabric guutara$

ということで、出来ました。


これが出来ると、ほぼ、やりたい事はできるな。

Python Fabrik で、試す

もう少し、弄ってみたので、亡備録。

まず、リモートで動かすのは、runとかでやる。

env.use_ssh_config = True
env.hosts = ['xxxxxxxx']


env.shell = "/usr/local/bin/bash -l -c "

def hello():

    run("echo `hostname`")

ssh/config を使う様にしたので、そいつを有効にした。

次に、ローカルで、あれこれやってみる。
丁度、init.elを、gitに上げているので、それを、自動化してみた。

def git_log():
    with lcd("~/git/initel.git"): 
        local("git log")


def git_commit():

    local("cp ~/.emacs.d/init.el ~/git/initel.git/")
    with lcd("~/git/initel.git"):
    # Err があっても、Abortしないようにする
        with settings(warn_only=True):
            result = local("git add . && git commit -m 'commi'") 
            if result.failed and not console.confirm("Tests failed. Continue anyway?"):
                abort("Aborting at user request.")

    git_push()


def git_push():
 
    with lcd("~/git/initel.git"):
        local("git push")
        

commitは、何も、commitするものがないと、エラーになるので
settings(warn_only=True): で、エラーでアボートしないようにして
人が、Y/nを入力する様にしてみた。

最後に、howmの中をを、rsyncしてみた。

def rsync_howm():
    
   project.rsync_project('~/.howm', '~/.howm')

舐めてんのか、くらい、簡単な例ですみません。。

全文を、のっけときます。

# -*- coding: utf-8 -*-

from fabric.api import env,run,local,lcd,settings,abort
from fabric.contrib import console,project

env.use_ssh_config = True
env.hosts = ['xxxxxxxx']


env.shell = "/usr/local/bin/bash -l -c "

def hello():

    run("echo `hostname`")

def local_date():
    local("date")

def git_log():
    with lcd("~/git/initel.git"): 
        local("git log")


def git_commit():

    local("cp ~/.emacs.d/init.el ~/git/initel.git/")
    with lcd("~/git/initel.git"):
    # Err があっても、Abortしないようにする
        with settings(warn_only=True):
            result = local("git add . && git commit -m 'commi'") 
            if result.failed and not console.confirm("Tests failed. Continue anyway?"):
                abort("Aborting at user request.")

    git_push()


def git_push():
 
    with lcd("~/git/initel.git"):
        local("git push")
        

def rsync_howm():
    
   project.rsync_project('~/.howm', '~/.howm')

ちなみに、鍵認証のパスワード無しで、sshは、つないでます。

あと、Pythonは、書いた事無いです。。 (´・ω・`)

Python Fabric を入れてみる。

ちょっと、自動化の下調べに、Fabric を、Mac OSX 10.7.5 にいれてみる。

いまは、homebrew で、構築してあるので、pipで、入れる。

MBA:~ guutara$ pip install Fabric
Downloading/unpacking Fabric
  Downloading Fabric-1.6.0.tar.gz (215kB): 215kB downloaded
  Running setup.py egg_info for package Fabric
    
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
Downloading/unpacking paramiko>=1.10.0 (from Fabric)
  Downloading paramiko-1.10.0.tar.gz (822kB): 822kB downloaded
  Running setup.py egg_info for package paramiko
    
Downloading/unpacking pycrypto>=2.1,!=2.4 (from paramiko>=1.10.0->Fabric)
  Downloading pycrypto-2.6.tar.gz (443kB): 443kB downloaded
  Running setup.py egg_info for package pycrypto
    
Installing collected packages: Fabric, paramiko, pycrypto
  Running setup.py install for Fabric
    
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    Installing fab script to /usr/local/share/python
  Running setup.py install for paramiko
    
  Running setup.py install for pycrypto
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking for __gmpz_init in -lgmp... no
    checking for __gmpz_init in -lmpir... no
    checking whether mpz_powm is declared... no
    checking whether mpz_powm_sec is declared... no
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for inttypes.h... (cached) yes
    checking limits.h usability... yes
    checking limits.h presence... yes
    checking for limits.h... yes
    checking stddef.h usability... yes
    checking stddef.h presence... yes
    checking for stddef.h... yes
    checking for stdint.h... (cached) yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking wchar.h usability... yes
    checking wchar.h presence... yes
    checking for wchar.h... yes
    checking for inline... inline
    checking for int16_t... yes
    checking for int32_t... yes
    checking for int64_t... yes
    checking for int8_t... yes
    checking for size_t... yes
    checking for uint16_t... yes
    checking for uint32_t... yes
    checking for uint64_t... yes
    checking for uint8_t... yes
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... yes
    checking for memmove... yes
    checking for memset... yes
    configure: creating ./config.status
    config.status: creating src/config.h
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Hash._MD2' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.7-x86_64-2.7/src/MD2.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/MD2.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_MD2.so
    building 'Crypto.Hash._MD4' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD4.c -o build/temp.macosx-10.7-x86_64-2.7/src/MD4.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/MD4.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_MD4.so
    building 'Crypto.Hash._SHA256' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/SHA256.c -o build/temp.macosx-10.7-x86_64-2.7/src/SHA256.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/SHA256.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_SHA256.so
    building 'Crypto.Hash._SHA224' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/SHA224.c -o build/temp.macosx-10.7-x86_64-2.7/src/SHA224.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/SHA224.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_SHA224.so
    building 'Crypto.Hash._SHA384' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/SHA384.c -o build/temp.macosx-10.7-x86_64-2.7/src/SHA384.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/SHA384.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_SHA384.so
    building 'Crypto.Hash._SHA512' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/SHA512.c -o build/temp.macosx-10.7-x86_64-2.7/src/SHA512.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/SHA512.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_SHA512.so
    building 'Crypto.Hash._RIPEMD160' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -DPCT_LITTLE_ENDIAN=1 -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/RIPEMD160.c -o build/temp.macosx-10.7-x86_64-2.7/src/RIPEMD160.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/RIPEMD160.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Hash/_RIPEMD160.so
    building 'Crypto.Cipher._AES' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/AES.c -o build/temp.macosx-10.7-x86_64-2.7/src/AES.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/AES.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_AES.so
    building 'Crypto.Cipher._ARC2' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/ARC2.c -o build/temp.macosx-10.7-x86_64-2.7/src/ARC2.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/ARC2.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_ARC2.so
    building 'Crypto.Cipher._Blowfish' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/Blowfish.c -o build/temp.macosx-10.7-x86_64-2.7/src/Blowfish.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/Blowfish.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_Blowfish.so
    building 'Crypto.Cipher._CAST' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/CAST.c -o build/temp.macosx-10.7-x86_64-2.7/src/CAST.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/CAST.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_CAST.so
    building 'Crypto.Cipher._DES' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/DES.c -o build/temp.macosx-10.7-x86_64-2.7/src/DES.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/DES.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_DES.so
    building 'Crypto.Cipher._DES3' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -Isrc/libtom/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/DES3.c -o build/temp.macosx-10.7-x86_64-2.7/src/DES3.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/DES3.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_DES3.so
    building 'Crypto.Cipher._ARC4' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/ARC4.c -o build/temp.macosx-10.7-x86_64-2.7/src/ARC4.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/ARC4.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_ARC4.so
    building 'Crypto.Cipher._XOR' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/XOR.c -o build/temp.macosx-10.7-x86_64-2.7/src/XOR.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/XOR.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Cipher/_XOR.so
    building 'Crypto.Util.strxor' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/strxor.c -o build/temp.macosx-10.7-x86_64-2.7/src/strxor.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/strxor.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Util/strxor.so
    building 'Crypto.Util._counter' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_counter.c -o build/temp.macosx-10.7-x86_64-2.7/src/_counter.o
    cc -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.7-x86_64-2.7/src/_counter.o -o build/lib.macosx-10.7-x86_64-2.7/Crypto/Util/_counter.so
    
Successfully installed Fabric paramiko pycrypto
Cleaning up...

MBA:~ guutara$ fab

Fatal error: Couldn't find any fabfiles!

Remember that -f can be used to specify fabfile path, and use -h for help.

Aborting.

MBA:~ guutara$ which fab
/usr/local/share/python/fab
MBA-20120331:~ guutara$ ls /usr/local/share/
aclocal	doc	gnupg	locale	man	python
MBA-20120331:~ guutara$ ls /usr/local/share/python/
Extras/                rst2latex.py           rst2pseudoxml.py       rstpep2html.py         sphinx-quickstart
fab                    rst2man.py             rst2s5.py              sphinx-apidoc          
pygmentize             rst2odt.py             rst2xetex.py           sphinx-autogen         
rst2html.py            rst2odt_prepstyles.py  rst2xml.py             sphinx-build           
MBA:~ guutara$ ls -al /usr/local/share/python/fab 
-rwxr-xr-x  1 guutara  admin  389  3 13 15:01 /usr/local/share/python/fab
MBA:~ guutara$ 

/usr/local/share/python/ 配下に、インストールされてる。
そういえば、sphinx も、そうだったっけ。

fabric.py を、とりあえず、書いて実行してみた。
bsd系につないだので、env.shell を書き直した。。

from fabric.api import env,run

env.hosts = ['xxxxxx.sakura.ne.jp']
env.user = "xxxxxx"
env.password = "yyyyyyyy"
env.shell = "/usr/local/bin/bash -l -c "

def hello():
    run("echo `hostname`")

実行結果

MBA-20120331:fabric guutara$ fab hello
[xxxxxx.sakura.ne.jp] Executing task 'hello'
[xxxxxx.sakura.ne.jp] run: echo `hostname`
[xxxxxx.sakura.ne.jp] out: zzzz.sakura.ne.jp
[xxxxxx.sakura.ne.jp] out: 


Done.
Disconnecting from xxxxxx.sakura.ne.jp... done.

簡単だ。。
昔のオートパイロットみたいだなぁ。。

俺は伊達や酔狂で内製やってるんだ!

少しは、経験があるので、未来の自分宛に、書いてみよう。
あんまり、真面目に書いても仕方ないから、本音と限りなくざっくばらんに。

モチーフに、銀河英雄伝説をもってきてみよう。

なんで、そんな事を


ダスティ・アッテンボロー

「俺たちは伊達や酔狂で戦争やってるんだ!」


もともと、不器用なくせに*1
何かを作る事を仕事にしたいと思っているのと、
人にやってもらうにしても、自分で理解出来ないと嫌な性分だからか、
丸投げ、は、どうしても好きになれない。


結局、もったいぶった理由をつけても無駄で、そんな嗜好の話に辿り着く気がする。


まぁ、どんなに信用していても、間違えない人間はいないし、
戦争が正義から行われるように、
結果としての嘘も、善意からの事の方が多いし、
影響も重大だったりする。


だから、せめて、転んだ事と、起き上がる事くらいは、自分の認識で、
行いたい者だと、そんな想いもあるや、なしや。。


何かの為でなく、やりたい事に理由をつけた方が、結局、やりやすい。

「俺は伊達や酔狂で内製やってるんだ!」 (*´∀`*)

嘆く前に、理を知る事が大切だよ


ヤン・ウェンリー
「戦術は戦略に従属し、戦略は政治に、政治は経済に従属するというわけさ。」


情勢は、厳しい。
内製を継続する事は、困難な事ばかり。。


直接、商品となり、セールスに結びつく、虚業 ^h^h 金融、ゲームとちがい
社内の情報処理システムは、基本的に、投資は下方硬直している。
予算は、下がり続ける事のみが、経済合理性を、もってしまうかのごとしだ!


そんな中で、
「内製化する事で、コストを抑えられます」
とか言ってしまうと、地獄への坂道を転がり落ちる事になる。


簡単に、考えてみよう。
100人の協力会社で、やっていた事を、50人のプロパで対応出来る様にしたとして、
それは、すばらしいのだけれども、


「で、翌年は?」
「......」


この論理で闘うと、最後は、蛸の身食いになるしかないやね。


では、どうするか。。
最終目標は、「利益をあげる」ところへ、置いておかなければならない。
そう、直接の利益を上げる、あるいは、反則品 ^h^h^h 販促品となること。


そこから、戦略をたて、戦術に落とすのが戦線を維持する、自分が見つけた手段。


ただ、戦局は大切。


いずれにしろ、「事業環境が激しく変化しつづける」という状況がなければ
内製化の継続は、成り立たない。
そして、それが、わかれば、多分、戦線を維持し続ける事が可能だし、
新しい、日本での情報処理のエンジニアが生息出来る戦闘域を、展開出来るかも。。


ここで、大事なのは、
経済的な合理性と、事業環境の状況に合わせて、

  • 自分のやりたい方向へ、いかに、正当性をもって、ドライブするか?
  • それを認めさせる為の、アウトプットを作り出すか?

が、大切だって事。

なんだか、書くのが面倒になって来た


うーん、結構、色々、書かないといけないのが分かって、面倒なので、このへんで今はやめとく。


ともかく、前項で書いた様に、コスト削減で、はじめなければ、失敗してもリスタート可能。


他にも、色々、あるけど、読みたい人がいるようなら、また、考えようっと。。




最後に、敵は多いだろうし、身内に後ろからも撃たれる。
そんな時には、いつも、こうやって切り抜けるのであります。

ダスティ・アッテンボロー
「この世で一番、強い台詞ってやつを教えてやろうか?
どんな正論も雄弁も、この一言にはかなわない!


それがどうした!」


そのくらいの、いい加減さが無いと、やってられない。w

*1:おかげで、いまだに、電化製品は苦手

アップルを創った怪物―もうひとりの創業者、ウォズニアック自伝


とある、イベントでサインがもらえるかもしれない、とかいう、不純な動機もあってよんでみました。


感想は、とっても、面白かったですねぇ。


全体の雰囲気からすると、「ハッカーズ 」や「超マシン誕生 」のような本です。
ただ、自伝という事と、インタビューを書起したという点から、Wazの人柄に
色々な歴史が包まれて語られています。
きっと、原書を読めるなら、そっちの方がもっと、フィーリングは掴めるんでしょうねぇ。。


歴史的に何が、正しいかとか、そんな事はおいて、Wazが、なんと言っていて
どう考えているかって事を聞く方が、気持ちがいいな、と、思える本でした。


考えるヒントも、沢山、ちりばめられていると思います。


なにより、楽しく読めた、久しぶりの本でした。


これは、前半の半分くらいは、面白かったです。


こっちは、全部、面白かったです。