{"id":863,"date":"2010-11-28T14:18:12","date_gmt":"2010-11-28T05:18:12","guid":{"rendered":"http:\/\/peta.okechan.net\/blog\/?p=863"},"modified":"2010-11-28T14:20:06","modified_gmt":"2010-11-28T05:20:06","slug":"fabric%e3%81%a7%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%ae%e5%88%9d%e6%9c%9f%e8%a8%ad%e5%ae%9a%e3%82%92%e8%87%aa%e5%8b%95%e5%8c%96%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/863","title":{"rendered":"Fabric\u3067\u30b5\u30fc\u30d0\u30fc\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u81ea\u52d5\u5316\u3059\u308b"},"content":{"rendered":"<p><a href=\"http:\/\/docs.fabfile.org\/0.9.3\/\" target=\"_blank\">Fabric<\/a>\u3068\u3044\u3046\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30d7\u30ed\u30a4\u4f5c\u696d\u3084\u7ba1\u7406\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\uff08Python\u30e2\u30b8\u30e5\u30fc\u30eb\u542b\u3080\uff09\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30d7\u30ed\u30a4\u4f5c\u696d\u3084\u7ba1\u7406\u4f5c\u696d\u306e\u81ea\u52d5\u5316\u306e\u70ba\u306e\u30c4\u30fc\u30eb\u3068\u805e\u304f\u3068\u3001\u8a33\u306e\u5206\u304b\u3089\u3093DSL\u899a\u3048\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u306e\u304b\u3060\u308b\u3044\u306a\u3041\u3068\u304b\u3001\u8b0e\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306b\u5408\u308f\u305b\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u306e\u304b\u3081\u3093\u3069\u304f\u305b\u3068\u304b\u601d\u3063\u3066\u3057\u307e\u3046\u30bf\u30a4\u30d7\u3060\u3063\u305f\u3093\u3067\u3059\u304c\u3001Fabric\u306fPython\u3067\u66f8\u3051\u307e\u3059\u3002\u4ed5\u7d44\u307f\u3082\uff08\u6982\u5ff5\u7684\u306b\u306f\u3067\u3042\u308a\u307e\u3059\u304c\uff09\u5358\u7d14\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u304b\u3089\u30ea\u30e2\u30fc\u30c8\u3078SSH\u3067\u63a5\u7d9a\u3057\u3066\u884c\u3048\u308b\u4f5c\u696d\u3060\u3063\u305f\u3089\u57fa\u672c\u7684\u306b\u4f55\u3067\u3082\u81ea\u52d5\u5316\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u3067\u3001\u30ea\u30e2\u30fc\u30c8\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u8907\u6570\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u3068\u3001\u81ea\u52d5\u5316\u3057\u305f\u4f5c\u696d\u3092\uff11\u3064\u305a\u3064\u5168\u90e8\u306b\u9069\u7528\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u306e\u4e0b\u306bWeb\u30b5\u30fc\u30d0\u30fc\u304c\u8907\u6570\u3042\u3063\u3066\u3001\u305d\u308c\u3089\u306b\u81ea\u52d5\u7684\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u914d\u7f6e\u30fb\u518d\u914d\u7f6e\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u3063\u3066\u306e\u304c\u3088\u304f\u3042\u308b\u30d1\u30bf\u30fc\u30f3\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u8907\u6570\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u540c\u3058\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3046\u3068\u3044\u3046\u60f3\u5b9a\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n1\u53f0\u3060\u3051\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u5f8c\u306f\u305d\u306e\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092\u30b3\u30d4\u30fc\u3068\u304b\u3057\u305f\u307b\u3046\u304c\u697d\u3060\u3063\u305f\u308a\u3059\u308b\u3093\u3067\u3059\u304c\u3001\u305d\u308c\u304c\u51fa\u6765\u306a\u304b\u3063\u305f\u308a\u96e3\u3057\u304b\u3063\u305f\u308a\u9762\u5012\u3060\u3063\u305f\u308a\u3059\u308b\u5834\u5408\u3082\u3042\u308b\u305f\u3081\u3001\u3053\u306e\u60f3\u5b9a\u3082\u7121\u99c4\u3067\u306f\u306a\u3044\u304b\u306a\u306a\u3093\u3066\u3002<\/p>\n<p>\u74b0\u5883\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3002<br \/>\n\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\uff08Fabric\u3092\u52d5\u304b\u3059\u30de\u30b7\u30f3\uff09 Mac<br \/>\n\u30b5\u30fc\u30d0\u30fc1\uff08ip:192.168.1.21\uff09 CentOS5<br \/>\n\u30b5\u30fc\u30d0\u30fc2\uff08ip:192.168.1.22\uff09 CentOS5<br \/>\n\u30b5\u30fc\u30d0\u30fc3\uff08ip:192.168.1.23\uff09 CentOS5<br \/>\n\u3042\u3089\u304b\u3058\u3081\u30b5\u30fc\u30d0\u30fc\u306f\u3059\u3079\u3066\u4f5c\u696d\u7528\u30e6\u30fc\u30b6\u30fctestuser\u3067\u9375\u8a8d\u8a3c\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u4f5c\u696d\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u6e08\u307f\u3002<br \/>\n\uff08\u30b5\u30fc\u30d0\u30fc\u306fUbuntu\u30de\u30b7\u30f3\u4e0a\u306eKVM\u3067\u52d5\u304b\u3057\u307e\u3057\u305f\u3002\uff09<\/p>\n<p>\u307e\u305a\u3001\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u306bFabric\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\neasy_install fabric\r\n<\/pre>\n<p>\u3053\u306e3\u53f0\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u81ea\u52d5\u3067\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<br \/>\n\u30fb\u5fc5\u8981\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u30fbPython2.7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069<br \/>\n\u30fbmecab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069<br \/>\n\u30fb\u7c21\u5358\u306a\u52d5\u4f5c\u78ba\u8a8d<\/p>\n<p>\u4ee5\u4e0b\u3092fabfile.py\u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# -*- coding: utf-8 -*-\r\n\r\nimport os.path\r\nfrom fabric.api import run, sudo, settings, abort, put, cd, env\r\nfrom fabric.contrib.console import confirm\r\nfrom fabric.decorators import runs_once\r\n\r\n# \u30b5\u30fc\u30d0\u30fc\u60c5\u5831\r\nenv.hosts = &#x5B;'192.168.1.21', '192.168.1.22', '192.168.1.23']\r\nenv.user = 'testuser'\r\nenv.password = 'test'\r\nenv.key_filename = &#x5B;os.path.expanduser('~\/.ssh\/secret_key')]\r\n\r\ndef setup():\r\n\t'''\r\n\t\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\r\n\t'''\r\n\tprepare_setup()\r\n\tinstall_packages()\r\n\tinstall_python27()\r\n\tinstall_setuptools()\r\n\teasy_install()\r\n\tinstall_mecab()\r\n\tinstall_mecab_python()\r\n\r\ndef install_packages():\r\n\t'''\r\n\t\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\tsudo('yum -y install '\r\n\t\t'gcc gcc-c++ zlib-devel '\r\n\t\t'tcl-devel tk-devel readline-devel sqlite-devel '\r\n\t\t'dbm-devel db4-devel gdbm-devel ncurses-devel '\r\n\t\t'bzip2-devel openssl-devel pcre pcre-devel '\r\n\t\t'mysql-server mysql-devel screen ',\r\n\tpty=True)\r\n\r\ndef install_python27():\r\n\t'''\r\n\tpython2.7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/bin\/python2.7')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/www.python.org\/ftp\/python\/2.7\/Python-2.7.tgz')\r\n\t\t\trun('tar zxvf Python-2.7.tgz')\r\n\t\t\twith cd('.\/Python-2.7'):\r\n\t\t\t\trun('.\/configure --prefix=\/usr\/local\/python --enable-shared')\r\n\t\t\t\trun('make')\r\n\t\t\t\tsudo('make install', pty=True)\r\n\t\t\t\tsudo('cp libpython2.7.so.1.0 \/usr\/lib\/', pty=True)\r\n\t\t\t\tsudo('cp libpython2.7.so \/usr\/lib\/', pty=True)\r\n\t\t\t\tsudo('\/sbin\/ldconfig', pty=True)\r\n\t\t\t\tsudo('ln -s \/usr\/local\/python\/bin\/python \/usr\/bin\/python2.7', pty=True)\r\n\r\ndef install_setuptools():\r\n\t'''\r\n\tsetuptools\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/bin\/easy_install2.7')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/pypi.python.org\/packages\/2.7\/s\/setuptools\/setuptools-0.6c11-py2.7.egg')\r\n\t\t\tsudo('sh setuptools-0.6c11-py2.7.egg', pty=True)\r\n\t\t\tsudo('ln -s \/usr\/local\/python\/bin\/easy_install \/usr\/bin\/easy_install2.7', pty=True)\r\n\r\ndef easy_install():\r\n\t'''\r\n\t\u5fc5\u8981\u306apython\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\tsudo('easy_install2.7 tornado httplib2 python-dateutil MySQL-python', pty=True)\r\n\r\ndef install_mecab():\r\n\t'''\r\n\tmecab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/local\/bin\/mecab')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/sourceforge.net\/projects\/mecab\/files\/mecab\/0.98\/mecab-0.98.tar.gz\/download')\r\n\t\t\trun('tar zxvf mecab-0.98.tar.gz')\r\n\t\t\twith cd('.\/mecab-0.98'):\r\n\t\t\t\trun('.\/configure --enable-utf8-only')\r\n\t\t\t\trun('make')\r\n\t\t\t\tsudo('make install', pty=True)\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/local\/lib\/mecab\/dic\/naist-jdic')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/jaist.dl.sourceforge.jp\/naist-jdic\/48487\/mecab-naist-jdic-0.6.3-20100801.tar.gz')\r\n\t\t\trun('tar zxvf mecab-naist-jdic-0.6.3-20100801.tar.gz')\r\n\t\t\twith cd('mecab-naist-jdic-0.6.3-20100801'):\r\n\t\t\t\trun('.\/configure --with-charset=utf8')\r\n\t\t\t\trun('make')\r\n\t\t\t\tsudo('make install', pty=True)\r\n\t\t\tsudo(r&quot;sed 's\/^dicdir = .*$\/dicdir = \\\/usr\\\/local\\\/lib\\\/mecab\\\/dic\\\/naist-jdic\/' \/usr\/local\/etc\/mecabrc | tee \/usr\/local\/etc\/mecabrc&quot;, pty=True)\r\n\r\ndef install_mecab_python():\r\n\t'''\r\n\tmecab-python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run(&quot;python2.7 -c 'import MeCab'&quot;)\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/jaist.dl.sourceforge.net\/project\/mecab\/mecab-python\/0.98\/mecab-python-0.98.tar.gz')\r\n\t\t\trun('tar zxvf mecab-python-0.98.tar.gz')\r\n\t\t\twith cd('.\/mecab-python-0.98'):\r\n\t\t\t\trun('python2.7 setup.py build')\r\n\t\t\t\tsudo('export PATH=$PATH:\/usr\/local\/bin; python2.7 setup.py install', pty=True)\r\n\t\t\tsudo(&quot;echo '\/usr\/local\/lib' &gt;&gt; \/etc\/ld.so.conf&quot;, pty=True)\r\n\t\t\tsudo('\/sbin\/ldconfig', pty=True)\r\n\r\ndef test():\r\n\t'''\r\n\tsetup\u304c\u3046\u307e\u304f\u884c\u3063\u3066\u308b\u304b\u30c6\u30b9\u30c8\r\n\t'''\r\n\tprepare_test()\r\n\tput('.\/testscript.py', '\/tmp')\r\n\trun('python2.7 \/tmp\/testscript.py')\r\n\r\n@runs_once\r\ndef prepare_setup():\r\n\t'''\r\n\t\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u524d\u306e\u30ed\u30fc\u30ab\u30eb\u5074\u3067\u306e\u6e96\u5099\r\n\t'''\r\n\tpass\r\n\r\n@runs_once\r\ndef prepare_test():\r\n\t'''\r\n\t\u30c6\u30b9\u30c8\u524d\u306e\u30ed\u30fc\u30ab\u30eb\u5074\u3067\u306e\u6e96\u5099\r\n\t'''\r\n\tscript = '''# -*- coding: utf-8 -*-\r\nimport MeCab\r\nm = MeCab.Tagger()\r\nprint m.parse('\u672c\u65e5\u306f\u6674\u5929\u306a\u308a')\r\n\t'''\r\n\twith open('.\/testscript.py', 'wb') as f:\r\n\t\tf.write(script)\r\n<\/pre>\n<p>\u3053\u308c\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3072\u3068\u901a\u308a\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u7c21\u6613\u7684\u306a\u30c6\u30b9\u30c8\u304c\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nfab setup test\r\n<\/pre>\n<p>\u7c21\u5358\u3067\u3059\u306d\uff01<\/p>\n<p>\u65e5\u5e38\u7684\u306b\u30ea\u30e2\u30fc\u30c8\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3066\u30b3\u30de\u30f3\u30c9\u6253\u3063\u3066\u308b\u4eba\u3060\u3063\u305f\u3089\u3001Python\u3082Fabric\u3082\u77e5\u3089\u306a\u304f\u3066\u3082\u3084\u3063\u3066\u308b\u3053\u3068\u306f\u5206\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u4e00\u90e8\u5206\u304b\u308a\u3065\u3089\u3044\u3068\u601d\u308f\u308c\u308b\u70b9\u3060\u3051\u3061\u3087\u3063\u3068\u8aac\u660e\u3059\u308b\u3068\u3001<\/p>\n<p>\u30fbsudo\u95a2\u6570\u306e\u5f15\u6570pty=True\u306fTTY\u7d4c\u7531\u3067\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u4ed8\u3051\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b3\u30ec\u3092\u4ed8\u3051\u306a\u3044\u3068\u6700\u8fd1\u306eCentOS\u3068\u304b\u3067\u306f\u300csudo: sorry, you must have a tty to run sudo\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nTTY\u7d4c\u7531\u4ee5\u5916\u3067sudo\u3092\u4f7f\u3046\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u3092\u30aa\u30a6\u30e0\u8fd4\u3057\u3057\u3066\u3057\u307e\u3063\u3066\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u30a2\u30ec\u306a\u306e\u3067\u6700\u8fd1\u306f\u30c7\u30d5\u30a9\u3067TTY\u7d4c\u7531\u4ee5\u5916\u306f\u901a\u3055\u306a\u3044\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u308b\u3089\u3059\u3043\u3002<\/p>\n<p>\u30fbcd\u95a2\u6570\u306f\u30ea\u30e2\u30fc\u30c8\u3067change directory\u3059\u308b\u3063\u3066\u4e8b\u3067\u3059\u304c\u3001with\u3092\u4ed8\u3051\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u30d6\u30ed\u30c3\u30af\u3092\u629c\u3051\u308b\u3068\u304d\u306bcurrent directory\u3092\u5143\u306b\u623b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u30fbFabric\u306f\u30b3\u30de\u30f3\u30c9\u304c\u5931\u6557\u3059\u308b\u3068\u305d\u3053\u3067Abort\u3057\u3066\u6b62\u307e\u3063\u3066\u3057\u307e\u3046\u3093\u3067\u3059\u304c\u3001<br \/>\nwith settings(warn_only=True): \u306e\u30d6\u30ed\u30c3\u30af\u3067\u306f\u8b66\u544a\u3092\u51fa\u3059\u3060\u3051\u3067Abort\u3057\u306a\u3044\u3088\u3046\u306b\u3067\u304d\u307e\u3059\u3002<br \/>\n\u5931\u6557\u3057\u3066\u3082\u5168\u4f53\u306b\u306f\u5f71\u97ff\u306e\u306a\u3044\u30b3\u30de\u30f3\u30c9\u3084\u3001\u6210\u529f\u5931\u6557\u3067\u5206\u5c90\u3057\u305f\u3044\u3068\u304d\u306b\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>\u30fb@runs_once\u30c7\u30b3\u30ec\u30fc\u30bf\u3092\u4ed8\u3051\u305f\u95a2\u6570\u306f\u5b9f\u884c\u30921\u56de\u3060\u3051\u306b\u9650\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4ed6\u306e\u95a2\u6570\u306fenv.hosts\u306b\u8a2d\u5b9a\u3055\u308c\u305f\u30b5\u30fc\u30d0\u30fc\u306e\u6570\u3060\u3051\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u306f\u307e\u3060\u521d\u6b69\u7684\u306a\u4f7f\u3044\u65b9\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u50d5\u81ea\u8eab\u4eca\u65e5\u4f7f\u3044\u59cb\u3081\u305f\u3070\u304b\u308a\u3067\u3059\u3002<br \/>\n\u30b5\u30fc\u30d0\u30fc\u6bce\u306b\u51e6\u7406\u5185\u5bb9\u3092\u5909\u3048\u305f\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u5f79\u5272\u3092\u8a2d\u5b9a\u3057\u3066\u5f79\u5272\u6bce\u306b\u51e6\u7406\u5185\u5bb9\u3092\u5909\u3048\u305f\u308a\u306a\u3069\u3082\u51fa\u6765\u308b\u305d\u3046\u3067\u3059\u3002<br \/>\n\u3068\u3044\u3046\u304bPython\u30b9\u30af\u30ea\u30d7\u30c8\u305d\u306e\u3082\u306e\u306a\u306e\u3067\u3084\u308d\u3046\u3068\u601d\u3048\u3070\u4f55\u3067\u3082\u51fa\u6765\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p><a href=\"http:\/\/docs.fabfile.org\/0.9.3\/\" target=\"_blank\">Fabric<\/a>\u3068\u3044\u3046\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30d7\u30ed\u30a4\u4f5c\u696d\u3084\u7ba1\u7406\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\uff08Python\u30e2\u30b8\u30e5\u30fc\u30eb\u542b\u3080\uff09\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c7\u30d7\u30ed\u30a4\u4f5c\u696d\u3084\u7ba1\u7406\u4f5c\u696d\u306e\u81ea\u52d5\u5316\u306e\u70ba\u306e\u30c4\u30fc\u30eb\u3068\u805e\u304f\u3068\u3001\u8a33\u306e\u5206\u304b\u3089\u3093DSL\u899a\u3048\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u306e\u304b\u3060\u308b\u3044\u306a\u3041\u3068\u304b\u3001\u8b0e\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306b\u5408\u308f\u305b\u306a\u304d\u3083\u3044\u3051\u306a\u3044\u306e\u304b\u3081\u3093\u3069\u304f\u305b\u3068\u304b\u601d\u3063\u3066\u3057\u307e\u3046\u30bf\u30a4\u30d7\u3060\u3063\u305f\u3093\u3067\u3059\u304c\u3001Fabric\u306fPython\u3067\u66f8\u3051\u307e\u3059\u3002\u4ed5\u7d44\u307f\u3082\uff08\u6982\u5ff5\u7684\u306b\u306f\u3067\u3042\u308a\u307e\u3059\u304c\uff09\u5358\u7d14\u3067\u3059\u3002<\/p>\n<p>\u30ed\u30fc\u30ab\u30eb\u304b\u3089\u30ea\u30e2\u30fc\u30c8\u3078SSH\u3067\u63a5\u7d9a\u3057\u3066\u884c\u3048\u308b\u4f5c\u696d\u3060\u3063\u305f\u3089\u57fa\u672c\u7684\u306b\u4f55\u3067\u3082\u81ea\u52d5\u5316\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u3067\u3001\u30ea\u30e2\u30fc\u30c8\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u8907\u6570\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u3068\u3001\u81ea\u52d5\u5316\u3057\u305f\u4f5c\u696d\u3092\uff11\u3064\u305a\u3064\u5168\u90e8\u306b\u9069\u7528\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc\u306e\u4e0b\u306bWeb\u30b5\u30fc\u30d0\u30fc\u304c\u8907\u6570\u3042\u3063\u3066\u3001\u305d\u308c\u3089\u306b\u81ea\u52d5\u7684\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u914d\u7f6e\u30fb\u518d\u914d\u7f6e\u3059\u308b\u305f\u3081\u306b\u4f7f\u3046\u3063\u3066\u306e\u304c\u3088\u304f\u3042\u308b\u30d1\u30bf\u30fc\u30f3\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001\u8907\u6570\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u540c\u3058\u521d\u671f\u8a2d\u5b9a\u3092\u884c\u3046\u3068\u3044\u3046\u60f3\u5b9a\u3067\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n1\u53f0\u3060\u3051\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u5f8c\u306f\u305d\u306e\u30c7\u30a3\u30b9\u30af\u30a4\u30e1\u30fc\u30b8\u3092\u30b3\u30d4\u30fc\u3068\u304b\u3057\u305f\u307b\u3046\u304c\u697d\u3060\u3063\u305f\u308a\u3059\u308b\u3093\u3067\u3059\u304c\u3001\u305d\u308c\u304c\u51fa\u6765\u306a\u304b\u3063\u305f\u308a\u96e3\u3057\u304b\u3063\u305f\u308a\u9762\u5012\u3060\u3063\u305f\u308a\u3059\u308b\u5834\u5408\u3082\u3042\u308b\u305f\u3081\u3001\u3053\u306e\u60f3\u5b9a\u3082\u7121\u99c4\u3067\u306f\u306a\u3044\u304b\u306a\u306a\u3093\u3066\u3002<\/p>\n<p>\u74b0\u5883\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3002<br \/>\n\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\uff08Fabric\u3092\u52d5\u304b\u3059\u30de\u30b7\u30f3\uff09 Mac<br \/>\n\u30b5\u30fc\u30d0\u30fc1\uff08ip:192.168.1.21\uff09 CentOS5<br \/>\n\u30b5\u30fc\u30d0\u30fc2\uff08ip:192.168.1.22\uff09 CentOS5<br \/>\n\u30b5\u30fc\u30d0\u30fc3\uff08ip:192.168.1.23\uff09 CentOS5<br \/>\n\u3042\u3089\u304b\u3058\u3081\u30b5\u30fc\u30d0\u30fc\u306f\u3059\u3079\u3066\u4f5c\u696d\u7528\u30e6\u30fc\u30b6\u30fctestuser\u3067\u9375\u8a8d\u8a3c\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u4f5c\u696d\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u6e08\u307f\u3002<br \/>\n\uff08\u30b5\u30fc\u30d0\u30fc\u306fUbuntu\u30de\u30b7\u30f3\u4e0a\u306eKVM\u3067\u52d5\u304b\u3057\u307e\u3057\u305f\u3002\uff09<\/p>\n<p>\u307e\u305a\u3001\u30ed\u30fc\u30ab\u30eb\u30de\u30b7\u30f3\u306bFabric\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\neasy_install fabric\r\n<\/pre>\n<p>\u3053\u306e3\u53f0\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u81ea\u52d5\u3067\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u307e\u3059\u3002<br \/>\n\u30fb\u5fc5\u8981\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n\u30fbPython2.7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069<br \/>\n\u30fbmecab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306a\u3069<br \/>\n\u30fb\u7c21\u5358\u306a\u52d5\u4f5c\u78ba\u8a8d<\/p>\n<p>\u4ee5\u4e0b\u3092fabfile.py\u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# -*- coding: utf-8 -*-\r\n\r\nimport os.path\r\nfrom fabric.api import run, sudo, settings, abort, put, cd, env\r\nfrom fabric.contrib.console import confirm\r\nfrom fabric.decorators import runs_once\r\n\r\n# \u30b5\u30fc\u30d0\u30fc\u60c5\u5831\r\nenv.hosts = &#x5B;'192.168.1.21', '192.168.1.22', '192.168.1.23']\r\nenv.user = 'testuser'\r\nenv.password = 'test'\r\nenv.key_filename = &#x5B;os.path.expanduser('~\/.ssh\/secret_key')]\r\n\r\ndef setup():\r\n\t'''\r\n\t\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\r\n\t'''\r\n\tprepare_setup()\r\n\tinstall_packages()\r\n\tinstall_python27()\r\n\tinstall_setuptools()\r\n\teasy_install()\r\n\tinstall_mecab()\r\n\tinstall_mecab_python()\r\n\r\ndef install_packages():\r\n\t'''\r\n\t\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\tsudo('yum -y install '\r\n\t\t'gcc gcc-c++ zlib-devel '\r\n\t\t'tcl-devel tk-devel readline-devel sqlite-devel '\r\n\t\t'dbm-devel db4-devel gdbm-devel ncurses-devel '\r\n\t\t'bzip2-devel openssl-devel pcre pcre-devel '\r\n\t\t'mysql-server mysql-devel screen ',\r\n\tpty=True)\r\n\r\ndef install_python27():\r\n\t'''\r\n\tpython2.7\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/bin\/python2.7')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/www.python.org\/ftp\/python\/2.7\/Python-2.7.tgz')\r\n\t\t\trun('tar zxvf Python-2.7.tgz')\r\n\t\t\twith cd('.\/Python-2.7'):\r\n\t\t\t\trun('.\/configure --prefix=\/usr\/local\/python --enable-shared')\r\n\t\t\t\trun('make')\r\n\t\t\t\tsudo('make install', pty=True)\r\n\t\t\t\tsudo('cp libpython2.7.so.1.0 \/usr\/lib\/', pty=True)\r\n\t\t\t\tsudo('cp libpython2.7.so \/usr\/lib\/', pty=True)\r\n\t\t\t\tsudo('\/sbin\/ldconfig', pty=True)\r\n\t\t\t\tsudo('ln -s \/usr\/local\/python\/bin\/python \/usr\/bin\/python2.7', pty=True)\r\n\r\ndef install_setuptools():\r\n\t'''\r\n\tsetuptools\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/bin\/easy_install2.7')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/pypi.python.org\/packages\/2.7\/s\/setuptools\/setuptools-0.6c11-py2.7.egg')\r\n\t\t\tsudo('sh setuptools-0.6c11-py2.7.egg', pty=True)\r\n\t\t\tsudo('ln -s \/usr\/local\/python\/bin\/easy_install \/usr\/bin\/easy_install2.7', pty=True)\r\n\r\ndef easy_install():\r\n\t'''\r\n\t\u5fc5\u8981\u306apython\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\tsudo('easy_install2.7 tornado httplib2 python-dateutil MySQL-python', pty=True)\r\n\r\ndef install_mecab():\r\n\t'''\r\n\tmecab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/local\/bin\/mecab')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/sourceforge.net\/projects\/mecab\/files\/mecab\/0.98\/mecab-0.98.tar.gz\/download')\r\n\t\t\trun('tar zxvf mecab-0.98.tar.gz')\r\n\t\t\twith cd('.\/mecab-0.98'):\r\n\t\t\t\trun('.\/configure --enable-utf8-only')\r\n\t\t\t\trun('make')\r\n\t\t\t\tsudo('make install', pty=True)\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run('ls \/usr\/local\/lib\/mecab\/dic\/naist-jdic')\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/jaist.dl.sourceforge.jp\/naist-jdic\/48487\/mecab-naist-jdic-0.6.3-20100801.tar.gz')\r\n\t\t\trun('tar zxvf mecab-naist-jdic-0.6.3-20100801.tar.gz')\r\n\t\t\twith cd('mecab-naist-jdic-0.6.3-20100801'):\r\n\t\t\t\trun('.\/configure --with-charset=utf8')\r\n\t\t\t\trun('make')\r\n\t\t\t\tsudo('make install', pty=True)\r\n\t\t\tsudo(r&quot;sed 's\/^dicdir = .*$\/dicdir = \\\/usr\\\/local\\\/lib\\\/mecab\\\/dic\\\/naist-jdic\/' \/usr\/local\/etc\/mecabrc | tee \/usr\/local\/etc\/mecabrc&quot;, pty=True)\r\n\r\ndef install_mecab_python():\r\n\t'''\r\n\tmecab-python\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\t'''\r\n\twith cd('~\/'):\r\n\t\twith settings(warn_only=True):\r\n\t\t\tresult = run(&quot;python2.7 -c 'import MeCab'&quot;)\r\n\t\tif not result.succeeded:\r\n\t\t\trun('wget http:\/\/jaist.dl.sourceforge.net\/project\/mecab\/mecab-python\/0.98\/mecab-python-0.98.tar.gz')\r\n\t\t\trun('tar zxvf mecab-python-0.98.tar.gz')\r\n\t\t\twith cd('.\/mecab-python-0.98'):\r\n\t\t\t\trun('python2.7 setup.py build')\r\n\t\t\t\tsudo('export PATH=$PATH:\/usr\/local\/bin; python2.7 setup.py install', pty=True)\r\n\t\t\tsudo(&quot;echo '\/usr\/local\/lib' &gt;&gt; \/etc\/ld.so.conf&quot;, pty=True)\r\n\t\t\tsudo('\/sbin\/ldconfig', pty=True)\r\n\r\ndef test():\r\n\t'''\r\n\tsetup\u304c\u3046\u307e\u304f\u884c\u3063\u3066\u308b\u304b\u30c6\u30b9\u30c8\r\n\t'''\r\n\tprepare_test()\r\n\tput('.\/testscript.py', '\/tmp')\r\n\trun('python2.7 \/tmp\/testscript.py')\r\n\r\n@runs_once\r\ndef prepare_setup():\r\n\t'''\r\n\t\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u524d\u306e\u30ed\u30fc\u30ab\u30eb\u5074\u3067\u306e\u6e96\u5099\r\n\t'''\r\n\tpass\r\n\r\n@runs_once\r\ndef prepare_test():\r\n\t'''\r\n\t\u30c6\u30b9\u30c8\u524d\u306e\u30ed\u30fc\u30ab\u30eb\u5074\u3067\u306e\u6e96\u5099\r\n\t'''\r\n\tscript = '''# -*- coding: utf-8 -*-\r\nimport MeCab\r\nm = MeCab.Tagger()\r\nprint m.parse('\u672c\u65e5\u306f\u6674\u5929\u306a\u308a')\r\n\t'''\r\n\twith open('.\/testscript.py', 'wb') as f:\r\n\t\tf.write(script)\r\n<\/pre>\n<p>\u3053\u308c\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3072\u3068\u901a\u308a\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u7c21\u6613\u7684\u306a\u30c6\u30b9\u30c8\u304c\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nfab setup test\r\n<\/pre>\n<p>\u7c21\u5358\u3067\u3059\u306d\uff01<\/p>\n<p>\u65e5\u5e38\u7684\u306b\u30ea\u30e2\u30fc\u30c8\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3057\u3066\u30b3\u30de\u30f3\u30c9\u6253\u3063\u3066\u308b\u4eba\u3060\u3063\u305f\u3089\u3001Python\u3082Fabric\u3082\u77e5\u3089\u306a\u304f\u3066\u3082\u3084\u3063\u3066\u308b\u3053\u3068\u306f\u5206\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u4e00\u90e8\u5206\u304b\u308a\u3065\u3089\u3044\u3068\u601d\u308f\u308c\u308b\u70b9\u3060\u3051\u3061\u3087\u3063\u3068\u8aac\u660e\u3059\u308b\u3068\u3001<\/p>\n<p>\u30fbsudo\u95a2\u6570\u306e\u5f15\u6570pty=True\u306fTTY\u7d4c\u7531\u3067\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u4ed8\u3051\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b3\u30ec\u3092\u4ed8\u3051\u306a\u3044\u3068\u6700\u8fd1\u306eCentOS\u3068\u304b\u3067\u306f\u300csudo: sorry, you must have a tty to run sudo\u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nTTY\u7d4c\u7531\u4ee5\u5916\u3067sudo\u3092\u4f7f\u3046\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u3092\u30aa\u30a6\u30e0\u8fd4\u3057\u3057\u3066\u3057\u307e\u3063\u3066\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u30a2\u30ec\u306a\u306e\u3067\u6700\u8fd1\u306f\u30c7\u30d5\u30a9\u3067TTY\u7d4c\u7531\u4ee5\u5916\u306f\u901a\u3055\u306a\u3044\u8a2d\u5b9a\u306b\u306a\u3063\u3066\u308b\u3089\u3059\u3043\u3002<\/p>\n<p>\u30fbcd\u95a2\u6570\u306f\u30ea\u30e2\u30fc\u30c8\u3067change directory\u3059\u308b\u3063\u3066\u4e8b\u3067\u3059\u304c\u3001with\u3092\u4ed8\u3051\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u30d6\u30ed\u30c3\u30af\u3092\u629c\u3051\u308b\u3068\u304d\u306bcurrent directory\u3092\u5143\u306b\u623b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u30fbFabric\u306f\u30b3\u30de\u30f3\u30c9\u304c\u5931\u6557\u3059\u308b\u3068\u305d\u3053\u3067Abort\u3057\u3066\u6b62\u307e\u3063\u3066\u3057\u307e\u3046\u3093\u3067\u3059\u304c\u3001<br \/>\nwith settings(warn_only=True): \u306e\u30d6\u30ed\u30c3\u30af\u3067\u306f\u8b66\u544a\u3092\u51fa\u3059\u3060\u3051\u3067Abort\u3057\u306a\u3044\u3088\u3046\u306b\u3067\u304d\u307e\u3059\u3002<br \/>\n\u5931\u6557\u3057\u3066\u3082\u5168\u4f53\u306b\u306f\u5f71\u97ff\u306e\u306a\u3044\u30b3\u30de\u30f3\u30c9\u3084\u3001\u6210\u529f\u5931\u6557\u3067\u5206\u5c90\u3057\u305f\u3044\u3068\u304d\u306b\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>\u30fb@runs_once\u30c7\u30b3\u30ec\u30fc\u30bf\u3092\u4ed8\u3051\u305f\u95a2\u6570\u306f\u5b9f\u884c\u30921\u56de\u3060\u3051\u306b\u9650\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4ed6\u306e\u95a2\u6570\u306fenv.hosts\u306b\u8a2d\u5b9a\u3055\u308c\u305f\u30b5\u30fc\u30d0\u30fc\u306e\u6570\u3060\u3051\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306e\u306f\u307e\u3060\u521d\u6b69\u7684\u306a\u4f7f\u3044\u65b9\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u50d5\u81ea\u8eab\u4eca\u65e5\u4f7f\u3044\u59cb\u3081\u305f\u3070\u304b\u308a\u3067\u3059\u3002<br \/>\n\u30b5\u30fc\u30d0\u30fc\u6bce\u306b\u51e6\u7406\u5185\u5bb9\u3092\u5909\u3048\u305f\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u306b\u5f79\u5272\u3092\u8a2d\u5b9a\u3057\u3066\u5f79\u5272\u6bce\u306b\u51e6\u7406\u5185\u5bb9\u3092\u5909\u3048\u305f\u308a\u306a\u3069\u3082\u51fa\u6765\u308b\u305d\u3046\u3067\u3059\u3002<br \/>\n\u3068\u3044\u3046\u304bPython\u30b9\u30af\u30ea\u30d7\u30c8\u305d\u306e\u3082\u306e\u306a\u306e\u3067\u3084\u308d\u3046\u3068\u601d\u3048\u3070\u4f55\u3067\u3082\u51fa\u6765\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[362,60],"class_list":["post-863","post","type-post","status-publish","format-standard","hentry","category-tech","tag-fabric","tag-python"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=863"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/863\/revisions"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}