<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>forever 5 years old blog &#187; いろいろ</title>
	<atom:link href="http://www.f5yo.net/archives/category/%e3%81%84%e3%82%8d%e3%81%84%e3%82%8d/feed" rel="self" type="application/rss+xml" />
	<link>http://www.f5yo.net</link>
	<description>今年も 5 歳になりました</description>
	<lastBuildDate>Wed, 29 Apr 2009 01:32:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ruby-indent-command や ruby-insert-end がなくて怒られた</title>
		<link>http://www.f5yo.net/archives/148</link>
		<comments>http://www.f5yo.net/archives/148#comments</comments>
		<pubDate>Wed, 29 Apr 2009 01:32:39 +0000</pubDate>
		<dc:creator>ihara</dc:creator>
				<category><![CDATA[いろいろ]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.f5yo.net/?p=148</guid>
		<description><![CDATA[CarbonEmacs の ruby-mode を使っていて、



Symbol's function definition is void: ruby-indent-command




や



Sy [...]]]></description>
			<content:encoded><![CDATA[<p>
CarbonEmacs の ruby-mode を使っていて、
</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">Symbol's function definition is void: ruby-indent-command</pre></div></div>



<p>
や
</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">Symbol's function definition is void: ruby-insert-end</pre></div></div>



<p>
なんつって怒られるときは、/Applications/Emacs.app/Contents/Resources/lisp/progmodes/ruby-mode.el に問題があるようなので、<a href="http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/">[ruby] Index of /trunk/misc</a> この辺から ruby-mode.el をもらってきて byte-compile-file 等して、/Applications/Emacs.app/Contents/Resources/lisp/progmodes の下に保存し直してあげましょう。
</p>
<p>
そんだけ！
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f5yo.net/archives/148/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 版の Apache Shindig を試してみる</title>
		<link>http://www.f5yo.net/archives/147</link>
		<comments>http://www.f5yo.net/archives/147#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:11:39 +0000</pubDate>
		<dc:creator>ihara</dc:creator>
				<category><![CDATA[いろいろ]]></category>
		<category><![CDATA[OpenSocial]]></category>
		<category><![CDATA[Shindig]]></category>

		<guid isPermaLink="false">http://www.f5yo.net/?p=147</guid>
		<description><![CDATA[前もやったことある気がしますが、OpenSocial の RESTful API のサポートが追加されている？みたいなのでまたやってみます。
手元の MacBook にとりあえず apache と php をインストー [...]]]></description>
			<content:encoded><![CDATA[<p>前もやったことある気がしますが、OpenSocial の RESTful API のサポートが追加されている？みたいなのでまたやってみます。</p>
<p>手元の MacBook にとりあえず apache と php をインストール。以下 zsh で auto_cd しています。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:~] sudo port -d install php5 +apache2 +pear</pre></div></div>




<p>apache の設定。VirtualHost の設定ファイルを読むようにして、PHP を有効に。<p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:~] $ /opt/local/apache2/conf
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ sudo cp httpd.conf httpd.conf.bak
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ sudo vi httpd.conf
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ diff -u httpd.conf.bak httpd.conf
--- httpd.conf.bak      2009-04-14 22:30:16.000000000 +0900
+++ httpd.conf  2009-04-14 22:38:59.000000000 +0900
@@ -157,7 +157,7 @@
 #
 # If your host doesn't have a registered DNS name, enter its IP address here.
 #
-#ServerName www.example.com:80
+ServerName localhost:80
&nbsp;
 #
 # DocumentRoot: The directory out of which you will serve your
@@ -470,7 +470,7 @@
 #Include conf/extra/httpd-info.conf
&nbsp;
 # Virtual hosts
-#Include conf/extra/httpd-vhosts.conf
+Include conf/extra/httpd-vhosts.conf
&nbsp;
 # Local access to the Apache HTTP Server Manual
 #Include conf/extra/httpd-manual.conf
@@ -492,3 +492,7 @@
 SSLRandomSeed startup builtin
 SSLRandomSeed connect builtin
 &lt;/IfModule&gt;
+
+# PHP
+LoadModule php5_module modules/libphp5.so
+Include conf/extras-conf/mod_php.conf</pre></div></div>




<p>VirtualHost の設定。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:/opt/local/apache2/conf] $ extra
[Masahiro@masahiro.local:/opt/local/apache2/conf/extra] $ sudo cp httpd-vhosts.conf httpd-vhosts.conf.bak
[Masahiro@masahiro.local:/opt/local/apache2/conf/extra] $ sudo vi httpd-vhosts.conf</pre></div></div>




<p>以下の感じに編集しておきます。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">Listen 8080
&nbsp;
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any &lt;VirtualHost&gt; block.
#
&lt;VirtualHost 127.0.0.1:8080&gt;
    ServerName shindig.localhost
        DocumentRoot /opt/local/apache2/htdocs/shindig/php
&lt;/VirtualHost&gt;
&nbsp;
&lt;Directory /opt/local/apache2/htdocs/shindig/php&gt;
    AllowOverride All
&lt;/Directory&gt;</pre></div></div>




<p>ホスト名を shindig.localhost でアクセスするつもりなので、/etc/hosts に以下を追加しておきます。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">127.0.0.1 shindig.localhost</pre></div></div>




<p>PHP の設定。.html でも動くように。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:/opt/local/apache2/conf/extra] $ ..
[Masahiro@masahiro.local:/opt/local/apache2/conf] $ extras-conf
[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ sudo cp mod_php.conf mod_php.conf.bak
[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ sudo vi mod_php.conf
[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ diff -u mod_php.conf.bak mod_php.conf
--- mod_php.conf.bak    2009-04-14 23:00:12.000000000 +0900
+++ mod_php.conf        2009-04-14 23:00:39.000000000 +0900
@@ -1,6 +1,6 @@
 &lt;IfModule mod_php5.c&gt;
&nbsp;
-AddType  application/x-httpd-php         .php
+AddType  application/x-httpd-php         .html .php
 AddType  application/x-httpd-php-source  .phps
&nbsp;
 &lt;/IfModule&gt;</pre></div></div>




<p>さて Shindig のインストール。<a href="http://incubator.apache.org/shindig/developers/php/build.html">Shindig &#8211; Building and running Shindig for PHP</a> の通りにやります。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:/opt/local/apache2/conf/extras-conf] $ /opt/local/apache2/htdocs
[Masahiro@masahiro.local:/opt/local/apache2/htdocs] $ sudo mkdir shindig
[Masahiro@masahiro.local:/opt/local/apache2/htdocs] $ shindig
[Masahiro@masahiro.local:/opt/local/apache2/htdocs/shindig] $ sudo svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ .</pre></div></div>




<p>上記のページにある通り、http://shindig.localhost:8080/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml にアクセスしてみる。</p>


<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">Not Found
&nbsp;
The requested URL /gadgets/ifr was not</pre></div></div>




<p>なんつって怒られるときは shindig/php/.htaccess が効いていなそうなので、apache の設定の AllowOverride を確認します。</p>

<p>で、再度 http://shindig.localhost:8080/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml を見てみると、それっぽいモジュールが表示されるはず。</p>

<p>ここまではまだまだ準備段階。フー</p>]]></content:encoded>
			<wfw:commentRss>http://www.f5yo.net/archives/147/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMware Fusion でポートフォワードする</title>
		<link>http://www.f5yo.net/archives/144</link>
		<comments>http://www.f5yo.net/archives/144#comments</comments>
		<pubDate>Sat, 21 Mar 2009 08:49:43 +0000</pubDate>
		<dc:creator>ihara</dc:creator>
				<category><![CDATA[いろいろ]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.f5yo.net/?p=144</guid>
		<description><![CDATA[Mac で VMware Fusion を使っているんだけどゲスト OS の Windows に無性にポートフォワードしたくなることって、ありますね。

うちはフレッツ光のマンションタイプに入っていて、無線 LAN  [...]]]></description>
			<content:encoded><![CDATA[<p>Mac で VMware Fusion を使っているんだけどゲスト OS の Windows に無性にポートフォワードしたくなることって、ありますね。</p>

<p>うちはフレッツ光のマンションタイプに入っていて、無線 LAN のルータで自宅内にネットワークを組んでいるので、以下のような環境を想定します。</p>

<p>
Mac の IP アドレス: 192.168.11.2<br />
vmnet8 の IP アドレス: 172.16.27.1<br />
フォワードしたいポート: 12345<br />
</p>

<p>ルータの設定でポート 12345 へのアクセスを Mac の 192.168.11.2 にアクセスさせる設定は飛ばします。適当にやりましょう。</p>
<p>VMware Fusion の設定ですが、こんな感じで。</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="txt" style="font-family:monospace;">[Masahiro@masahiro.local:~] $ cd /Library/Application\ Support/VMware\ Fusion
[Masahiro@masahiro.local:/Library/Application Support/VMware Fusion] $ sudo cp vmnet-nat.conf vmnet-nat.conf.bak
[Masahiro@masahiro.local:/Library/Application Support/VMware Fusion] $ sudo vi vmnet-nat.conf
[Masahiro@masahiro.local:/Library/Application Support/VMware Fusion] $ diff -u vmnet-nat.conf.bak vmnet-nat.conf
--- vmnet-nat.conf.bak  2009-03-21 16:43:32.000000000 +0900
+++ vmnet-nat.conf      2009-03-21 16:44:01.000000000 +0900
@@ -41,6 +41,8 @@
 #      ssh -p 8889 root@localhost
 #8889 = 172.16.226.128:22
&nbsp;
+12345 = 172.16.27.1:12345
+
 [incomingudp]
 # UDP port forwarding example
 #6000 = 172.16.226.128:6001
[Masahiro@masahiro.local:/Library/Application Support/VMware Fusion] $ sudo ./vmware-config-net.pl
[Masahiro@masahiro.local:/Library/Application Support/VMware Fusion] $ sudo ./boot.sh --restart</pre></td></tr></table></div>




<p>3 行目で vmnet-nat.conf を編集して、[incomingtcp] の下に、ホスト OS からフォワードするポートと、フォワードするゲスト OS の IP アドレスとポートを指定します。で、16 行目で vmware-config-net.pl を実行して設定ファイルを書き換え（これで vmnet8/nat.conf が書き換わります）、17 行目でリスタート。</p>

<p>これで僕の環境だとポートフォワードできるようになったのですが、環境が違ったらダメなのかも。そしたらごめんなさい。めっちゃポートフォワードしたいねん、ってたまらん状態になったら試してみても良いかもしれません。</p>]]></content:encoded>
			<wfw:commentRss>http://www.f5yo.net/archives/144/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sSMTP で Gmail からメールを送る</title>
		<link>http://www.f5yo.net/archives/1</link>
		<comments>http://www.f5yo.net/archives/1#comments</comments>
		<pubDate>Sat, 14 Feb 2009 06:01:49 +0000</pubDate>
		<dc:creator>ihara</dc:creator>
				<category><![CDATA[いろいろ]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.f5yo.net/wordpress/?p=1</guid>
		<description><![CDATA[Debian を入れて自宅サーバとして使っていた Thinkpad T42 が Fan Error で起動しなくなり、パーツ交換するのも面倒だし中古の X40 2371-7VJ を GENO で 3 万円弱で買いました。 [...]]]></description>
			<content:encoded><![CDATA[<p>Debian を入れて自宅サーバとして使っていた Thinkpad T42 が Fan Error で起動しなくなり、パーツ交換するのも面倒だし中古の X40 2371-7VJ を <a href="http://www.geno-web.jp/">GENO</a> で 3 万円弱で買いました。サイトが多少重いときがあるみたいですが、安いですし届いたマシンもめちゃきれいでした。</p>
<p>というわけで、今回は Ubuntu 入れてみようと思い CD ドライブもないので <a href="http://unetbootin.sourceforge.net/">UNetBootin</a> で Ubuntu 8.10 を選んでインストール。Windows のパーティションもガツンと消して無事完了。</p>
<p>パッケージの管理の仕方も Debian とほとんど同じみたいだしセットアップで困ることはあまりなかったのですが、WordPress の WP-DB-Backup でバックアップを定期的にメールで送ろうとすると PHPMailer が使う /usr/sbin/sendmail を用意してあげないといけません。Sendmail とか Postfix とか別にメールサーバ立てたいわけじゃなくて送信だけしたいんスよ、というわけで sSMTP。</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo apt-get install ssmtp</pre></div></div>



<p>でインストールして、Gmail のアカウントからメールを送れるよう /etc/ssmtp/ssmtp.conf を編集します。23 行目の AuthUser と 24 行目の AuthPass は自分のアカウントのものにすれば良いです。</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids &lt; 1000
# Make this empty to disable rewriting.
root=postmaster
&nbsp;
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
mailhub=smtp.gmail.com
&nbsp;
# Where will the mail seem to come from?
rewriteDomain=gmail.com
&nbsp;
# The full hostname
hostname=gmail.com
&nbsp;
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
&nbsp;
AuthUser=your_id@gmail.com
AuthPass=your_password
useSTARTTLS=YES
# DEBUG=YES</pre></td></tr></table></div>



<p>で、テスト。最終行の test を入力して改行した後は Ctrl-D で抜けます。From と To は自分のアドレスを指定しましょう。</p>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sendmail -t
From: your_id@gmail.com
To: your_id@gmail.com
Subject: test
&nbsp;
test</pre></div></div>



<p>これで Gmail に自分からメールが届くはずです。めでたい。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.f5yo.net/archives/1/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
