<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Gosuke Miyashita]]></title>
  <link href="http://mizzy.org/atom.xml" rel="self"/>
  <link href="http://mizzy.org/"/>
  <updated>2012-01-19T00:00:53+09:00</updated>
  <id>http://mizzy.org/</id>
  <author>
    <name><![CDATA[Gosuke Miyashita]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[paperboy is hiring]]></title>
    <link href="http://mizzy.org/blog/2012/01/17/paperboy-is-hiring/"/>
    <updated>2012-01-17T20:56:00+09:00</updated>
    <id>http://mizzy.org/blog/2012/01/17/paperboy-is-hiring</id>
    <content type="html"><![CDATA[<p>今まで<a href="http://www.paperboy.co.jp/">ペパボ</a>の人事評価制度では、管理職のキャリアプランしか想定されていかったのですが、今年から導入された制度では、管理職とは別に、技術職用の等級が設けられ、能力に応じて待遇が向上する仕組みが導入されました。</p>

<p>具体的には、シニア、アドバンスド・シニア、という2つの役職が設けられ、以下のような待遇となっています。</p>

<ul>
<li>シニアは年俸500万円〜。フレックスタイム。</li>
<li>アドバンスド・シニアは年俸600万円〜。裁量労働。</li>
</ul>


<p>実運用に入るのはまだこれからなのですが、今までペパボでは技術者がステップアップしていく道がなかったので、これはペパボの技術者にとって、とても大きな一歩です。</p>

<p>で、本題。</p>

<p>新しい技術者の評価制度をベースに、今までペパボにはなかったポジションの技術者を、<a href="https://js01.jposting.net/paperboy/u/recruit/job.phtml?job_code=23">東京</a>と<a href="https://js01.jposting.net/paperboy/u/recruit/job.phtml?job_code=24">福岡</a>、両方で募集しています。</p>

<p>「技術基盤整備エンジニア」という言葉でピンと来る方もいるかと思いますが、<a href="http://cookpad.com/">クックパッド</a> さんの開発基盤グループが、役割として近いと思い、名前を拝借させていただきました。</p>

<p>職務内容としては、</p>

<ul>
<li>ペパボ全サービスに関わる技術基盤の整備

<ul>
<li>新しい方法論や技術の導入</li>
<li>開発手法の整備</li>
<li>大規模なリファクタリング、リプレース</li>
<li>モニタリング、キャパシティプランニングの強化</li>
<li>データ解析/ログ解析</li>
<li>セキュリティ関連</li>
</ul>
</li>
</ul>


<p>と書かれていますが、これだけに留まらず、これは絶対にやるべき、という技術的課題があれば、どんどんお任せしたいと考えています。</p>

<p>待遇は新評価制度の元での、アドバンスド・シニア待遇となります。（年俸600万円はあくまでも最低ラインなので、応相談です。）</p>

<p>また、自分が就いてる役職はテクニカル・マネージャーなのですが、この役職は人数制限があるわけではないので、場合によってはテクニカル・マネージャー待遇も検討させて頂きます。（特に福岡の場合。）</p>

<p>興味のある方、もっと具体的な話が聞いてみたい、という方は、<a href="http://twitter.com/gosukenator">twitter</a> や <a href="http://www.facebook.com/gosukenator">facebook</a> などで、お気軽にお声掛けください。</p>

<p>他にも、東京、京都、福岡で<a href="https://js01.jposting.net/paperboy/u/recruit/job.phtml">様々な職種で人材募集中です</a>。</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[coderwall badges on the sidebar]]></title>
    <link href="http://mizzy.org/blog/2012/01/13/coderwall-badges-on-the-sidebar/"/>
    <updated>2012-01-13T02:22:00+09:00</updated>
    <id>http://mizzy.org/blog/2012/01/13/coderwall-badges-on-the-sidebar</id>
    <content type="html"><![CDATA[<p>I&#8217;ve hacked Octopress quickly for displaying <a href="http://coderwall.com/">coderwall</a> badges on the sidebar.</p>

<p><img src="http://mizzy.org/images/2012/01/sidebar.png"></p>

<p>This is the <a href="https://github.com/mizzy/octopress/commit/d564e8d468c29e9ef51858a40ab2f414b94540e7">changeset</a> for this hack.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Webiblo - web to ebook project]]></title>
    <link href="http://mizzy.org/blog/2012/01/10/webiblo-web-to-ebook-project-en/"/>
    <updated>2012-01-10T20:17:00+09:00</updated>
    <id>http://mizzy.org/blog/2012/01/10/webiblo-web-to-ebook-project-en</id>
    <content type="html"><![CDATA[<p>I&#8217;ve started the project <a href="https://github.com/mizzy/webiblo">webiblo</a>.This is the improved fork of <a href="https://github.com/mizzy/web-to-mobi">web-to-mobi</a>.</p>

<p>This project includes the script to convert web sites into  ebook format(currently mobipocket only) data from given JSON data and gathering the JSON data for web sites.</p>

<p>Currently, you can generate mobipocket format data with the URI of JSON data like this:</p>

<pre><code>$ webiblo.pl http://mizzy.org/webiblo/data/Getting_Real.json
</code></pre>

<p>Or with JSON data through STDIN.</p>

<pre><code>$ cat data.json | webiblo.pl
</code></pre>

<p>This script needs <a href="http://www.amazon.com/gp/feature.html?docId=1000234621">KindleGen</a>.</p>

<p>JSON data is like this:</p>

<pre><code>{
    "title"       : "Structure and Interpretation of Computer Programs",
    "authors"     : [
        "Harold Abelson",
        "Gerald Jay Sussman",
        "Julie Sussman"
    ],
    "cover_image"   : "http://mitpress.mit.edu/sicp/full-text/book/cover.jpg",
    "content_xpath" : "//div[@class=\"content\"]", # Optional
    "exclude_xpath" : "//div[@class=\"navigation\"]", # Optional
    "chapters" : [
        {
            "title" : "Foreword",
            "uri"   : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-5.html#%_chap_Temp_2"
        },
        {
            "title" : "1  Building Abstractions with Procedures",
            "uri"  : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-9.html#%_chap_1",
            "sections" : [
                "title" : "1.1  The Elements of Programming",
                "uri"   : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1"
                "subsections" : [
                    {
                        "title" : "1.1.1  Expressions",
                        "uri"   : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.1"
                    },
                ]
            ]
        }
    ]
}
</code></pre>

<p>Overview of the JSON data is following:</p>

<ul>
<li>Book data

<ul>
<li>Title</li>
<li>Authors</li>
<li>Cover Image</li>
<li>XPath that represents the content part (Optional)</li>
<li>XPath that represents the uneeded part of the content (Optional)</li>
<li>Chapters

<ul>
<li>Title of the chapter</li>
<li>URI of the chapter page</li>
<li>Sections

<ul>
<li>Title of the secion</li>
<li>URI of the section page</li>
<li>Subsections

<ul>
<li>Title of the subsection</li>
<li>URI of the subsection page</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>


<p>There are two JSON data for <a href="http://gettingreal.37signals.com/toc.php">Getting Real</a>  and <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">SICP</a> on [my web site(http://mizzy.org/webiblo/) .</p>

<p>JSON data are put on the <a href="https://github.com/mizzy/webiblo/tree/gh-pages">gh-pages branch</a>.Pull requests are welcome.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Webiblo - web to ebook project]]></title>
    <link href="http://mizzy.org/blog/2012/01/10/webiblo-web-to-ebook-project/"/>
    <updated>2012-01-10T19:02:00+09:00</updated>
    <id>http://mizzy.org/blog/2012/01/10/webiblo-web-to-ebook-project</id>
    <content type="html"><![CDATA[<p>久々に日本語で書きます。（後で英語でも書く。）</p>

<p><a href="http://mizzy.org/blog/2012/01/09/web-to-mobi-a-script-for-converting-web-sites-to-mobipocket-format/">Web-to-mobi</a> を焼き直して、<a href="https://github.com/mizzy/webiblo">Webiblo</a> というプロジェクトを立ち上げてみました。</p>

<p>基本的には GitHub の README に書いてある通りなんですが、ウェブサイトについて記述された JSON を喰わせることによって、Kindle で読める mobipocket フォーマットの電子書籍データを作ろう、また、様々なサイト対応の JSON データを集めたい、というのがこのプロジェクトの趣旨です。</p>

<p>現在は、</p>

<pre><code>$ webiblo.pl http://mizzy.org/webiblo/data/Getting_Real.json
</code></pre>

<p>といった感じで、JSON が記述された URL を指定するか、</p>

<pre><code>$ cat data.json | webiblo.pl
</code></pre>

<p>といった形で JSON を標準入力から渡してやれば、与えられたデータにしたがって、mobipocket 形式のデータを生成します。（<a href="http://www.amazon.com/gp/feature.html?docId=1000234621">KindleGen</a> が必要です。）</p>

<p>JSON データは以下のようになっています。</p>

<pre><code>{
    "title"       : "Structure and Interpretation of Computer Programs",
    "authors"     : [
        "Harold Abelson",
        "Gerald Jay Sussman",
        "Julie Sussman"
    ],
    "cover_image"   : "http://mitpress.mit.edu/sicp/full-text/book/cover.jpg",
    "content_xpath" : "//div[@class=\"content\"]", # Optional
    "exclude_xpath" : "//div[@class=\"navigation\"]", # Optional
    "chapters" : [
        {
            "title" : "Foreword",
            "uri"   : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-5.html#%_chap_Temp_2"
        },
        {
            "title" : "1  Building Abstractions with Procedures",
            "uri"  : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-9.html#%_chap_1",
            "sections" : [
                "title" : "1.1  The Elements of Programming",
                "uri"   : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1"
                "subsections" : [
                    {
                        "title" : "1.1.1  Expressions",
                        "uri"   : "http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.1"
                    },
                ]
            ]
        }
    ]
}
</code></pre>

<p>ざっくり構造としては、以下のようになっています。</p>

<ul>
<li>書籍データ

<ul>
<li>本のタイトル</li>
<li>著者</li>
<li>表紙画像</li>
<li>コンテンツとして抜き出す部分の XPath（オプショナル）</li>
<li>コンテンツから除外したい部分の XPath（オプショナル）</li>
<li>章

<ul>
<li>章タイトル</li>
<li>章ページの URI</li>
<li>セクション

<ul>
<li>セクションタイトル</li>
<li>セクションページの URI</li>
<li>サブセクション

<ul>
<li>サブセクションタイトル</li>
<li>サブセクションページの URI</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>


<p>JSON データは現在のところ、<a href="http://gettingreal.37signals.com/toc.php">Getting Real</a> 用のものと <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">SICP</a> 用のものを <a href="http://mizzy.org/webiblo/">こちら</a> で公開しています。</p>

<p>JSON データは GitHub リポジトリの gh-pages ブランチに置いてあるので、独自の JSON データを作成した方は pull request 送ってもらえるとうれしいです。</p>

<p>webiblo で生成したデータを Kindle Previewer で見ると、こういった感じになります。</p>

<p><img src="http://mizzy.org/images/2012/01/sicp_cover.png" width="250" title="SICP Cover" >
<img src="http://mizzy.org/images/2012/01/sicp_toc.png" width="250" title="SICP TOC" >
<img src="http://mizzy.org/images/2012/01/sicp_content.png" width="250" title="SICP Content" ></p>

<p>元々は、単に Getting Real 英語版のデータを mobipocket 形式に変換したかっただけなんですが、Facebook での otsune さんのアドバイスにより、こういった形で、書籍固有のデータを分離する形でつくってみました。</p>

<p>また、<a href="http://twitter.com/hotchpotch">@hotchpotch</a> さんから、<a href="http://subtech.g.hatena.ne.jp/motemen/20110915/1316088362">Autopagerize の SITEINFO を活用したアプローチ</a> もあるよ、と教えて頂き、うおー、これはエレガントだ、と思ったんですが、こちらは目次ページを作成する機能がなさそうだったので、とりあえず当初の JSON を利用するというコンセプトのまま開発を進めました。</p>

<p>今後の TODO としては、以下のものを考えてます。</p>

<ul>
<li>EPUB3 など、mobipocket 以外のフォーマット対応</li>
<li>CLI から JSON カタログを検索して、簡単にデータ生成できるようにする</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Web-to-mobi - A script for converting web sites to mobipocket format]]></title>
    <link href="http://mizzy.org/blog/2012/01/09/web-to-mobi-a-script-for-converting-web-sites-to-mobipocket-format/"/>
    <updated>2012-01-09T03:46:00+09:00</updated>
    <id>http://mizzy.org/blog/2012/01/09/web-to-mobi-a-script-for-converting-web-sites-to-mobipocket-format</id>
    <content type="html"><![CDATA[<p>I&#8217;ve written a script to convert <a href="http://gettingreal.37signals.com/toc.php">Getting Real</a> into mobipocket format.</p>

<p>But the kindle edition of Getting Real is sold at amazon.com, publishing this script may be illegal.</p>

<p>So I&#8217;ve re-written this script like <a href="https://github.com/mizzy/web-to-mobi">this</a> following the advice from <a href="https://twitter.com/#!/otsune">@otsune</a>-san.</p>

<p>This script gets JSON data about a web site from STDIN and converts web data to mobipcoket format.</p>

<p>JSON data format is like this.</p>

<pre><code>{
     "title"    : "Getting Real",
     "author"   : "37signals",
     "chapters" : [
         {
             "title"     : "Introduction",
              "sections" : [
                  {
                      "title" : "What is Getting Real?",
                      "uri"   : "http://gettingreal.37signals.com/ch01_What_is_Getting_Real.php"
                  },
                  {
                      "title" : "About 37signals",
                      "uri"   : "http://gettingreal.37signals.com/ch01_About_37signals.php"
                  },
              ]
        }
     ],
     "content_xpath" : "//div[@class=\"content\"]",
     "exclude_xpath" : "//div[@class=\"next\"]"
}
</code></pre>

<p>This is the image of showing the converted file on Kindle Previewer.</p>

<p><img src="http://mizzy.org/images/2012/01/getting_real.png" title="Getting Real on Kindle" ></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[WeeChat script for pushing notification to im.kayac.com]]></title>
    <link href="http://mizzy.org/blog/2012/01/06/weechat-script-for-pushing-notification-to-im-dot-kayac-dot-com/"/>
    <updated>2012-01-06T00:28:00+09:00</updated>
    <id>http://mizzy.org/blog/2012/01/06/weechat-script-for-pushing-notification-to-im-dot-kayac-dot-com</id>
    <content type="html"><![CDATA[<p>I&#8217;ve written <a href="http://www.weechat.org/scripts/source/stable/im_kayac_com_notify.py.html/">WeeChat script for pushing notification to im.kayac.com</a>.</p>

<p>This script is based on <a href="http://www.weechat.org/scripts/source/stable/notifo_notify.py.html/">notifo_notify.py</a>.</p>

<p>This is the image of pushing notification to iPhone by this script.</p>

<p><img src="http://mizzy.org/images/2012/01/im_kayac_com_notify.png" width="320" title="Notification on iPhone" ></p>

<p>This script is hosted on <a href="https://github.com/mizzy/weechat-plugins/blob/master/im_kayac_com_notify.py">GitHub</a>.Pull requests are welcome.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Lunar Eclipse]]></title>
    <link href="http://mizzy.org/blog/2011/12/20/lunar-eclipse/"/>
    <updated>2011-12-20T01:32:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/12/20/lunar-eclipse</id>
    <content type="html"><![CDATA[<p>These are pictures of a lunar eclipse on Dec. 10, 2011.</p>

<p><img src="http://mizzy.org/images/2011/12/red-moon.jpg" title="Red Moon" ></p>

<p>Three red stars.(Moon, Betelgeuse and Aldebaran)</p>

<p><img src="http://mizzy.org/images/2011/12/three-red-stars.jpg" title="Three Red Stars" ></p>

<p>This is the composite picture from the penumbral eclipse to the beginning of the total eclipse.</p>

<p><img src="http://mizzy.org/images/2011/12/composite-of-lunar-eclipse.jpg" title="Composite" ></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[A Picture of Geminids]]></title>
    <link href="http://mizzy.org/blog/2011/12/20/a-picture-of-geminids/"/>
    <updated>2011-12-20T00:12:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/12/20/a-picture-of-geminids</id>
    <content type="html"><![CDATA[<p>This is a picture of a shooting star of Gemnids I took on Dec. 15, 2011.I took over 2,000 pictures and only 3 pictures got a shooting star.</p>

<p><img src="http://mizzy.org/images/2011/12/geminids-shooting-star.jpg" title="A shooting star of Geminids" ></p>

<p>A red bright star on left side is Aldebaran of Taurus and dense small stars on center are Pleiades.</p>

<p>It was so cold but looking at stars and shooting stars were so fun.It would never be boring for me.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Maglica Presentation At Hatena]]></title>
    <link href="http://mizzy.org/blog/2011/12/13/maglica-presentation-at-hatena/"/>
    <updated>2011-12-13T21:14:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/12/13/maglica-presentation-at-hatena</id>
    <content type="html"><![CDATA[<p>I talked about <a href="https://github.com/mizzy/maglica">Maglica</a> at <a href="http://hatena.ne.jp/">Hatena</a> on Dec. 9, 2011.</p>

<p>I appreciate <a href="http://twitter.com/#!/kentaro">@kentaro</a>-san and Hatena staffs.I had a very good time to talking with you and drinking Dr Peppers :-)</p>

<p><a href="http://mizzy.org/slides/maglica/">This is the slide I talked</a>.</p>

<p>Maglica is a simple internal cloud tool I made.I don&#8217;t like complicated and blackboxed tools.It seems for me that existing internal cloud tools are so complicated and overengineered for my use case.So I made the simple one.</p>

<p>&#8220;Tenjin&#8221; font is embedded in this slide using CSS Fonts Module. <a href="http://twitter.com/#!/chocolatina">@chocolatina</a> made this cool font.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[How to deploy a blog made by Octopress to Heteml]]></title>
    <link href="http://mizzy.org/blog/2011/11/15/octopress-on-heteml/"/>
    <updated>2011-11-15T22:30:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/11/15/octopress-on-heteml</id>
    <content type="html"><![CDATA[<div><script src='https://gist.github.com/1367192.js?file='></script>
<noscript><pre><code>diff --git a/Rakefile b/Rakefile
index 7d7f6d8..41868ab 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,10 +4,10 @@ require &quot;stringex&quot;
 
 ## -- Rsync Deploy config -- ##
 # Be sure your public key is listed in your server's ~/.ssh/authorized_keys file
-ssh_user       = &quot;user@domain.com&quot;
-ssh_port       = &quot;22&quot;
-document_root  = &quot;~/website.com/&quot;
-deploy_default = &quot;rsync&quot;
+ssh_user       = &quot;xxx@usersXX.heteml.jp&quot;
+ssh_port       = &quot;2222&quot;
+document_root  = &quot;~/web/octopress&quot;
+deploy_default = &quot;scp&quot;
 
 # This will be configured for you when you run config_deploy
 deploy_branch  = &quot;gh-pages&quot;
@@ -224,6 +224,12 @@ task :rsync do
   ok_failed system(&quot;rsync -avze 'ssh -p #{ssh_port}' --delete #{public_dir}/ #{ssh_user}:#{document_root}&quot;)
 end
 
+desc &quot;Deploy website via scp&quot;
+task :scp do
+  puts &quot;## Deploying website via scp&quot;
+  ok_failed system(&quot;scp -r -P #{ssh_port} #{public_dir}/* #{ssh_user}:#{document_root}&quot;)
+end
+
 desc &quot;deploy public directory to github pages&quot;
 multitask :push do
   puts &quot;## Deploying branch to Github Pages &quot;
</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Maglica Web]]></title>
    <link href="http://mizzy.org/blog/2011/11/05/maglica-web/"/>
    <updated>2011-11-05T13:35:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/11/05/maglica-web</id>
    <content type="html"><![CDATA[<p><a href="https://github.com/mizzy/maglica-web">Maglica Web is on GitHub</a></p>

<p><img src="http://img.logpi.jp/C58B4476-0769-11E1-8C19-9A01CD288735_o.png">
<img src="http://img.logpi.jp/024C01C4-05FE-11E1-A49E-9848058D85C2_o.jpg">
<img src="http://img.logpi.jp/01A75D3C-05E9-11E1-99E8-9701CD288735_o.jpg">
<img src="http://img.logpi.jp/65B4CEC4-05F1-11E1-9242-8909CD288735_o.jpg">
<img src="http://img.logpi.jp/2A1E7730-05FF-11E1-AE4A-9948058D85C2_o.jpg">
<img src="http://img.logpi.jp/7E9FA20A-0769-11E1-B29D-9801CD288735_o.png"></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Vimeo tag plugin]]></title>
    <link href="http://mizzy.org/blog/2011/10/30/vimeo-tag-plugin/"/>
    <updated>2011-10-30T23:27:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/10/30/vimeo-tag-plugin</id>
    <content type="html"><![CDATA[<iframe src="http://player.vimeo.com/video/24149087?color=ffffff" width="800" height="600" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe>


<p><a href="http://vimeo.com/24149087">Black Hole Sun - Astronomic Landscape and Milky Way TimeLapse</a> from <a href="http://vimeo.com/user1722616">Christoph Malin</a> on <a href="http://vimeo.com">Vimeo</a>.</p>




<figure class='code'><figcaption><span>A Liquid tag for Jekyll sites that allows embedding vimeo movies (vimeo_tag.rb)</span> <a href='http://mizzy.org/downloads/code/vimeo_tag.rb'>download</a></figcaption>
 <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
<span class='line-number'>37</span>
<span class='line-number'>38</span>
<span class='line-number'>39</span>
<span class='line-number'>40</span>
<span class='line-number'>41</span>
<span class='line-number'>42</span>
<span class='line-number'>43</span>
<span class='line-number'>44</span>
<span class='line-number'>45</span>
</pre></td><td class='code'><pre><code class='rb'><span class='line'><span class="c1"># A Liquid tag for Jekyll sites that allows embedding vimeo movies</span>
</span><span class='line'><span class="c1"># by: Gosuke Miyashita</span>
</span><span class='line'><span class="c1">#</span>
</span><span class='line'><span class="c1"># Example usage: {% vimeo 28040685 800 600 %}</span>
</span><span class='line'>
</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;open-uri&#39;</span>
</span><span class='line'><span class="nb">require</span> <span class="s1">&#39;multi_json&#39;</span>
</span><span class='line'>
</span><span class='line'><span class="k">module</span> <span class="nn">Jekyll</span>
</span><span class='line'>  <span class="k">class</span> <span class="nc">VimeoTag</span> <span class="o">&lt;</span> <span class="no">Liquid</span><span class="o">::</span><span class="no">Tag</span>
</span><span class='line'>    <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="n">tag_name</span><span class="p">,</span> <span class="n">text</span><span class="p">,</span> <span class="n">token</span><span class="p">)</span>
</span><span class='line'>      <span class="k">super</span>
</span><span class='line'>      <span class="vi">@text</span> <span class="o">=</span> <span class="n">text</span>
</span><span class='line'>      <span class="vi">@cache_dir</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">expand_path</span> <span class="s2">&quot;../.vimeo-cache&quot;</span><span class="p">,</span> <span class="no">File</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">__FILE__</span><span class="p">)</span>
</span><span class='line'>      <span class="no">FileUtils</span><span class="o">.</span><span class="n">mkdir_p</span> <span class="vi">@cache_dir</span>
</span><span class='line'>    <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">def</span> <span class="nf">render</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
</span><span class='line'>      <span class="k">if</span> <span class="n">parts</span> <span class="o">=</span> <span class="vi">@text</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="sr">/(\d+) (\d+) (\d+)/</span><span class="p">)</span>
</span><span class='line'>        <span class="nb">id</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">height</span> <span class="o">=</span> <span class="n">parts</span><span class="o">[</span><span class="mi">1</span><span class="o">].</span><span class="n">strip</span><span class="p">,</span> <span class="n">parts</span><span class="o">[</span><span class="mi">2</span><span class="o">].</span><span class="n">strip</span><span class="p">,</span> <span class="n">parts</span><span class="o">[</span><span class="mi">3</span><span class="o">].</span><span class="n">strip</span>
</span><span class='line'>      <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">vimeo</span> <span class="o">=</span> <span class="n">get_vimeo</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
</span><span class='line'>      <span class="o">&lt;&lt;-</span><span class="no">HTML</span>
</span><span class='line'><span class="sh">&lt;iframe src=&quot;http://player.vimeo.com/video/#{id}?color=ffffff&quot; width=&quot;#{width}&quot; height=&quot;#{height}&quot; frameborder=&quot;0&quot; webkitAllowFullScreen allowFullScreen&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href=&quot;http://vimeo.com/#{id}&quot;&gt;#{vimeo[&quot;title&quot;]}&lt;/a&gt; from &lt;a href=&quot;#{vimeo[&quot;author_url&quot;]}&quot;&gt;#{vimeo[&quot;author_name&quot;]}&lt;/a&gt; on &lt;a href=&quot;http://vimeo.com&quot;&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;</span>
</span><span class='line'><span class="no">      HTML</span>
</span><span class='line'>    <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>    <span class="k">def</span> <span class="nf">get_vimeo</span><span class="p">(</span><span class="nb">id</span><span class="p">)</span>
</span><span class='line'>      <span class="n">cache_file</span> <span class="o">=</span> <span class="no">File</span><span class="o">.</span><span class="n">join</span> <span class="vi">@cache_dir</span><span class="p">,</span> <span class="nb">id</span>
</span><span class='line'>      <span class="k">if</span> <span class="no">File</span><span class="o">.</span><span class="n">exist?</span> <span class="n">cache_file</span>
</span><span class='line'>        <span class="no">MultiJson</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="no">File</span><span class="o">.</span><span class="n">read</span> <span class="n">cache_file</span><span class="p">)</span>
</span><span class='line'>      <span class="k">else</span>
</span><span class='line'>        <span class="n">json</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s2">&quot;http://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/</span><span class="si">#{</span><span class="nb">id</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">read</span>
</span><span class='line'>        <span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">cache_file</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">)</span> <span class="k">do</span> <span class="o">|</span><span class="n">io</span><span class="o">|</span>
</span><span class='line'>          <span class="n">io</span><span class="o">.</span><span class="n">write</span> <span class="n">json</span>
</span><span class='line'>        <span class="k">end</span>
</span><span class='line'>        <span class="no">MultiJson</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="n">json</span><span class="p">)</span>
</span><span class='line'>      <span class="k">end</span>
</span><span class='line'>    <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="no">Liquid</span><span class="o">::</span><span class="no">Template</span><span class="o">.</span><span class="n">register_tag</span><span class="p">(</span><span class="s1">&#39;vimeo&#39;</span><span class="p">,</span> <span class="no">Jekyll</span><span class="o">::</span><span class="no">VimeoTag</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Typo to Octopress]]></title>
    <link href="http://mizzy.org/blog/2011/10/29/typo-to-octopress/"/>
    <updated>2011-10-29T21:34:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/10/29/typo-to-octopress</id>
    <content type="html"><![CDATA[<p>I&#8217;ve moved my <a href="http://fdv.github.com/typo/">Typo</a> blog contents to this octopress blog.</p>

<p>For this purpose I made this tiny script.</p>

<div><script src='https://gist.github.com/1324352.js?file='></script>
<noscript><pre><code>require &quot;rubygems&quot;
require &quot;active_record&quot;

ActiveRecord::Base.establish_connection(
    :adapter  =&gt; &quot;mysql2&quot;,
    :host     =&gt; &quot;192.168.10.12&quot;,
    :user     =&gt; &quot;root&quot;,
    :password =&gt; &quot;root&quot;,
    :database =&gt; &quot;typo&quot;,
    :encoding =&gt; &quot;utf8&quot;
)

class Content &lt; ActiveRecord::Base
  Content.inheritance_column = 'foo'
end

contents = Content.all

contents.each do |content|
  dt = content.published_at
  date = sprintf(&quot;%04s-%02d-%02d&quot;, dt.year, dt.month, dt.day)
  datetime = date + sprintf(&quot; %02d:%02d&quot;, dt.hour, dt.min)
  file = date + &quot;-&quot; + content.id.to_s + &quot;.markdown&quot;

  body = &lt;&lt;BODY
---
layout: post
title: &quot;#{content.title}&quot;
date: #{datetime}
comments: true
categories:
---
#{content.body}
BODY

  File.open(file, 'w') do |file|
    file.write(body)
  end
end
</code></pre></noscript></div>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[TWAN tag plugin for Jekyll]]></title>
    <link href="http://mizzy.org/blog/2011/10/21/twan-tag-plugin/"/>
    <updated>2011-10-21T00:04:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/10/21/twan-tag-plugin</id>
    <content type="html"><![CDATA[<p>I&#8217;ve written <a href="https://github.com/mizzy/jekyll-plugins/blob/master/twan_tag.rb">TWAN tag plugin</a> for <a href="https://github.com/mojombo/jekyll">Jekyll</a> which shows the image of <a href="http://www.twanight.org/newTWAN/index.asp">The World At Night</a>.</p>

<p>If you call this plugin in a post like this:</p>

<pre><code>{% twan 3003406 %}
</code></pre>

<p>The image shows up like this.</p>

<p><a href="http://www.twanight.org/newTWAN/photos.asp?ID=3003406"><img src="http://mizzy.org/images/twan/3003406.jpg" /></a></br />
<a href="http://www.twanight.org/newTWAN/photos.asp?ID=3003406">Draconid Meteors Composite by Juan Carlos Casado</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[自宅サーバが死にました]]></title>
    <link href="http://mizzy.org/blog/2011/10/17/first-post/"/>
    <updated>2011-10-17T22:25:00+09:00</updated>
    <id>http://mizzy.org/blog/2011/10/17/first-post</id>
    <content type="html"><![CDATA[<p>10年ぐらい稼働していた mizzy.org の自宅サーバが死にました。（四男がコンセントぶち抜いたら起動してこなくなった。）</p>

<p>メールの方は Google Apps に移行したんですが、ブログはどうしようかなー、できれば GitHub でファイル管理したいなー、と思ってたところに、<a href="http://mattn.kaoriya.net/software/lang/ruby/20111017205717.htm">@mattn_jp さんのタイムリーなエントリ</a> が。</p>

<p>とても良さそうなので、しばらくこれで運用してみます。</p>

<p>過去エントリについては、Trac に入ってた分ぐらいは移行しようかな、と考えてます。</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[My Resume]]></title>
    <link href="http://mizzy.org/blog/2011/10/05/MyResume/"/>
    <updated>2011-10-05T17:14:06+09:00</updated>
    <id>http://mizzy.org/blog/2011/10/05/MyResume</id>
    <content type="html"><![CDATA[<h1>Educations</h1>

<ul>
<li>Hokkaido University (1993-1997)

<ul>
<li>Department of Economics

<ul>
<li>Operations Research</li>
<li>Linear Programming</li>
<li>Multivariable Analysis</li>
<li>A theme of graduation thesis is &#8220;Analyze NBA Players ablility with Multivariable Analysis&#8221;</li>
</ul>
</li>
</ul>
</li>
</ul>


<hr />

<h1>Jobs</h1>

<ul>
<li><a href="http://www.ctc-g.co.jp/en/">CTC</a>

<ul>
<li>1997-

<ul>
<li>Netscape Server Software Products Engineer

<ul>
<li>Netscape Enterprise Server (Web Server)</li>
<li>Netscape Messaging Server (Mail Server)</li>
<li>Netscape Directory Server (LDAP Server)</li>
<li>and so on</li>
</ul>
</li>
</ul>
</li>
<li>1998-

<ul>
<li>Support Engineer of Netscape Server Software Products at Netscape Japan</li>
</ul>
</li>
<li>1999-2000

<ul>
<li>QA of I18N Netscpe Server Software Products at Netscape US</li>
<li>Working at Mountain View</li>
<li>Lining in Sunnyvale</li>
</ul>
</li>
<li>2000-2005

<ul>
<li>iPlanet(formerly known as Netscape) Server Software Products Engineer at CTC again.</li>
</ul>
</li>
</ul>
</li>
</ul>


<hr />

<ul>
<li><a href="http://www.netmarks.co.jp/english/index.html">Netmarks</a>

<ul>
<li>2005-

<ul>
<li>Testing Network Quarantine Systems

<ul>
<li>It is for blocking insecure computers automatically.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>


<hr />

<ul>
<li><a href="http://www.paperboy.co.jp/">paperboy&amp;co.</a> (Now)

<ul>
<li>2006-

<ul>
<li>Software Engineer</li>
<li>JugemKey (http://jugemkey.jp/)

<ul>
<li>Central authorization system for multiple services in paperboy&amp;co.</li>
<li>Write backend API with Perl</li>
</ul>
</li>
<li>JugemKey Authentication API

<ul>
<li>Similar to Flickr authentication API</li>
<li>Write frontend with PHP and backend with Perl</li>
</ul>
</li>
<li>JUGEM (http://jugem.jp/)

<ul>
<li>Blog service</li>
<li>Write accounting function by credit cards with PHP</li>
</ul>
</li>
</ul>
</li>
<li>2007-

<ul>
<li>Technical Manager</li>
<li>30days Album (http://30d.jp/)

<ul>
<li>A photo Album Service</li>
<li>In charge of overall architect design</li>
<li>Write some Perlbal plugins</li>
<li>Write frontend API for MogileFS

<ul>
<li>Perl + Catalyst</li>
</ul>
</li>
<li>Other technology stacks

<ul>
<li>Linux, Ruby On Rails, lighttpd, Gearman, TheSchwartz</li>
</ul>
</li>
</ul>
</li>
<li>Lolipop Rental Server (http://lolipop.jp/)

<ul>
<li>A plain old style rental servers</li>
<li>In charge of overall architect design in system renewal</li>
<li>Designed Internal API and implemented a proto type</li>
<li>Other technology stacks

<ul>
<li>Linux, Cobbler, LVS, Apache, MySQL, Postfix, qpsmtpd, Courier-IMAP, ClamAV, Puppet, Func</li>
</ul>
</li>
</ul>
</li>
<li>Improve development environments in the company

<ul>
<li>Introduce Subversion and Trac</li>
<li>Recently introduce Git and Jenkins CI</li>
<li>Now writing original internal cloud tool

<ul>
<li>Very simple system with kvm, libvirtd, virt-clone and zeromq

<ul>
<li><a href="https://github.com/mizzy/maglica">Maglica on GitHub</a></li>
<li><a href="http://mizzy.org/slides/maglica">Maglica Slide</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>


<hr />

<h1>Talks</h1>

<ul>
<li><a href="http://tokyo2007.yapcasia.org/blog/">YAPC::Asia 2007 Tokyo</a>

<ul>
<li><a href="http://tokyo2007.yapcasia.org/sessions/2007/02/assurer_a_pluggable_server_tes.html">Assurer - a pluggable server testing/monitoring framework</a></li>
<li><a href="http://www.slideshare.net/mizzy/assurer-a-pluggable-server-testingmonitoring-framework">SlideShare</a></li>
<li><a href="https://github.com/mizzy/Assurer">Code on github</a></li>
</ul>
</li>
<li><a href="http://conferences.yapcasia.org/ya2008/index.html">YAPC::Asia 2008 Tokyo</a>

<ul>
<li><a href="http://conferences.yapcasia.org/ya2008/talk/973">Easy system administration programming with a framework</a></li>
<li><a href="https://github.com/mizzy/Punc">Code on github</a></li>
</ul>
</li>
<li><a href="http://conferences.yapcasia.org/ya2009/">YAPC::Asia 2009 Tokyo</a>

<ul>
<li><a href="http://conferences.yapcasia.org/ya2009/talk/2166">How to use Perl in paperboy&amp;co.</a></li>
<li><a href="http://conferences.yapcasia.org/ya2009/talk/2220">How Danga::Socket handles asynchronous processing and how to write asynchronous Perlbal plugins</a></li>
</ul>
</li>
<li>Xen Summit 2008 Tokyo

<ul>
<li><a href="http://www.slideshare.net/mizzy/xen-summit-2008-tokyo-operating-xen-domains-through-llperlpython-with-libvirt-presentation">Operating Xen domains through LL(Perl/Python) with libvirt</a></li>
</ul>
</li>
<li><a href="http://www.tlug.jp/wiki/Meetings:2008:09">TLUG Meeting 2008/09/13</a>

<ul>
<li><a href="http://www.slideshare.net/mizzy/how-to-build-a-scalable-storage-system-at-tlug-meeting-20080913-presentation">How To Build A Scalable Storage System with OSS</a></li>
</ul>
</li>
<li><a href="http://dsas.blog.klab.org/archives/51208101.html">KLab Study #4</a>

<ul>
<li><a href="http://www.slideshare.net/mizzy/open-source-system-administration-framework-func">Open Source System Administration Framework - Func</a> (Japanese)</li>
</ul>
</li>
<li><a href="http://techlife.cookpad.com/2009/10/24/techlife_introduction/">techlife lightning talk at Cookpad</a>

<ul>
<li><a href="http://www.slideshare.net/mizzy/puppet-best-practices-at-cookpad">Puppet Best Practices?</a> (Japanese)</li>
</ul>
</li>
<li><a href="http://heartbeats.jp/hbstudy/2010/02/hbstudy8.html">hbstudy #8</a>

<ul>
<li><a href="http://www.slideshare.net/mizzy/puppet-3258268">About Puppet</a> (Japanese)</li>
</ul>
</li>
<li><a href="http://partake.in/events/b5472f43-5bc0-42d0-9469-dc70d7d95b24">DevOps Conference</a>

<ul>
<li><a href="http://www.slideshare.net/mizzy/10devops">DevOps in 10 minutes</a> (Japanese)</li>
</ul>
</li>
<li>Tech Talk at NTT Resonant Inc

<ul>
<li><a href="http://www.slideshare.net/mizzy/devops-4156440">What is DevOps?</a> (Japanese)</li>
</ul>
</li>
<li><a href="http://k-of.jp/2008/">Kansai Open Source 2008</a>

<ul>
<li><a href="http://www.slideshare.net/mizzy/2008-30days-album-presentation">Inside 30days Album&#8217;s Backend</a> (Japanese)</li>
</ul>
</li>
<li><a href="http://shibuya.pm.org/blosxom/techtalks/200610.html">Shibuya.pm Technical Talk #7</a>

<ul>
<li>LT: Plagger Plugins development process by using SVK</li>
</ul>
</li>
<li><a href="http://shibuya.pm.org/blosxom/techtalks/200710.html">Shibuya.pm Technical Talk #8</a>

<ul>
<li>LT: About Pushmi</li>
</ul>
</li>
</ul>


<hr />

<h1>Others</h1>

<ul>
<li>I4PC (Instagram for PC)

<ul>
<li>http://www.i4pc.jp/</li>
</ul>
</li>
<li>CPAN

<ul>
<li>http://search.cpan.org/~mizzy/</li>
</ul>
</li>
<li>GitHub

<ul>
<li>https://github.com/mizzy</li>
</ul>
</li>
<li>codewall

<ul>
<li>http://coderwall.com/mizzy</li>
</ul>
</li>
<li>twitter

<ul>
<li>http://twitter.com/gosukenator</li>
</ul>
</li>
<li>Facebook

<ul>
<li>http://www.facebook.com/gosukenator</li>
</ul>
</li>
<li>SlideShare

<ul>
<li>http://www.slideshare.net/mizzy/presentations</li>
</ul>
</li>
<li>Articles about Puppet in gihyo.jp (Japanese)

<ul>
<li>http://gihyo.jp/admin/serial/01/puppet</li>
</ul>
</li>
<li>Articles about Puppet in Software Design magazine (Japanese)

<ul>
<li>http://gihyo.jp/magazine/SD/archive/2007/200712</li>
</ul>
</li>
<li>Interview articles (Japanese)

<ul>
<li>http://japan.cnet.com/extra/paperboy_0907/story/0,3800098768,20394957,00.htm</li>
<li>http://web-engineer.buyuden.net/buyuden/2010/01/39paperboyco.html</li>
<li>http://jibun.atmarkit.co.jp/lcom01/rensai/comrade04/comrade01.html</li>
</ul>
</li>
<li>LinkedIn

<ul>
<li>http://www.linkedin.com/in/mizzy</li>
</ul>
</li>
<li>Personal sites

<ul>
<li>http://mizzy.org/</li>
<li>http://astralscape.tumblr.com/</li>
</ul>
</li>
</ul>


<hr />

<p>mailto: gosukenator at gmail.com</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[SSLCertOfLolipop]]></title>
    <link href="http://mizzy.org/blog/2011/09/03/SSLCertOfLolipop/"/>
    <updated>2011-09-03T01:41:19+09:00</updated>
    <id>http://mizzy.org/blog/2011/09/03/SSLCertOfLolipop</id>
    <content type="html"><![CDATA[<p><a href="http://blog2.or6.jp/ftpisdead">FFFTP開発終了で大騒ぎしている人たちへ</a> にて、</p>

<pre><code>SSL証明書がまともなものでないと接続時にエラーが出るのですが、ロリポップなんかだと
このエラーを無視するように公式ドキュメントに書いてあるので、かなり悪質です。
</code></pre>

<p>と書かれていますので、これについて説明させて頂きます。</p>

<p>この方が指摘されているのは、<del><a href="http://lolipop.jp/manual/hp/w-fz/">Win FileZillaの設定 / ホームページ / マニュアル - ロリポップ！</a> </del>(FileZilla非推奨のため現在は削除されています)の中の、</p>

<pre><code> 証明書の確認を行います。『今後もこの証明書を常に信用する(A)』にチェックを入れて、『OK』をクリックします。
</code></pre>

<p>という部分だと思われるのですが、確かに、無条件で信用するにチェックを入れるようお客様に指示するのは大変良くないですね。</p>

<p>ロリポップでは <a href="http://www.digicert.ne.jp/">DigiCert Inc社</a> によって発行されている証明書を利用しているのですが、Filezillaでは警告が出てしまうようです。</p>

<p>調べてみたところ、FilezillaはルートCAの証明書を保持しておらず、どのような証明書であっても、ユーザが「信用する」にチェックを入れなければ警告が出る仕様となっているようです。</p>

<p><a href="http://forum.filezilla-project.org/viewtopic.php?f=2&amp;t=20767">how to install root CA certificate on Filezilla</a></p>

<p>OR6 blog 様のご指摘により、このような証明書の検証をきちんと行っていないソフトウェアをお客様に推奨すべきではないと判断いたしましたので、Windows/Mac版ともに存在し、証明書の検証をきちんと行っている <a href="http://cyberduck.ch/">Cyberduck</a> を推奨するよう、マニュアルを変更させて頂くことになりました。</p>

<p>また、蛇足ですが、ロリポップの <a href="http://lolipop.jp/service/plan-chicappa/">チカッパプラン</a> では SSH サービスを提供していますので、FTPS の代わりに SCP/SFTP もご利用頂けます。</p>

<p>OR6 blog 様、この度はご指摘誠にありがとうございました。</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[MaglicaInternalCloudTool]]></title>
    <link href="http://mizzy.org/blog/2011/08/18/MaglicaInternalCloudTool/"/>
    <updated>2011-08-18T17:25:28+09:00</updated>
    <id>http://mizzy.org/blog/2011/08/18/MaglicaInternalCloudTool</id>
    <content type="html"><![CDATA[<h1>Overview</h1>

<p><a href="https://github.com/mizzy/maglica">Maglica</a> is a Python library and command-line tool for an internal cloud. (This tool is very primitive beta now.)</p>

<p>This is very simple and based on libvirt, virt-clone and zeromq (for RPC).</p>

<p>The name &#8220;Maglica&#8221; is derived from a Bosnian word that means &#8220;Nebula.&#8221;</p>

<p>I&#8217;m developing this tool because other internal cloud tools(CloudStack, OpenStack, Eucalyptus and so on) are so complicated for internal use.I need a simple tool.</p>

<hr />

<h1>Architecture of Maglica</h1>

<p>Maglica has four components.</p>

<ol>
<li>Library</li>
<li>CLI</li>
<li>Client worker</li>
<li>Host workers</li>
</ol>


<p>Maglica library is a main component of Maglica.Maglica CLI calls the library
to do the jobs.The library talks to libvirtd on other hosts directly to get
virtual machines information.</p>

<p>Maglica client worker is running on the same host on which CLI runs.
Client worker binds zeromq PUB socket to tcp://<em>:5555 and REP socket
to tcp://</em>:5556.</p>

<p>Client worker recieves requests from library through REP socket and throws
request to host workers through PUB socket.Also REP socket recives job results
from host workers.</p>

<p>Host workers are running on hosts which virtual machines are running on.</p>

<p>Host workers connect to the PUB socket of a client worker to receive job
requests and the REP socket of a client worker to throw job results.</p>

<p>[[Image(http://mizzy.org/img/maglica_architecture.jpg)]]</p>

<hr />

<h1>How to use Maglica</h1>

<p>You must setup libvirtd running on host machines and accessible through
tcp port. (See http://libvirt.org/remote.html)</p>

<p>Clone Maglica on a host machine and run the host worker.</p>

<pre><code># git clone git://github.com/mizzy/maglica.git
# cd maglica
# cp etc/maglica.conf.example etc/maglica.conf
</code></pre>

<p>Edit etc/maglica.conf that points to the correct client worker host and port.</p>

<pre><code># ./scripts/maglica_host_worker
</code></pre>

<p>Clone Maglica on a client machine.</p>

<pre><code># git clone git://github.com/mizzy/maglica.git
# cd maglica
# cp etc/maglica.conf.example etc/maglica.conf
</code></pre>

<p>Edit etc/maglica.conf that points to host machines.</p>

<p>Run the client worker.</p>

<pre><code># ./scripts/maglica_client_worker
</code></pre>

<p>Run maglica command to list up &#8220;original images&#8221;(which name is end with
the string &#8220;oroginal&#8221;).</p>

<pre><code># PYTHONPATH=. ./scripts/maglica image list
Name                                     Host
---------------------------------------------------------
SL6.0-x86_64.original                    host0.example.jp  
SL6.1-x86_64.original                    host0.example.jp  
SL6.0-x86_64.original                    host1.example.jp  
SL6.1-x86_64.original                    host1.example.jp  
</code></pre>

<p>Run maclica command to clone a virtual machine image.</p>

<pre><code># ./scripts/maglica vm clone --image=SL6.1-x86_64.original --hostname=vm0.example.jp
</code></pre>

<p>This command clones the image on a host and rewrites network setting of the image with libguestfs.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[HowToGetGraphiteWorkingOnScientificLinux6]]></title>
    <link href="http://mizzy.org/blog/2011/07/24/HowToGetGraphiteWorkingOnScientificLinux6/"/>
    <updated>2011-07-24T23:18:15+09:00</updated>
    <id>http://mizzy.org/blog/2011/07/24/HowToGetGraphiteWorkingOnScientificLinux6</id>
    <content type="html"><![CDATA[<p>I found a interest tool, <a href="http://graphite.wikidot.com/">Graphite</a> when I was exploring https://github.com/etsy .(<a href="http://graphite.wikidot.com/screen-shots">Screen Shots of Graphite</a>.)</p>

<h1>Install Carbon</h1>

<p><a href="http://graphite.wikidot.com/carbon">Carbon</a> is a backend storage application for Graphite.</p>

<pre><code># wget http://launchpad.net/graphite/1.0/0.9.8/+download/carbon-0.9.8.tar.gz
# tar zxvf carbon-0.9.8.tar.gz
# pushd carbon-0.9.8
# python setup.py install
# popd
</code></pre>

<h1>Install Whisper</h1>

<p><a href="http://graphite.wikidot.com/whisper">Whisper</a> is an alternate to RRD.</p>

<pre><code># wget http://launchpad.net/graphite/1.0/0.9.8/+download/whisper-0.9.8.tar.gz
# tar zxvf whisper-0.9.8.tar.gz
# pushd whisper-0.9.8
# python setup.py install
# popd
</code></pre>

<h1>Install Graphite</h1>

<pre><code># wget http://launchpad.net/graphite/1.0/0.9.8/+download/graphite-web-0.9.8.tar.gz
# tar zxvf graphite-web-0.9.8.tar.gz
# pushd graphite-web-0.9.8      
</code></pre>

<p>Run check-dependencies.py.</p>

<pre><code># ./check-dependencies.py 
[FATAL] Unable to import the 'cairo' module, do you have pycairo installed for python 2.6.5?
[FATAL] Unable to import the 'django' module, do you have Django installed for python 2.6.5?
[WARNING] Unable to import the 'mod_python' module, do you have mod_python installed for python 2.6.5?
This means you will only be able to run graphite in the development server mode, which is not
recommended for production use.
[WARNING]
Unable to import the 'memcache' module, do you have python-memcached installed for python 2.6.5?
This feature is not required but greatly improves performance.

[WARNING]
Unable to import the 'ldap' module, do you have python-ldap installed for python 2.6.5?
Without python-ldap, you will not be able to use LDAP authentication in the graphite webapp.

[WARNING]
Unable to import the 'twisted' package, do you have Twisted installed for python 2.6.5?
Without Twisted, you cannot run carbon on this server.
[WARNING]
Unable to import the 'txamqp' module, this is required if you want to use AMQP.
Note that txamqp requires python 2.5 or greater.
2 necessary dependencies not met. Graphite will not function until these dependencies are fulfilled.
5 optional dependencies not met. Please consider the warning messages before proceeding.
</code></pre>

<p>I use a development server included in Graphite, so mod_python is not needed.</p>

<p>Install packages other than mod_python.</p>

<pre><code># yum install pycairo
# rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
# yum install Django python-twisted python-memcached python-ldap
# yum install python-setuptools gcc python-devel
# easy_install txamqp
</code></pre>

<p>You need bitmap fonts, so intall it.</p>

<pre><code># yum install bitmap-console-fonts
</code></pre>

<p>Install Graphite and setup it.</p>

<pre><code># python setup.py install
# python /opt/graphite/webapp/graphite/manage.py syncdb
# pushd /opt/graphite/conf
# cp carbon.conf.example carbon.conf
# cp storage-schemas.conf.example storage-schemas.conf
# cp dashboard.conf.example dashboard.conf
</code></pre>

<p>Edit dashborad.conf and uncomment these.</p>

<pre><code>[ui]
default_graph_width = 400
default_graph_height = 250
automatic_variants = true
refresh_interval = 60
</code></pre>

<p>Start Carbon.</p>

<pre><code># /opt/graphite/bin/carbon-cache.py start
</code></pre>

<p>Start example-client included in Graphite source code to send load average data to Carbon.</p>

<pre><code># popd
# python ./examples/example-client.py
</code></pre>

<p>Start a develepment server of Graphite.</p>

<pre><code># /opt/graphite/bin/run-graphite-devel-server.py /opt/graphite  
</code></pre>

<p>Access to port 8080 of this server and you&#8217;ll see the screen of Graphite.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[HowDotCloudLazyCopyImplementsCopyOnWrite]]></title>
    <link href="http://mizzy.org/blog/2011/07/17/HowDotCloudLazyCopyImplementsCopyOnWrite/"/>
    <updated>2011-07-17T23:44:34+09:00</updated>
    <id>http://mizzy.org/blog/2011/07/17/HowDotCloudLazyCopyImplementsCopyOnWrite</id>
    <content type="html"><![CDATA[<p><a href="https://github.com/dotcloud/lazycopy">dotcloud/lazycopy</a> is a copy-on-write version of cp.It&#8217;s based on <a href="http://aufs.sourceforge.net/">aufs</a>.</p>

<p>Scientific Linux 5 has aufs rpm on its base repo.So I tried aufs and lazycopy on SL5.CentOS and SL6 don&#8217;t have aufs rpm.</p>

<p>I created source directories and files in them first.</p>

<pre><code># mkdir /tmp/source0
# mkdir /tmp/source1
# mkdir /tmp/source2
# echo source0 &gt; /tmp/source0/0
# echo source1 &gt; /tmp/source1/1
# echo source2 &gt; /tmp/source2/2
</code></pre>

<p>And copied these directories to /tmp/dest with lazycopy command.</p>

<pre><code># lazycopy /tmp/source0 /tmp/source1 /tmp/source2 /tmp/dest
['/tmp/source0', '/tmp/source1', '/tmp/source2'] -&gt; /tmp/dest
</code></pre>

<p>Confirmed that three files wiere there and the content of one of the files.</p>

<pre><code># ls /tmp/dest/
0  1  2
# cat /tmp/dest/0
source0
</code></pre>

<p>Changed the content of /tmp/dest/0 and confirmed that /tmp/source0/0 was not changed.</p>

<pre><code># echo dest &gt; /tmp/dest/0 
# cat /tmp/dest/0 
dest
# cat /tmp/source0/0 
source0
</code></pre>

<p>Lazycopy implements copy-on-write by mounting directories with aufs like this.</p>

<pre><code># mount
...
none on /tmp/dest type aufs (rw,br:/tmp/dest/.aufs/0=rw:/tmp/source0=ro:/tmp/source1=ro:/tmp/source2=ro)
</code></pre>

<p>Lazycopy creates .aufs/0 directory in the destination directory if it doesn&#8217;t exist and mounts it with rw mode as one of the aufs branch.Other source directories are mounted with ro mode, so files in these directories will not be changed.</p>

<p>Changed files and newly created files are saved under /tmp/dest/.aufs/0 directory.So you can see the directory structures like this after unmounting /tmp/dest.</p>

<pre><code># touch /tmp/dest/3
# umount /tmp/dest
# tree -a /tmp/dest
/tmp/dest
`-- .aufs
    `-- 0
        |-- .wh..wh..tmp
        |-- .wh..wh.aufs
        |-- .wh..wh.plnk
        |-- 0
        `-- 3
</code></pre>

<p>So if you unmount /tmp/dest directory and run lazycopy with same options again, you can see the changed files and created files again.</p>
]]></content>
  </entry>
  
</feed>

