<?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"
	>

<channel>
	<title>おれ最前線ねっと</title>
	<atom:link href="http://ore.saizensen.net/feed" rel="self" type="application/rss+xml" />
	<link>http://ore.saizensen.net</link>
	<description>イェ〜〜ィ。見てる〜〜〜？？</description>
	<pubDate>Mon, 22 Dec 2008 08:03:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>[CakePHP]CakePHP1.2のfind時にDBカラムを型変換して検索条件にする方法。</title>
		<link>http://ore.saizensen.net/archives/197</link>
		<comments>http://ore.saizensen.net/archives/197#comments</comments>
		<pubDate>Mon, 22 Dec 2008 07:56:51 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[スクリプト]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=197</guid>
		<description><![CDATA[				
				$cond&#91;&#34;to_char(Hoge.date, 'YYYYMMDD') LIKE '%20081222%' and \&#34;Hoge\&#34;.\&#34;id\&#038;qu [...]]]></description>
			<content:encoded><![CDATA[				
				<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000033;">$cond</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;to_char(Hoge.date, 'YYYYMMDD') LIKE '%20081222%' and <span style="color: #000099; font-weight: bold;">\&quot;</span>Hoge<span style="color: #000099; font-weight: bold;">\&quot;</span>.<span style="color: #000099; font-weight: bold;">\&quot;</span>id<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$hoge</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Hoge&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>こんな感じで。<br />
私、PostgreSQLしか使わんのでMySQLはよく分からんけど、<br />
どっちもDB関数使いたければ検索条件のカラム名の前に突っ込んだらイイんじゃないかと。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/197/feed</wfw:commentRss>
		</item>
		<item>
		<title>[CakePHP]CakePHP1.2の日付選択リストの月表記を英語から数字へ変更する方法。[FormHelper]</title>
		<link>http://ore.saizensen.net/archives/191</link>
		<comments>http://ore.saizensen.net/archives/191#comments</comments>
		<pubDate>Mon, 22 Dec 2008 07:53:16 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[cakephp]]></category>

		<category><![CDATA[スクリプト]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=191</guid>
		<description><![CDATA[				
				&#60; ?php
$form-&#62;options&#91;'month'&#93; = array_combine&#40;range&#40;1, 12&#41;, range&#40;1, 12&#41;&#41;;
?&#62;
&#60; ?php echo $form-&#62;year&#40;&#34;Hoge.date&#34;, date&#40;&#34;Y&#34;&#41;-1, date&#40;&#34;Y&#34;&#41;&#41;; ?&#62;年
&#60; ?php echo $form-&#62;month&#40;&#34;Hoge.date&#34;&#41;; ?&#62;月
&#60; ?php echo $form-&#62;day&#40;&#34;Hoge.date&#34;&#41;; ?&#62;日
				
				
				floatingdays - CakePHP 1.2 のFormHelperで日付選択リストを作る 
				
				echo $form-&#62;datetime&#40;'cal', 'YMD', 'NONE', null, array&#40;'monthNames' =&#62; false&#41;&#41;;

っていう方法もそういえば有りましたねぇ。ということでメモメモ。
]]></description>
			<content:encoded><![CDATA[				
				<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #000033;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'month'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> array_combine<span style="color: #009900;">&#40;</span><span style="color: #990000;">range</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">range</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span> ?php <span style="color: #990000;">echo</span> <span style="color: #000033;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">year</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hoge.date&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #cc66cc;">-1</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>年
<span style="color: #339933;">&lt;</span> ?php <span style="color: #990000;">echo</span> <span style="color: #000033;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">month</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hoge.date&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>月
<span style="color: #339933;">&lt;</span> ?php <span style="color: #990000;">echo</span> <span style="color: #000033;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">day</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hoge.date&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>日</pre></div></div>
				
				<p><a href="http://fdays.blogspot.com/2008/09/form-select-echo-form-mdy-none.html"><br />
				floatingdays - CakePHP 1.2 のFormHelperで日付選択リストを作る </a></p>
				
				<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #990000;">echo</span> <span style="color: #000033;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">datetime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cal'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'YMD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'NONE'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'monthNames'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>っていう方法もそういえば有りましたねぇ。ということでメモメモ。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/191/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Ubuntu]Ubuntu8.10でRailsをアップデートしたよ。[Rails]</title>
		<link>http://ore.saizensen.net/archives/187</link>
		<comments>http://ore.saizensen.net/archives/187#comments</comments>
		<pubDate>Fri, 12 Dec 2008 02:51:05 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[スクリプト]]></category>

		<category><![CDATA[インストールメモ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=187</guid>
		<description><![CDATA[				Rails2.1.0をインストールしていたけど、新しいRails2.2.2をインストールするよ。
				
				rubygemsのバージョンをアップデートする。
				
% sudo gem install [...]]]></description>
			<content:encoded><![CDATA[				<p><strong>Rails2.1.0</strong>をインストールしていたけど、新しい<strong>Rails2.2.2</strong>をインストールするよ。</p>
				<ol>
				<li><strong>rubygems</strong>のバージョンをアップデートする。
				<pre>
% sudo gem install rubygems-update
% sudo gem update rubygems-update
</pre>
				</li>
				<li><strong>Rails</strong>をインストールする。
				<pre>% sudo gem update rails</pre>
<p>MySQLのドライバーがねーよ！とか言われた人はMysqlのドライバーもインストールする。↓</p>
<pre>
%sudo apt-get install libmysqlclient15-dev
%sudo gem install mysql
</pre>
				<p>他にもインストールしたいのあれば参考に→<a href="http://ore.saizensen.net/archives/148">[Ubuntu]Ubuntu8.10へRailsをインストールしたよ。[Rails]</a>
				</li>
				<li>既存のアプリケーションが利用している<strong>Rails</strong>のバージョンを上げる。
				<pre>
% cd /var/www/rails/app  ## Railsアプリケーションまで移動する。移動先は自分の環境に合わせて
% vi config/environment.rb
RAILS_GEM_VERSION = '2.1.0'
↓ ## 使いたいRailsのバージョンへ修正。
RAILS_GEM_VERSION = '2.2.2'
% rake rails:update
</pre>
				</li>
				</ol>
				<p>以上で<strong>Rails</strong>のバージョンが上がったよと。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/187/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Ubuntu]ThinkpadX61へUbuntu8.10をインストールしたら日本語入力出来なかった。[ThinkpadX61]</title>
		<link>http://ore.saizensen.net/archives/179</link>
		<comments>http://ore.saizensen.net/archives/179#comments</comments>
		<pubDate>Thu, 04 Dec 2008 12:41:29 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[SCIM]]></category>

		<category><![CDATA[ThinkpadX61]]></category>

		<category><![CDATA[インストールメモ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=179</guid>
		<description><![CDATA[				昨日、重い腰を起こして家のThinkpadX61へUbuntu8.10をインストールしました。
				[Ubuntu]Ubuntu8.10をインストールしてみたよ。で、インストール設定メモ。[Linux]を、そ [...]]]></description>
			<content:encoded><![CDATA[				<p>昨日、重い腰を起こして家の<strong>ThinkpadX61</strong>へ<strong>Ubuntu8.10</strong>をインストールしました。<br />
				<a href="http://ore.saizensen.net/archives/115">[Ubuntu]Ubuntu8.10をインストールしてみたよ。で、インストール設定メモ。[Linux]</a>を、そのままに色々とインストールし初期設定を終えました。</p>
				<p>で、テキストエディタで<strong>日本語入力</strong>をしようと[Ctrl]+[Space]を押して<strong>scim</strong>を起動しようとしても起動しない。連打しても起動しない。<br />
				キーボード設定、SCIM入力メソッド設定と無限ループのように設定しなおし続けても・・・沈黙。</p>
				<p>ということで、Google先生の出番です。見つかったのは以下のページ↓。<br />
				<a href="http://http://www.ashineko.com/index.php?option=com_content&#038;view=article&#038;catid=43%3Agadgets&#038;id=214%3Aubuntu-804-hardy-heron&#038;Itemid=57&#038;lang=ja">Ubuntu 8.04 Hardy Heronで日本語入力</a><br />
				ここに載ってることをそのままやったら<strong>日本語入力</strong>出来るようになりました。<br />
				一応メモっとく。</p>
				<ul>
				<li>Synaptic Package Managerを起動</li>
				<li>&#8220;<strong>SCIM</strong>&#8220;でパッケージを検索
				<pre>
scim-anthy
scim-bridge-agent
scim-bridge-agent-gtk
scim-bridge-agent-qt
scim-bridge-agent-qt4
scim-gtk2-immodule
scim-qtimm
</pre>
				<p>をインストールするパッケージとしてマーク。インストール済みのは再インストール指定。</li>
				<li>&#8220;<strong>ANTHY</strong>&#8220;でパッケージを検索
				<pre>kasumi</pre>
<p>をインストールするパッケージとしてマーク。インストール済みのは再インストール指定。</li>
<li>インストール実行。</li>
<li>次に、<strong>Ubuntuの起動時にSCIMを標準の言語入力インターフェイスとして定義するため</strong>にファイル作成 or 編集
<pre># vi gedit /etc/X11/Xsession.d/74custom-scim_startup</pre>
				<p>74custom-scim_startupが既に存在する場合は以下の行を追加、ない場合は新規に作成します。</p>
				<pre>
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE="scim"
export XIM_PROGRAM="scim -d"
export QT_IM_MODULE="scim"
</pre>
				</li>
				<li>OS再起動。</li>
				</ul>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/179/feed</wfw:commentRss>
		</item>
		<item>
		<title>[CentOS]PostfixでSubmissionポート(587番)を使う。[Postfix]</title>
		<link>http://ore.saizensen.net/archives/172</link>
		<comments>http://ore.saizensen.net/archives/172#comments</comments>
		<pubDate>Fri, 28 Nov 2008 04:44:30 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[Postfix]]></category>

		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=172</guid>
		<description><![CDATA[				先日のエントリー[CentOS]いつの間にかCentOS4.7サーバーからGmailへメール送信出来なくなってた。[Postfix]で、
				OP25B対策にIPマスカレード対応ルーターで、ルーター外側のポー [...]]]></description>
			<content:encoded><![CDATA[				<p>先日のエントリー<a href="http://ore.saizensen.net/archives/155">[CentOS]いつの間にかCentOS4.7サーバーからGmailへメール送信出来なくなってた。[Postfix]</a>で、<br />
				<strong>OP25B対策</strong>にIPマスカレード対応ルーターで、ルーター外側のポート587を、ルーター内側のポート25に対応させるってっ書いて、一部のサーバーのルーターに設定したのですが全くポートが開かず・・・って感じでハマッってしまった。<br />
				そのルーターが<a href="http://www.mrl.co.jp/product/nwgopt100e.htm">NetGenesis SuperOPT100E</a>なのですが、よく商品詳細ページを見ていると「<strong>静的IPマスカレード対応</strong>」って書いてある・・・・・ポート変換出来んのかい！！</p>
				<p>ということで、587番→25番へポート変換はやめて、587番→587番とそのままで<strong>Postfix側でSubmissionポート(587番)を対応させる</strong>ことにします。</p>
				<ul>
				<li># vi /etc/postfix/master.cf<br />
				以下の行のコメントアウトを外して有効にする。</p>
				<pre>
submission inet n - n - - smtpd
</pre>
				</li>
				<li>/etc/services に以下の行があるか確認。
				<pre>
submission 587/tcp msa # mail message submission
submission 587/udp msa # mail message submission
</pre>
				</li>
				<li>ルーターのIPマスカレード設定（ポート変換）でTCP587→TCP587を開ける。</li>
				<li>iptablesのTCP587ポートも開ける。
				<pre>iptables -A INPUT -p tcp --dport 587 -j ACCEPT</pre>
</li>
</ul>
<p>これで、PostfixがSubmissionポート(587番)で待ち受け開始します。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/172/feed</wfw:commentRss>
		</item>
		<item>
		<title>[CentOS]CentOS5の「PHP、MySQL、PostgreSQL」のバージョンをYumでアップデートする。</title>
		<link>http://ore.saizensen.net/archives/163</link>
		<comments>http://ore.saizensen.net/archives/163#comments</comments>
		<pubDate>Wed, 26 Nov 2008 16:45:39 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[DB]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[PostGIS]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[スクリプト]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[インストールメモ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=163</guid>
		<description><![CDATA[				なんかサーバーを弄ってたら、PHPとかMySQLとかPostgresのバージョンを無性に上げたくなってきたからバージョンアップした。全部、自前でbuildなんてやってられんので全てYumで管理します。
				C [...]]]></description>
			<content:encoded><![CDATA[				<p>なんかサーバーを弄ってたら、PHPとかMySQLとかPostgresのバージョンを無性に上げたくなってきたからバージョンアップした。全部、自前でbuildなんてやってられんので全てYumで管理します。<br />
				CentOSのリポジトリのPHPなんて5.1.6とかPostgresが8.1とか・・・ねぇ？って感じだったのでつい・・・<br />
				ということでインストールメモ開始。このブログ、インストールメモ専門になってきたな・・・</p>
				<ol>
				<li>まず標準のCentOSのリポジトリからPHP、MySQL、PostgreSQLを除外する.。
				<pre>
# vi /etc/yum.repos.d/CentOS-Base.repo
[base] ## [base]の項目に↓を追加
exclude=postgresql* php* mysql*
[updates] ## [updates]の項目にも↓を追加
exclude=postgresql* php* mysql*
</pre>
				</li>
				<li>PHPとMySQLをアップデートする用にまずリポジトリ追加。
				<pre>
# rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
# vi /etc/yum.repos.d/utterramblings.repo ## ←のファイル作って以下の内容で保存。
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
</pre>
				</li>
				<li>PostgreSQLをアップデートする用にやっぱりまずはリポジトリ追加。
				<pre>
# wget http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-5.noarch.rpm
# rpm -ivh pgdg-centos-8.3-5.noarch.rpm
</pre>
				</li>
				<li>PHPとMySQLとPostgreSQLをアップデート。
				<pre>
# yum update
</pre>
				<ul>
				<li><strong>※ x86_64な環境の人で、既にMySQLをインストールしている人は一度削除してからインストールしなおしてください。(mysql、mysql-devel、mysql-server)</strong>
				<pre>
# yum -y remove mysql mysql-devel mysql-server
# yum -y install mysql mysql-devel mysql-server
</pre>
				</li>
				<li><strong>※ 既にPostgreSQLをインストール済の人で「古いバージョンの〜〜〜アップグレードする必要があります。」と言われた場合</strong>
				<ol>
				<li>dataを削除、またはリネーム
				<pre># mv /var/lib/pgsql/data /var/lib/pgsql/data.old</pre>
</li>
<li>DB初期化
<pre># /etc/init.d/postgresql initdb</pre>
				</li>
				<li>PostgreSQL再起動
				<pre># /etc/init.d/postgresql restart</pre>
</li>
</ol>
</li>
</ul>
</li>
<li>リポジトリ追加したらyumでXcacheとかPostGISがインストールできるようになってたからインストールした。
<pre># yum -y install php-xcache postgis</pre>
				</li>
				</ol>
				<p>各設定は以下を参考に。Ubuntu用に書いたけどほとんどいっしょなので。</p>
				<ul>
				<li><a href="http://ore.saizensen.net/archives/122">[Ubuntu]Ubuntu8.10へApache、PHP、MySQL、PostgreSQLをインストールする。[LAMP]</a></li>
				<p>php.ini ： /etc/php.ini<br />
				my.cnf ： /etc/my.cnf<br />
				postgresql.conf ： /var/lib/pgsql/data/postgresql.conf<br />
				pg_hba.conf ： /var/lib/pgsql/data/pg_hba.conf</p>
				<li><a href="http://ore.saizensen.net/archives/113">[PHP]CentOSへXCacheをインストールしたメモ。[XCache]</a><br />
				xcache.ini ： /etc/php.d/xcache.ini
				</li>
				<li><a href="http://ore.saizensen.net/archives/160">[Ubuntu]Ubuntu8.10でPostGISを使えるようにする。[PostGIS]</a><br />
				lwpostgis.sql ： /usr/share/pgsql/contrib/lwpostgis.sql<br />
				spatial_ref_sys.sql ： /usr/share/pgsql/contrib/spatial_ref_sys.sql
				</li>
				</ul>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/163/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Ubuntu]Ubuntu8.10でPostGISを使えるようにする。[PostGIS]</title>
		<link>http://ore.saizensen.net/archives/160</link>
		<comments>http://ore.saizensen.net/archives/160#comments</comments>
		<pubDate>Wed, 26 Nov 2008 09:29:52 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[DB]]></category>

		<category><![CDATA[PostGIS]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[インストールメモ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=160</guid>
		<description><![CDATA[				
				PostgreSQLとかPostGISをインストールしてない人はインストールする。
				# apt-get install postgresql postgresql-8.3-postgis
Pos [...]]]></description>
			<content:encoded><![CDATA[				<ol>
				<li>PostgreSQLとかPostGISをインストールしてない人はインストールする。
				<pre># apt-get install postgresql postgresql-8.3-postgis</pre>
<p>Postgresの設定は<a href="http://ore.saizensen.net/archives/122">[Ubuntu]Ubuntu8.10へApache、PHP、MySQL、PostgreSQLをインストールする。[LAMP]</a>でも参照して下さい。</li>
<li>PostGIS用に初期化済テンプレートDBを構築する。
<pre>
$ su - postgres
$ createdb templategis
$ createlang plpgsql templategis
$ psql -d templategis -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql
$ psql -d templategis -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
</pre>
				</li>
				<li>PostGIS用テンプレートDBを利用して、作成したいDBを作る。
				<pre>createdb -T templategis newdb</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/160/feed</wfw:commentRss>
		</item>
		<item>
		<title>[CentOS]いつの間にかCentOS4.7サーバーからGmailへメール送信出来なくなってた。[Postfix]</title>
		<link>http://ore.saizensen.net/archives/155</link>
		<comments>http://ore.saizensen.net/archives/155#comments</comments>
		<pubDate>Wed, 26 Nov 2008 03:01:58 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[Postfix]]></category>

		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=155</guid>
		<description><![CDATA[				昨日、社内に置いているCentOS4.7サーバーから自分のGmailへメール送信してみたら、Undelivered Mail Returned to Senderってメーラーデーモンさんがリターンメール返してきた [...]]]></description>
			<content:encoded><![CDATA[				<p>昨日、社内に置いているCentOS4.7サーバーから自分のGmailへメール送信してみたら、<strong>Undelivered Mail Returned to Sender</strong>ってメーラーデーモンさんがリターンメール返してきた。↓中身。</p>
				<pre>
＜bubbkis ＠ gmail.com＞: host gmail-smtp-in.l.google.com[209.85.143.114] said:
    550-5.7.1 [**.**.**.**] The IP you're using to send mail is not
    authorized 550-5.7.1 to send email directly to our servers. Please use the
    SMTP 550-5.7.1 relay at your service provider instead. Learn more at
    550 5.7.1 http://mail.google.com/support/bin/answer.py?answer=10336
    i6si3435826tid.5 (in reply to end of DATA command)
</pre>
				<p>英語よくわからんけど、「メール送るときはプロバイダーのSMTP使って送ってこい、カス。」と言っとるわけですね。<br />
				はい、分かりましたということで今回は、<br />
				<strong>PostfixのRelayhost設定にプロバイダーのSMTPを指定して、メール送信は全部プロバイダーのSMTP経由で送信する</strong>というメモです。(当方のプロバイダーはアサヒネットなので、アサヒネットじゃない人は適当に変えて下さい。)<br />
				ついでに社外からこのSMTPサーバーを使うときにOP25Bに引っかかる人がいるのでOP25B対策もしました。（IPマスカレード対応ルーターで、ルーター外側のポート587を、ルーター内側のポート25に対応させただけですけど。)</p>
				<ol>
				<li># vi/etc/postfix/main.cf
				<pre>
## relayhostへプロバイダーのSMTPサーバーを指定。
relayhost = [op25b.asahi-net.or.jp]

## SMTP Submission port Setting
## ファイルの最後に追加
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/authinfo
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = cram-md5,digest-md5,plain,login
</pre>
				<p>smtp_sasl_mechanism_filter = へ設定する値の調べ方は、</p>
				<pre>
# telnet プロバイダのSMTPサーバー名 25 または 587
Trying 202.224.39.196...
Connected to mail.asahi-net.or.jp (202.224.39.196).
Escape character is '^]'.
220 mail.asahi-net.or.jp ESMTP Postfix
ehlo localhost ## ←タイプする。
250-mail.asahi-net.or.jp
250-PIPELINING
250-SIZE
250-ETRN
250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5
250-AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5 ## ←これをsmtp_sasl_mechanism_filterへ設定する。
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit ## ←タイプする。
221 2.0.0 Bye
Connection closed by foreign host.
</pre>
				</li>
				<li># vi /etc/postfix/master.cf
				<pre>
## 以下の3行のコメントアウトを外す。
submission inet n      -       n       -       -       smtpd
        -o smtpd_etrn_restrictions=reject
        -o smtpd_client_restrictions=permit_sasl_authenticated,reject
</pre>
				</li>
				<li>プロバイダーのSMTPサーバーへの認証情報を設定する。(ユーザー名、パスワードはプロバイダー契約時に設定したもの。)
				<pre>
# echo [SMTPサーバー名]:587 ユーザー名:パスワード > /etc/postfix/authinfo
# postmap /etc/postfix/authinfo
</pre>
				<p>どこかのサイトで
				<pre># chmod 640 /etc/postfix/authinfo</pre>
<p>ってroot以外参照できないようにパーミッション変更してたのを真似たら、一切ログイン出来なくなってしまってハマった。
</li>
<li># /etc/rc.d/init.d/postfix reload でPostfix設定反映</li>
</ol>
<p>以上で、メール送信はプロバイダーのSMTPサーバー経由になりました。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/155/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Ubuntu]Ubuntu8.10へRailsをインストールしたよ。[Rails]</title>
		<link>http://ore.saizensen.net/archives/148</link>
		<comments>http://ore.saizensen.net/archives/148#comments</comments>
		<pubDate>Fri, 21 Nov 2008 08:18:09 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[スクリプト]]></category>

		<category><![CDATA[インストールメモ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=148</guid>
		<description><![CDATA[				
				rubyとかrailsとかImagemagickとかごった煮インストール。
				
% sudo apt-get install ruby ruby-dev irb rubygems libruby-extras libgit-ruby librmagick-ruby vim-ruby vim-rails imagemagick libmagick++9-dev sqlite libsqlite0-dev libsqlite3-dev sqlitebrowser libmysqlclient15-dev  postgresql-server-dev-8.3
% sudo apt-get install lighttpd libfcgi-dev
% sudo gem install rails
% sudo gem install rmagick
% sudo gem install sqlite3-ruby
% sudo gem install mysql
% sudo gem install postgres
% sudo gem install postgres-pr
% sudo gem install vim-ruby
% [...]]]></description>
			<content:encoded><![CDATA[				<ol>
				<li>rubyとかrailsとかImagemagickとかごった煮インストール。
				<pre>
% sudo apt-get install ruby ruby-dev irb rubygems libruby-extras libgit-ruby librmagick-ruby vim-ruby vim-rails imagemagick libmagick++9-dev sqlite libsqlite0-dev libsqlite3-dev sqlitebrowser libmysqlclient15-dev  postgresql-server-dev-8.3
% sudo apt-get install lighttpd libfcgi-dev
% sudo gem install rails
% sudo gem install rmagick
% sudo gem install sqlite3-ruby
% sudo gem install mysql
% sudo gem install postgres
% sudo gem install postgres-pr
% sudo gem install vim-ruby
% sudo gem install mongrel
% sudo gem install mongrel_cluster
% sudo gem install fcgi
% sudo gem install net-ssh
% sudo gem install net-sftp
% sudo gem install Selenium
% sudo gem install jpmobile
% sudo gem install ruby-debug
% sudo gem install refe
% sudo gem install xml-simple
</pre>
				</li>
				<li>次に<a href="http://i.loveruby.net/ja/prog/refe.html">Refe</a>をインストールする。
				<ul>
				<li>インストール。
				<pre>
% wget http://i.loveruby.net/archive/refe/refe-0.8.0-withdocsrc.tar.gz
% tar zxvf refe-0.8.0-withdocsrc.tar.gz
% cd refe-0.8.0
% ruby setup.rb config
% ruby setup.rb setup
% sudo ruby setup.rb install
</pre>
				</li>
				<li>環境変数を設定する。
				<pre>
$ vi .zshrc
# Refe
REFE_DATA_DIR=/usr/share/refe
export REFE_DATA_DIR
</pre>
				</li>
				</ul>
				</li>
				</ol>
				<p><strong>※</strong>　% sudo gem install xml-simple をインストールのは、Ubuntu8.10で ruby script/generate　とかすると以下のwarningを吐く為。</p>
				<pre>
/usr/lib/ruby/1.8/xmlsimple.rb:275: warning: already initialized constant KNOWN_OPTIONS
/usr/lib/ruby/1.8/xmlsimple.rb:280: warning: already initialized constant DEF_KEY_ATTRIBUTES
/usr/lib/ruby/1.8/xmlsimple.rb:281: warning: already initialized constant DEF_ROOT_NAME
/usr/lib/ruby/1.8/xmlsimple.rb:282: warning: already initialized constant DEF_CONTENT_KEY
/usr/lib/ruby/1.8/xmlsimple.rb:283: warning: already initialized constant DEF_XML_DECLARATION
/usr/lib/ruby/1.8/xmlsimple.rb:284: warning: already initialized constant DEF_ANONYMOUS_TAG
/usr/lib/ruby/1.8/xmlsimple.rb:285: warning: already initialized constant DEF_FORCE_ARRAY
/usr/lib/ruby/1.8/xmlsimple.rb:286: warning: already initialized constant DEF_INDENTATION
/usr/lib/ruby/1.8/xmlsimple.rb:287: warning: already initialized constant DEF_KEY_TO_SYMBOL
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/148/feed</wfw:commentRss>
		</item>
		<item>
		<title>[Ubuntu]Ubuntu8.10へDropboxをインストールしたよ。真似したんですけどね。[Dropbox]</title>
		<link>http://ore.saizensen.net/archives/135</link>
		<comments>http://ore.saizensen.net/archives/135#comments</comments>
		<pubDate>Thu, 13 Nov 2008 09:21:03 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[UNIX]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[インストールメモ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=135</guid>
		<description><![CDATA[				よくDropboxって文字をweb上では見てたんですけど、今まで使ってなかったんですよね。
				おれ最前線ねっとにssh-fuseで繋げて必要なファイルをバックアップしたりリストアしたりしてました。
				 [...]]]></description>
			<content:encoded><![CDATA[				<p>よく<a href="https://www.getdropbox.com/">Dropbox</a>って文字をweb上では見てたんですけど、今まで使ってなかったんですよね。<br />
				<a href="http://ore.saizensen.net">おれ最前線ねっと</a>にssh-fuseで繋げて必要なファイルをバックアップしたりリストアしたりしてました。<br />
				とまぁそれで何も不自由してなかったんですけど、なんか他の人が快適すぎてウマーって言ってるのを見るとちょっと真似してみるかと。</p>
				<p>と釣られましたんで以下メモ。インストールはすげー簡単。<strong>ubuntu</strong>ならさらに簡単。<strong>Dropbox</strong>のサイト上に載ってるのそのままやればOK。</p>
				<ol>
				<li>/etc/apt/sources.listへDropboxのリポジトリを追加する。
				<pre>
deb http://linux.getdropbox.com/ubuntu intrepid main
deb-src http://linux.getdropbox.com/ubuntu intrepid main
</pre>
				</li>
				<li>インストールする。
				<pre>
 $ sudo apt-get update
 $ sudo apt-get install nautilus-dropbox
 $ killall nautilus
</pre>
				</li>
				</ol>
				<p>インストールはこんだけ。<br />
				あとは<a href="http://d.hatena.ne.jp/a2c/20081028/1225177946">DropBoxを使って、まっさらな環境から5分で継続的で快適な環境を作る方法</a>を真似する。つーか、これ見て「あ、Dropbox入れよう。」と思いました。<br />
				そのまま載ってるシェルスクリプトをコピペして実行してみたら動かなかったのでちょっと変えた。</p>
				<ol>
				<li>Dropboxディレクトリの中に環境構築用のドットファイルディレクトリを作る。</li>
				<li>作ったディレクトリに.vimrcとか.vimとか.zshrcとか↓のシェルスクリプトとかをぶち込む。</li>
				<li>アップロードしたシェルスクリプトに実行権限与えて実行。</li>
				<li>終わり。</li>
				</ol>
				
				<div class="wp_syntax"><div class="code"><pre class="bash"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">path=</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">&quot;.vim&quot;</span> <span style="color: #ff0000;">&quot;.vimrc&quot;</span> <span style="color: #ff0000;">&quot;.zshrc&quot;</span> <span style="color: #ff0000;">&quot;.screenrc&quot;</span> <span style="color: #ff0000;">&quot;.vimperatorrc&quot;</span> <span style="color: #ff0000;">&quot;.vimperator&quot;</span> <span style="color: #ff0000;">&quot;.mozilla&quot;</span> <span style="color: #ff0000;">&quot;.inputrc&quot;</span> <span style="color: #ff0000;">&quot;.Xmodmap&quot;</span>
<span style="color: #000000; font-weight: bold;">do</span>
 <span style="color: #c20cb9; font-weight: bold;">mv</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$i</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$i</span>.org
 <span style="color: #c20cb9; font-weight: bold;">ln</span> -s <span style="color: #007800;">$path</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$i</span> ~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$i</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/135/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
