<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>samuraiEngineer</title>
	<atom:link href="http://samurai-engineer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://samurai-engineer.com</link>
	<description>Publishing information of technologies  from Japan</description>
	<lastBuildDate>Wed, 27 Jul 2011 00:41:45 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/feed/" />
		<item>
		<title>[php function] convert 16bits(md5) string to 64bits string on php.</title>
		<link>http://samurai-engineer.com/2011/07/04/convert-32bit-string-to-64bit-string-on-php/</link>
		<comments>http://samurai-engineer.com/2011/07/04/convert-32bit-string-to-64bit-string-on-php/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 07:23:18 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[programing]]></category>
		<category><![CDATA[bit]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://samurai-engineer.com/?p=94</guid>
		<description><![CDATA[TweetYou can create a short url, if you have a long url. !!!!but I hoped more short than url. example long url:  http://samurai-engineer.com/id/3d6e8ab5a32006ae5b2a2e8ccd8b39ff 63 lengths ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ short url: http://samurai-engineer.com/id/fmWaJqcw1GVrayWcPoIV(M 53 lengths code function convert_str($str, $base_number, $conv_number){ if( $base_number%2!=0 &#124;&#124; $conv_number%2!=0 &#124;&#124; $base_number [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton94" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F07%2F04%2Fconvert-32bit-string-to-64bit-string-on-php%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F07%2F04%2Fconvert-32bit-string-to-64bit-string-on-php%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p><code>You can create a </code><code>short url, if you have a long url.</code></p>
<p>!!!!but I hoped more short than url.</p>
<p>example</p>
<p>long url:  <a href="http://samurai-engineer.com/id/3d6e8ab5a32006ae5b2a2e8ccd8b39ff">http://samurai-engineer.com/id/3d6e8ab5a32006ae5b2a2e8ccd8b39ff</a> 63 lengths<br />
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓<br />
short url: <a href="http://samurai-engineer.com/id/fmWaJqcw1GVrayWcPoIV(M">http://samurai-engineer.com/id/fmWaJqcw1GVrayWcPoIV(M</a> 53 lengths</p>
<p>code</p>
<blockquote><p>function convert_str($str, $base_number, $conv_number){<br />
if( $base_number%2!=0 || $conv_number%2!=0 || $base_number == $conv_number ) {<br />
return &#8216;can not convert&#8217;;<br />
}<br />
if( $base_number &lt; $conv_number ) {<br />
$cardinal = floor($conv_number/$base_number);<br />
$decode = false;<br />
}else{<br />
$cardinal = floor($base_number/$conv_number);<br />
$decode = true;<br />
}<br />
$sign = &#8217;0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.(&#8216;;<br />
$base_band = log($base_number,$cardinal);<br />
$conv_band = log($conv_number,$cardinal);<br />
$binary = &#8221;;<br />
foreach(str_split($str,$base_band) as $s) {<br />
foreach(str_split($s) as $ss) {<br />
$p = strpos($sign, $ss);<br />
$bin = &#8221;;<br />
for($i=0;$i&lt;log($base_number,$cardinal);$i++){<br />
$sp = $p%$cardinal;<br />
$p  = floor($p/$cardinal);<br />
$bin .= $sp;<br />
}<br />
$binary .= strrev($bin);<br />
}<br />
}<br />
$r = &#8221;;<br />
if($decode){<br />
$binary = preg_replace(&#8220;#{$ck}$#&#8221;, &#8221;, $binary);<br />
}<br />
foreach(str_split($binary,$conv_band) as $s) {<br />
if(strlen($s) &lt; $conv_band){<br />
$s = $s.str_repeat(&#8217;0&#8242;,$conv_band-strlen($s));<br />
}<br />
$d = 0;<br />
$i = 0;<br />
foreach(array_reverse(str_split($s)) as $ss) {<br />
$d += $ss*pow($cardinal,$i);<br />
$i++;<br />
}<br />
$r .= substr($sign, $d, 1);<br />
}<br />
return $r;<br />
}</p></blockquote>
<p>Use</p>
<blockquote><p>//sample<br />
$hex = &#8217;3d6e8ab5a32006ae5b2a2e8ccd8b39ff&#8217;;<br />
var_dump(convert_str($hex,16,64));<br />
var_dump(convert_str(convert_str($hex,16,64),64,16));</p></blockquote>
<p>parameter</p>
<p>$str: all length.<br />
$base_number: use 2, 4, 8, 16, 32, 64<br />
$conv_number:  use 2, 4, 8, 16, 32, 64</p>
<p>notice: some time, must cut back a result string.</p>
<blockquote><p>//sample<br />
$hex = &#8217;3d6e8ab5a328addafd00&#8242;;<br />
var_dump(convert_str($hex,16,64));<br />
var_dump(convert_str(convert_str($hex,16,64),64,16));<br />
var_dump(substr(convert_str(convert_str($hex,16,64)64,16),0,20));</p></blockquote>
<p>result</p>
<blockquote><p>string(14) &#8220;fmWaJqcEHtHZ00&#8243; string(21) &#8220;3d6e8ab5a328addafd000&#8243; string(20) &#8220;3d6e8ab5a328addafd00&#8243;</p></blockquote>
<p>I didn’t get an answer about this problem.</p>
<p>You can get answers, please comment.</p>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/07/04/convert-32bit-string-to-64bit-string-on-php/&title=[php+function]+convert+16bits(md5)+string+to+64bits+string+on+php.&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/07/04/convert-32bit-string-to-64bit-string-on-php/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/07/04/convert-32bit-string-to-64bit-string-on-php/" />
	</item>
		<item>
		<title>fix message `DEPRECATION WARNING`by resque on rails3</title>
		<link>http://samurai-engineer.com/2011/06/04/fix-message-deprecation-warningby-resque-on-rails3/</link>
		<comments>http://samurai-engineer.com/2011/06/04/fix-message-deprecation-warningby-resque-on-rails3/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 16:02:09 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[sever setting]]></category>
		<category><![CDATA[deprecation warning]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[resque]]></category>

		<guid isPermaLink="false">http://samurai-engineer.com/2011/06/04/fix-message-deprecation-warningby-resque-on-rails3/</guid>
		<description><![CDATA[TweetI get message when I use resque on rails3. I fix this problem. DEPRECATION WARNING: Rake tasks in /srv/hoge/vendor/plugins/resque/tasks/redis.rake and /srv/hoge/vendor/plugins/resque/tasks/resque.rake are deprecated. Use lib/tasks instead. (called from /srv/hoge/Rakefile:7) You can fix the problem you command those lines. $ mv vendor/plugins/resque/tasks/resque.rake&#160;&#160; lib/tasks/ $ mv vendor/plugins/resque/tasks/redis.rake&#160;&#160; lib/tasks/ $ vim lib/tasks/resque.rake ## ## replace line ## ## [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton91" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F06%2F04%2Ffix-message-deprecation-warningby-resque-on-rails3%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F06%2F04%2Ffix-message-deprecation-warningby-resque-on-rails3%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I get message when I use resque on rails3. I fix this problem.</p>
<blockquote><p>DEPRECATION WARNING: Rake tasks in /srv/hoge/vendor/plugins/resque/tasks/redis.rake and /srv/hoge/vendor/plugins/resque/tasks/resque.rake are deprecated. Use lib/tasks instead. (called from /srv/hoge/Rakefile:7)</p>
</blockquote>
<p><em><font style="background-color: #e4ede2" face="Georgia">You can fix the problem you command those lines.</font></em></p>
<blockquote><p>$ mv vendor/plugins/resque/tasks/resque.rake&#160;&#160; lib/tasks/     <br />$ mv vendor/plugins/resque/tasks/redis.rake&#160;&#160; lib/tasks/      <br />$ vim lib/tasks/resque.rake      <br />##      <br />## replace line       <br />##      <br />## before&#160; <br /> $LOAD_PATH.unshift File.dirname(__FILE__) + &#8216;/../resque/lib&#8217;      <br />## after      <br />$LOAD_PATH.unshift File.dirname(__FILE__) + &#8216;/../../vendor/plugins/resque/lib&#8217;      <br />##      </p>
</blockquote>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/06/04/fix-message-deprecation-warningby-resque-on-rails3/&title=fix+message+`DEPRECATION+WARNING`by+resque+on+rails3&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/06/04/fix-message-deprecation-warningby-resque-on-rails3/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/06/04/fix-message-deprecation-warningby-resque-on-rails3/" />
	</item>
		<item>
		<title>kumofs init.d files.</title>
		<link>http://samurai-engineer.com/2011/06/03/kumofs-init-d-files/</link>
		<comments>http://samurai-engineer.com/2011/06/03/kumofs-init-d-files/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 17:08:24 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[sever setting]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[kumofs]]></category>

		<guid isPermaLink="false">http://samurai-engineer.com/2011/06/03/kumofs-init-d-files/</guid>
		<description><![CDATA[TweetI created init file for kumofs. kumofs manager’s init file. MGR=/usr/local/bin/kumo-manager LOCK=/var/lock/subsys/`echo ${0##*/}` PID=/var/run/`echo ${0##*/}` LOG=/var/log/`echo ${0##*/}`.log # Source function library. . /etc/rc.d/init.d/functions RETVAL=0 case &#34;$1&#34; in &#160;&#160;&#160; start) &#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &#34;Starting `echo ${0##*/}` server: &#34; &#160;&#160;&#160;&#160;&#160;&#160;&#160; daemon $MGR -l `hostname` -p ns2.ybj.jp:19700 -d $PID &#8211;auto-replace -o $LOG &#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$? &#160;&#160;&#160;&#160;&#160;&#160;&#160; echo &#160;&#160;&#160;&#160;&#160;&#160;&#160; [ [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton90" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F06%2F03%2Fkumofs-init-d-files%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F06%2F03%2Fkumofs-init-d-files%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I created init file for kumofs.</p>
<p>kumofs manager’s init file. </p>
<blockquote><p>MGR=/usr/local/bin/kumo-manager     <br />LOCK=/var/lock/subsys/`echo ${0##*/}`      <br />PID=/var/run/`echo ${0##*/}`      <br />LOG=/var/log/`echo ${0##*/}`.log</p>
<p># Source function library.     <br />. /etc/rc.d/init.d/functions</p>
<p>RETVAL=0</p>
<p>case &quot;$1&quot; in     <br />&#160;&#160;&#160; start)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &quot;Starting `echo ${0##*/}` server: &quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; daemon $MGR -l `hostname` -p ns2.ybj.jp:19700 -d $PID &#8211;auto-replace -o $LOG      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ $RETVAL -eq 0 ] &amp;&amp; touch $LOCK      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; stop)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &quot;Shutting down `echo ${0##*/}` server&#8230;&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; killproc -p ${PID}      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ $RETVAL -eq 0 ] &amp;&amp; rm -f $LOCK &amp;&amp; rm -f $PID      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; restart|reload)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $0 stop      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $0 start      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; *)&#160; <br />&#160;&#160;&#160; echo &quot;Usage: $0 {start|stop|restart}&quot;      <br />&#160;&#160;&#160; exit 1      <br />&#160;&#160;&#160; ;;      <br />esac</p>
<p>exit $RETVAL</p>
</blockquote>
<p><em><font style="background-color: #e4ede2" face="Georgia">kumofs gateway’s init file.</font></em></p>
<blockquote><p>EXE=/usr/local/bin/kumo-gateway     <br />LOCK=/var/lock/subsys/`echo ${0##*/}`      <br />PID=/var/run/`echo ${0##*/}`      <br />LOG=/var/log/`echo ${0##*/}`</p>
<p># Source function library.     <br />. /etc/rc.d/init.d/functions</p>
<p>RETVAL=0</p>
<p>case &quot;$1&quot; in     <br />&#160;&#160;&#160; start)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &quot;Starting `echo ${0##*/}` server: &quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; daemon $EXE -m ns.ybj.jp -p ns2.ybj.jp -t 11211 -d $PID -o $LOG      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ $RETVAL -eq 0 ] &amp;&amp; touch $LOCK      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; stop)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &quot;Shutting down `echo ${0##*/}` server&#8230;&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; killproc -p ${PID}      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ $RETVAL -eq 0 ] &amp;&amp; rm -f $LOCK &amp;&amp; rm -f $PID      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; restart|reload)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $0 stop      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $0 start      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; *)&#160; <br />&#160;&#160;&#160; echo &quot;Usage: $0 {start|stop|restart}&quot;      <br />&#160;&#160;&#160; exit 1      <br />&#160;&#160;&#160; ;;      <br />esac</p>
<p>exit $RETVAL</p>
</blockquote>
<p>kumofs server’s init file.</p>
<blockquote><p>EXE=/usr/local/bin/kumo-server     <br />LOCK=/var/lock/subsys/`echo ${0##*/}`      <br />PID=/var/run/`echo ${0##*/}`      <br />LOG=/var/log/`echo ${0##*/}`      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br /># Source function library.      <br />. /etc/rc.d/init.d/functions      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />RETVAL=0      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />case &quot;$1&quot; in      <br />&#160;&#160;&#160; start)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &quot;Starting `echo ${0##*/}` server: &quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; daemon $EXE -m ns.ybj.jp -p ns2.ybj.jp -l `hostname` -s /var/kumodb.tch -d $PID -o $LOG      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ $RETVAL -eq 0 ] &amp;&amp; touch $LOCK      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;&#160; <br />&#160;&#160;&#160; stop)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo -n &quot;Shutting down `echo ${0##*/}` server&#8230;&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; killproc -p ${PID}      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; [ $RETVAL -eq 0 ] &amp;&amp; rm -f $LOCK &amp;&amp; rm -f $PID      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;      <br />&#160;&#160;&#160; restart|reload)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $0 stop      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $0 start      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; RETVAL=$?      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;      <br />&#160;&#160;&#160; *)      <br />&#160;&#160;&#160; echo &quot;Usage: $0 {start|stop|restart}&quot;      <br />&#160;&#160;&#160; exit 1      <br />&#160;&#160;&#160; ;;      <br />esac</p>
<p>exit $RETVAL</p>
</blockquote>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/06/03/kumofs-init-d-files/&title=kumofs+init.d+files.&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/06/03/kumofs-init-d-files/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/06/03/kumofs-init-d-files/" />
	</item>
		<item>
		<title>Setting up resque-web in rails 3.0</title>
		<link>http://samurai-engineer.com/2011/05/27/setting-up-resque-web-in-rails-3-0/</link>
		<comments>http://samurai-engineer.com/2011/05/27/setting-up-resque-web-in-rails-3-0/#comments</comments>
		<pubDate>Fri, 27 May 2011 07:20:14 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[programing]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[resque]]></category>

		<guid isPermaLink="false">http://samurai-engineer.com/2011/05/27/setting-up-resque-web-in-rails-3-0/</guid>
		<description><![CDATA[Tweet #!/bin/sh # # redis&#160;&#160;&#160;&#160;&#160;&#160;&#160; init file for starting up the redis daemon # # chkconfig:&#160;&#160; &#8211; 20 80 # description: Starts and stops the redis daemon. # Source function library. . /etc/rc.d/init.d/functions name=&#34;rackup-resque-web&#34; PATH=$PATH:/opt/ruby-enterprise-1.8.7-2011.03/bin/ pidfile=&#34;/var/run/$name.pid&#34; lockfile=/var/lock/subsys/$name logfile=/srv/hoge/log/$name.log start() { &#160;&#160;&#160; echo -n $&#34;Starting $name: &#34; &#160;&#160;&#160; cd /srv/hoge &#160;&#160;&#160; rackup config/resque_config.ru &#62;$logfile 2&#62;&#38;1 &#38; [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton87" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F27%2Fsetting-up-resque-web-in-rails-3-0%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F27%2Fsetting-up-resque-web-in-rails-3-0%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><blockquote><p></p>
<p>#!/bin/sh     <br />#      <br /># redis&#160;&#160;&#160;&#160;&#160;&#160;&#160; init file for starting up the redis daemon      <br />#      <br /># chkconfig:&#160;&#160; &#8211; 20 80      <br /># description: Starts and stops the redis daemon.</p>
<p># Source function library.     <br />. /etc/rc.d/init.d/functions</p>
<p>name=&quot;rackup-resque-web&quot;     <br />PATH=$PATH:/opt/ruby-enterprise-1.8.7-2011.03/bin/      <br />pidfile=&quot;/var/run/$name.pid&quot;      <br />lockfile=/var/lock/subsys/$name      <br />logfile=/srv/hoge/log/$name.log</p>
<p>start() {     <br />&#160;&#160;&#160; echo -n $&quot;Starting $name: &quot;      <br />&#160;&#160;&#160; cd /srv/hoge      <br />&#160;&#160;&#160; rackup config/resque_config.ru &gt;$logfile 2&gt;&amp;1 &amp;      <br />^&#8212;echo $! &gt;$pidfile      <br />&#160;&#160;&#160; retval=$?      <br />&#160;&#160;&#160; [ $retval -eq 0 ] &amp;&amp; touch $lockfile &amp;&amp; daemon /bin/true      <br />^&#8212;echo      <br />&#160;&#160;&#160; return $retval      <br />}</p>
<p>stop() {     <br />&#160;&#160;&#160; echo -n $&quot;Stopping $name: &quot;      <br />&#160;&#160;&#160; killproc -p $pidfile $name      <br />&#160;&#160;&#160; retval=$?      <br />&#160;&#160;&#160; echo      <br />&#160;&#160;&#160; [ $retval -eq 0 ] &amp;&amp; rm -f $lockfile      <br />&#160;&#160;&#160; return $retval      <br />}</p>
<p>restart() {     <br />&#160;&#160;&#160; stop      </p>
<p>&#160;&#160;&#160; start     <br />}</p>
<p>reload() {     <br />&#160;&#160;&#160; false      <br />}</p>
<p>rh_status() {     <br />&#160;&#160;&#160; status -p $pidfile $name      <br />}</p>
<p>rh_status_q() {     <br />&#160;&#160;&#160; rh_status &gt;/dev/null 2&gt;&amp;1      <br />}</p>
<p>case &quot;$1&quot; in      <br />&#160;&#160;&#160; start)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rh_status_q &amp;&amp; exit 0      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;      <br />&#160;&#160;&#160; stop)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rh_status_q || exit 0      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;      <br />^&#8212;status)      <br />^&#8212;^&#8212;rh_status &amp;&amp; exit 0      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;      <br />&#160;&#160;&#160; restart)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $1      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ;;      <br />&#160;&#160;&#160; *)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo $&quot;Usage: $0 {start|stop|restart|status}&quot;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; exit 2      <br />esac      <br />exit $?      </p>
</blockquote>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/27/setting-up-resque-web-in-rails-3-0/&title=Setting+up+resque-web+in+rails+3.0&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/27/setting-up-resque-web-in-rails-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/27/setting-up-resque-web-in-rails-3-0/" />
	</item>
		<item>
		<title>How to use resque on rails 3.0. (create init files)</title>
		<link>http://samurai-engineer.com/2011/05/25/how-to-use-redis-on-rails-3-0-create-init-files/</link>
		<comments>http://samurai-engineer.com/2011/05/25/how-to-use-redis-on-rails-3-0-create-init-files/#comments</comments>
		<pubDate>Wed, 25 May 2011 13:09:38 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[programing]]></category>
		<category><![CDATA[initfile]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[resque]]></category>

		<guid isPermaLink="false">http://samurai-engineer.com/2011/05/25/how-to-use-redis-on-rails-3-0-create-init-files/</guid>
		<description><![CDATA[TweetInstall resque to rails 3.0. ./script/rails plugin install git://github.com/defunkt/resque create resque task lib/resque/queue.rb module Resque class Queue @queue = :main def self.perform(params) sleep 1 p :main_task end end end /etc/init.d/resque-main-worker #!/bin/sh # # redis&#160;&#160;&#160;&#160;&#160;&#160;&#160; init file for starting up the redis daemon # # chkconfig:&#160;&#160; &#8211; 20 80 # description: Starts and stops the redis [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton83" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F25%2Fhow-to-use-redis-on-rails-3-0-create-init-files%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F25%2Fhow-to-use-redis-on-rails-3-0-create-init-files%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>Install resque to rails 3.0.</p>
<blockquote><p>./script/rails plugin install git://github.com/defunkt/resque</p>
</blockquote>
<p>create resque task</p>
<p>lib/resque/queue.rb</p>
<blockquote><p>module Resque      <br />class Queue       <br />@queue = :main</p>
<p>def self.perform(params)      <br />sleep 1       <br />p :main_task       <br />end       <br />end       <br />end</p>
</blockquote>
<p>/etc/init.d/resque-main-worker</p>
<blockquote><p>#!/bin/sh      <br />#       <br /># redis&#160;&#160;&#160;&#160;&#160;&#160;&#160; init file for starting up the redis daemon       <br />#       <br /># chkconfig:&#160;&#160; &#8211; 20 80       <br /># description: Starts and stops the redis daemon.</p>
<p># Source function library.      <br />. /etc/rc.d/init.d/functions</p>
<p>QUEUE_NAME=$(echo ${0##*/} |sed &#8216;s/resque-\(.*\)-worker/\1/&#8217;)</p>
<p>name=&quot;resque-twitter-worker&quot;      <br />PATH=$PATH:/opt/ruby-enterprise-1.8.7-2011.03/bin/       <br />pidfile=&quot;/var/run/$name.pid&quot;       <br />lockfile=/var/lock/subsys/$name       <br />logfile=/srv/hoge/log/$name.log</p>
<p>start() {      <br />echo -n $&quot;Starting $name: &quot;       <br />cd /srv/hoge       <br />INTERVAL=10 QUEUE=$QUEUE_NAME rake resque:work &gt;$logfile 2&gt;&amp;1 &amp;       <br />echo $! &gt;$pidfile       <br />retval=$?       <br />[ $retval -eq 0 ] &amp;&amp; touch $lockfile &amp;&amp; daemon /bin/true       <br />echo       <br />return $retval       <br />}</p>
<p>stop() {      <br />echo -n $&quot;Stopping $name: &quot;       <br />killproc -p $pidfile $name       <br />retval=$?       <br />echo       <br />[ $retval -eq 0 ] &amp;&amp; rm -f $lockfile       <br />return $retval</p>
<p>}</p>
<p>restart() {      <br />stop       <br />start       <br />}</p>
<p>reload() {      <br />false       <br />}</p>
<p>rh_status() {      <br />status -p $pidfile $name       <br />}</p>
<p>rh_status_q() {      <br />rh_status &gt;/dev/null 2&gt;&amp;1       <br />}</p>
<p>case &quot;$1&quot; in      <br />start)       <br />rh_status_q &amp;&amp; exit 0       <br />$1       <br />;;       <br />stop)       <br />rh_status_q || exit 0       <br />$1       <br />;;       <br />restart)       <br />$1       <br />;;       <br />*)       <br />echo $&quot;Usage: $0 {start|stop|restart}&quot;       <br />exit 2       <br />esac       <br />exit $?</p>
</blockquote>
<p>※ resque web site: <a title="https://github.com/defunkt/resque" href="https://github.com/defunkt/resque">https://github.com/defunkt/resque</a></p>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/25/how-to-use-redis-on-rails-3-0-create-init-files/&title=How+to+use+resque+on+rails+3.0.+(create+init+files)&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/25/how-to-use-redis-on-rails-3-0-create-init-files/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/25/how-to-use-redis-on-rails-3-0-create-init-files/" />
	</item>
		<item>
		<title>Mapping the points to google map from CSV</title>
		<link>http://samurai-engineer.com/2011/05/25/mapping-the-points-to-google-map-from-csv/</link>
		<comments>http://samurai-engineer.com/2011/05/25/mapping-the-points-to-google-map-from-csv/#comments</comments>
		<pubDate>Tue, 24 May 2011 23:40:12 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[web site]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[google map]]></category>
		<category><![CDATA[point]]></category>

		<guid isPermaLink="false">http://samurai-engineer.com/2011/05/25/mapping-the-points-to-google-map-from-csv/</guid>
		<description><![CDATA[TweetI create web site that mapping the points to google map from CSV. http://googlemaps.xtask.jp/ That site convert CSV to google my map and kml file. Use: 1. Upload CSV file 2. (geocoding by google map api) 3. View google map on that site. 4. You can move to google my map from that site’s link. [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton72" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F25%2Fmapping-the-points-to-google-map-from-csv%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F25%2Fmapping-the-points-to-google-map-from-csv%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>I create web site that mapping the points to google map from CSV.</p>
<p><a title="http://googlemaps.xtask.jp/" href="http://googlemaps.xtask.jp/">http://googlemaps.xtask.jp/</a></p>
<p>That site convert CSV to google my map and kml file.</p>
<p>Use:</p>
<blockquote><p><span style="background-color: #ffffff; font-family: verdana">1. Upload CSV file       <br />2. (geocoding by google map api)        <br />3. View google map on that site.        <br />4. You can move to google my map from that site’s link.</span><span style="background-color: #ffffff; font-family: verdana">       <br /></span></p>
</blockquote>
<p>sample CSV file</p>
<blockquote><p>&quot;number&quot;,&quot;name&quot;,&quot;address&quot;,&quot;description&quot;     <br />&quot;0&quot;,&quot;apple&quot; ,&quot;1 Infinite Loop Cupertino, CA 95014&quot;,&quot;Incorporated January 4, 1977 Apple is the main manufacturer of a line of personal computers under the Apple Macintosh (Mac) brand name&quot;      <br />&quot;1&quot;,&quot;google&quot; ,&quot;1600 Amphitheatre Parkway Mountain View, CA 94043&quot;,&quot;Google Inc. is an American multinational public corporation invested in Internet search&quot;      <br />&quot;2&quot;,&quot;microsoft&quot; ,&quot;One Microsoft Way Redmond, WA 98052-6399 USA&quot;,&quot; Founded in April 4, 1975 by Bill Gates and Paul Allen”</p>
</blockquote>
<p><em><span style="font-family: georgia"><span style="background-color: #e4ede2">※ 1. support SJIS and ascii.         <br />※ 2. csv file need header line.</span></span></em></p>
<p><em><span style="font-family: georgia"><span style="background-color: #e4ede2">sample URL after uploading sample csv file. –&gt; <a title="http://googlemaps.xtask.jp/id/php4vF4Vt#map" href="http://googlemaps.xtask.jp/id/php4vF4Vt#map">http://googlemaps.xtask.jp/id/php4vF4Vt#map</a></span></span></em><em><span style="font-family: georgia"><span style="background-color: #e4ede2">         <br /></span></span></em></p>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/25/mapping-the-points-to-google-map-from-csv/&title=Mapping+the+points+to+google+map+from+CSV&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/25/mapping-the-points-to-google-map-from-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/25/mapping-the-points-to-google-map-from-csv/" />
	</item>
		<item>
		<title>&lt;div&gt; 100% to height</title>
		<link>http://samurai-engineer.com/2011/05/24/div-100-to-height/</link>
		<comments>http://samurai-engineer.com/2011/05/24/div-100-to-height/#comments</comments>
		<pubDate>Mon, 23 May 2011 15:06:04 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[100%]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://samurai-engineer.jp/2011/05/24/div-100-to-height/</guid>
		<description><![CDATA[TweetThe following source, div 100% height of the background to black. In this case also, div float Please refer to the nest and the source of the squid, so I tend to have little use for it. Supported browser: safari, firefox, ie6, ie7, ie8 &#60;html&#62; &#60;head&#62; &#60;style type=&#8221;text/css&#8221;&#62; @import &#8220;css/common.css&#8221;; &#60;/style&#62; &#60;/head&#62; &#60;body&#62; &#60;div id=&#8221;container&#8221;&#62; [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton68" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F24%2Fdiv-100-to-height%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F24%2Fdiv-100-to-height%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>The following source, div 100% height of the background to black. In this case also, div float Please refer to the nest and the source of the squid, so I tend to have little use for it.</p>
<p>Supported browser: safari, firefox, ie6, ie7, ie8</p>
<blockquote><p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
@import &#8220;css/common.css&#8221;;<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id=&#8221;container&#8221;&gt;<br />
&lt;div id=&#8221;leftContainer&#8221;&gt;<br />
&lt;!—left side contents &#8211;&gt;<br />
&lt;/div&gt;<br />
&lt;div id=&#8221;rightContainer&#8221;&gt;<br />
&lt;!—right side contents -&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&#8221;clearboth&#8221;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>common.css</p>
<blockquote><p>@charset &#8220;utf8&#8243;;</p>
<p>html,body {<br />
background-color:#808080;<br />
width:100%;<br />
height:100%;<br />
margin:0px;<br />
padding:0px;<br />
}<br />
*html #container #leftContainer{<br />
height:100%;<br />
}<br />
#container {<br />
width:1000px;<br />
min-height:100%;<br />
height:100%;<br />
margin:0px auto 0px auto;<br />
padding:0px;<br />
}<br />
#leftContainer {<br />
width:60%;<br />
min-height:100%;<br />
height:100%;<br />
background-color:#FFFFFF;<br />
float:left;<br />
margin:0;padding:0;<br />
}<br />
#rightContainer {<br />
width:40%; ,<br />
min-height:100%;<br />
height:100%;<br />
background-color:#DCDCDC;<br />
float:left;<br />
margin:0;padding:0;<br />
}</p></blockquote>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/24/div-100-to-height/&title=&lt;div&gt;+100%+to+height&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/24/div-100-to-height/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/24/div-100-to-height/" />
	</item>
		<item>
		<title>Memo: error when installed git-1.7.4</title>
		<link>http://samurai-engineer.com/2011/05/24/memo-error-when-installed-git-1-7-4/</link>
		<comments>http://samurai-engineer.com/2011/05/24/memo-error-when-installed-git-1-7-4/#comments</comments>
		<pubDate>Mon, 23 May 2011 15:01:59 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[sever setting]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[http.c]]></category>
		<category><![CDATA[install]]></category>

		<guid isPermaLink="false">http://samurai-engineer.jp/2011/05/24/memo-error-when-installed-git-1-7-4/</guid>
		<description><![CDATA[Tweetgit-1.7.4.1 http.c: *** : error: ‘struct http_object_request’ has – You can fix some errors to install cur-devel.]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton67" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F24%2Fmemo-error-when-installed-git-1-7-4%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F24%2Fmemo-error-when-installed-git-1-7-4%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>git-1.7.4.1 http.c: *** : error: ‘struct http_object_request’ has</p>
<blockquote><p> – You can fix some errors to install cur-devel.</p>
</blockquote>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/24/memo-error-when-installed-git-1-7-4/&title=Memo:+error+when+installed+git-1.7.4&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/24/memo-error-when-installed-git-1-7-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/24/memo-error-when-installed-git-1-7-4/" />
	</item>
		<item>
		<title>NSD Purimari the DNS slave server (zone transfer) to build</title>
		<link>http://samurai-engineer.com/2011/05/23/nsd-purimari-the-dns-slave-server-zone-transfer-to-build/</link>
		<comments>http://samurai-engineer.com/2011/05/23/nsd-purimari-the-dns-slave-server-zone-transfer-to-build/#comments</comments>
		<pubDate>Mon, 23 May 2011 14:58:50 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[sever setting]]></category>
		<category><![CDATA[nsd]]></category>
		<category><![CDATA[primary]]></category>
		<category><![CDATA[secondary]]></category>

		<guid isPermaLink="false">http://samurai-engineer.jp/2011/05/23/nsd-purimari-the-dns-slave-server-zone-transfer-to-build/</guid>
		<description><![CDATA[TweetThat the root servers are operated in 13 locations worldwide presence of NSD Purimari, you write down how to build a slave server. Writing Purimarisaba The contents of nsd.conf server: ip-address: ［primary server’s ip address］ hide-version: yes logfile: &#8220;/var/log/nsd.log&#8221; zone: name: &#8220;hoge.jp&#8221; zonefile: &#8220;hoge.jp.zone&#8221; notify: ［secondary server’s ip address］ NOKEY notify-retry: 5 provide-xfr: ［secondary server’s [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton66" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F23%2Fnsd-purimari-the-dns-slave-server-zone-transfer-to-build%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F23%2Fnsd-purimari-the-dns-slave-server-zone-transfer-to-build%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>That the root servers are operated in 13 locations worldwide presence of NSD Purimari, you write down how to build a slave server.<br />
Writing Purimarisaba<br />
The contents of nsd.conf</p>
<p>server:</p>
<blockquote><p>ip-address: ［primary server’s ip address］<br />
hide-version: yes<br />
logfile: &#8220;/var/log/nsd.log&#8221;</p></blockquote>
<p>zone:</p>
<blockquote><p>name: &#8220;hoge.jp&#8221;<br />
zonefile: &#8220;hoge.jp.zone&#8221;<br />
notify: ［secondary server’s ip address］ NOKEY<br />
notify-retry: 5<br />
provide-xfr: ［secondary server’s ip address］ NOKEY<br />
outgoing-interface: ［primary server’s ip address］</p></blockquote>
<p>The contents of hoge.jp.zone</p>
<blockquote><p>$TTL 3600<br />
@ IN SOA hoge.jp postmaster.hoge.jp (<br />
2011031801 ;Serial<br />
10800 ;Refresh<br />
3600 ;Retry<br />
604800 ;Expire<br />
86400 ;Negative cache TTL<br />
)</p>
<p>@ IN A [server name resolves the IP address<br />
@ IN MX 100 mail.hoge.jp<br />
www IN A [server name resolves the IP address]</p></blockquote>
<p>Writing Sekandarisaba<br />
The contents of nsd.conf</p>
<p>server:</p>
<blockquote><p>ip-address: ［secondary server’s ip address］<br />
hide-version: yes<br />
logfile: &#8220;/var/log/nsd.log&#8221;<br />
ip4-only: yes</p></blockquote>
<p>zone:</p>
<blockquote><p>name: &#8220;hoge.jp&#8221;<br />
zonefile: &#8220;hoge.jp.zone&#8221;<br />
allow-notify: ［primary server’s ip address］ NOKEY<br />
request-xfr: AXFR ［primary server’s ip address］ NOKEY<br />
outgoing-interface: [secondary server’s ip address］</p></blockquote>
<p>In the secondary, hoge.jp.zone do not need to generate files. NSD Purimari just changed is not reflected in the secondary. The following command, to transfer to the secondary.</p>
<p>1. Change the zone file (hoge.jp.zone) Serial (; Serial number) to change</p>
<blockquote><p>$ /etc/init.d/nsd rebuild<br />
$ /etc/init.d/nsd restart<br />
$ /etc/init.d/nsd notify ← # notify the zone to the secondary servers.</p></blockquote>
<p>※ If you do not change the serial no zone transfer occurs.</p>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/23/nsd-purimari-the-dns-slave-server-zone-transfer-to-build/&title=NSD+Purimari+the+DNS+slave+server+(zone+transfer)+to+build&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/23/nsd-purimari-the-dns-slave-server-zone-transfer-to-build/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/23/nsd-purimari-the-dns-slave-server-zone-transfer-to-build/" />
	</item>
		<item>
		<title>Using openswan ipsec implementation</title>
		<link>http://samurai-engineer.com/2011/05/23/using-openswan-ipsec-implementation/</link>
		<comments>http://samurai-engineer.com/2011/05/23/using-openswan-ipsec-implementation/#comments</comments>
		<pubDate>Mon, 23 May 2011 14:44:32 +0000</pubDate>
		<dc:creator>samurai</dc:creator>
				<category><![CDATA[sever setting]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[openswan]]></category>
		<category><![CDATA[sysctl]]></category>

		<guid isPermaLink="false">http://samurai-engineer.jp/2011/05/23/using-openswan-ipsec-implementation/</guid>
		<description><![CDATA[TweetThis blog report the ipsec setting to use the opneswan. How to set it here &#8212;&#8212; Procedure 1. / etc / sysctl.conf 2 configuration. Installing openswan 3. / etc / ipsec.secret 4 . create file.  / etc / ipsec.d or / etc / ipsec.d /***. conf 5 configuration. Operation check Note: Originally I thought huh [...]]]></description>
			<content:encoded><![CDATA[<div id="tweetbutton63" class="tw_button" style="float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F23%2Fusing-openswan-ipsec-implementation%2F&amp;text=samuraiEngineer&amp;related=&amp;lang=en&amp;count=vertical&amp;counturl=http%3A%2F%2Fsamurai-engineer.com%2F2011%2F05%2F23%2Fusing-openswan-ipsec-implementation%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://samurai-engineer.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div><p>This blog report the ipsec setting to use the opneswan.</p>
<p>How to set it here &#8212;&#8212;</p>
<p>Procedure</p>
<blockquote><p>1. / etc / sysctl.conf<br />
2 configuration. Installing openswan<br />
3. / etc / ipsec.secret<br />
4 . create file.  / etc / ipsec.d or / etc / ipsec.d /***. conf<br />
5 configuration. Operation check</p></blockquote>
<p>Note: Originally I thought huh dynamic not feel like a private network VPN with this other than it was unlikely that I tried to create your own scripts you can not find an implementation between the two sites were to implement.</p>
<p>1. / etc / sysctl.conf settings</p>
<blockquote><p>net.ipv4.ip_forward = 1<br />
net.ipv4.conf.all.send_redirects = 0<br />
net.ipv4.conf.default.send_redirects = 0<br />
net.ipv4.conf.eth0.send_redirects = 0<br />
net.ipv4.conf.lo.send_redirects = 0<br />
net.ipv4.conf.all.accept_redirects = 0<br />
net.ipv4.conf.default.accept_redirects = 0<br />
net.ipv4.conf.eth0.accept_redirects = 0<br />
net.ipv4.conf.lo.accept_redirects = 0</p></blockquote>
<p>And put the command as follows</p>
<blockquote><p># sysctl –p</p></blockquote>
<p>2. openswan about this installation, epel be installed using the rpm.</p>
<blockquote><p># yum install –y openswan</p></blockquote>
<p>3. / Etc / ipsec.secret Create</p>
<p>Create a new signature</p>
<blockquote><p># certutil -N -d /etc/ipsec.d</p></blockquote>
<p>Create a host key</p>
<blockquote><p># ipsec newhostkey &#8211;configdir /etc/ipsec.d/ &#8211;output /etc/ipsec.d/hostkey.secret</p></blockquote>
<p>Show Key</p>
<blockquote><p># ipsec showhostkey &#8211;left &#8211;file /etc/ipsec.d/hostkey.secrets</p></blockquote>
<p>Example Output</p>
<blockquote><p># rsakey aaa<br />
leftrsasigkey={$key1}</p></blockquote>
<p>Key to display the opposite side (opposite side of the prompt execution ※) → 1,2,3 opposite side as well to run the following command from a procedure performed.</p>
<blockquote><p># /usr/sbin/ipsec showhostkey &#8211;right &#8211;file /etc/ipsec.d/hostkey.secret</p></blockquote>
<p>Example Output</p>
<blockquote><p># rsakey bbb<br />
rightrsasigkey={$key2}</p></blockquote>
<p>4. / Etc / ipsec.d or / etc / ipsec.d /***. conf set as follows: / etc / ipsec.conf / etc / ipsec.d / *. conf to configure.</p>
<blockquote><p>[no-one@www**** hoge~][12:34:56]$ sudo cat /etc/ipsec.conf<br />
# /etc/ipsec.conf – Openswan IPsec configuration file<br />
#<br />
# Manual: ipsec.conf.5<br />
#<br />
# Please place your own config files in /etc/ipsec.d/ ending in .conf</p>
<p>version 2.0 # conforms to second version of ipsec.conf specification</p>
<p># basic configuration<br />
config setup<br />
# Debug-logging controls: &#8220;none&#8221; for (almost) none, &#8220;all&#8221; for lots.<br />
# klipsdebug=none<br />
# plutodebug=&#8221;control parsing&#8221;<br />
# For Red Hat Enterprise Linux and Fedora, leave protostack=netkey<br />
protostack=netkey<br />
nat_traversal=yes<br />
virtual_private=<br />
oe=off<br />
# Enable this if you see &#8220;failed to find any available worker&#8221;<br />
nhelpers=0<br />
#You may put your configuration (.conf) file in the &#8220;/etc/ipsec.d/&#8221; and uncomment this.<br />
include /etc/ipsec.d/*.conf</p>
<p>$ Sudo cat / etc / ipsec.d / test.conf</p>
<p>conn test<br />
left=182.34.56.78<br />
leftid=@age.test.jp<br />
leftnexthop=%defaultroute<br />
# rsakey aaa<br />
leftrsasigkey={$key1}<br />
right=182.34.56.79<br />
rightid=@sage.test.jp<br />
rightnexthop=%defaultroute<br />
# rsakey bbb<br />
rightrsasigkey={$key2}<br />
auto=add</p></blockquote>
<p>Perform the same steps on opposite sides of the above steps. / Etc / ipsec.d / *. conf do the same for</p>
<p>Run the following command to start ipsec last.</p>
<blockquote><p># /etc/init.d/ipsec start</p></blockquote>
<p>5. Operation check</p>
<p>All items are tested to run: [OK] to do to become a scratch that.</p>
<blockquote><p># Ipsec verify</p></blockquote>
<p>To establish a connection with the following command, and.</p>
<blockquote><p># sudo /usr/sbin/ipsec auto &#8211;up test #test is a alias of ipsec&#8217;s connection.</p></blockquote>
<p>If you connect successfully, the prompt should come back.</p>
<p>If the connection is confirmed ipsec.d / test.conf of auth = start auth = add a reboot to do ipsec.</p>
<p>This base has been established encrypted communication.</p>
<p>I really have been encrypted and can be found in tcpdump.</p>
<a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://samurai-engineer.com/2011/05/23/using-openswan-ipsec-implementation/&title=Using+openswan+ipsec+implementation&srcURL=http://samurai-engineer.com" target="_blank" rel="nofollow"><img
src="http://samurai-engineer.com/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a>]]></content:encoded>
			<wfw:commentRss>http://samurai-engineer.com/2011/05/23/using-openswan-ipsec-implementation/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://samurai-engineer.com/2011/05/23/using-openswan-ipsec-implementation/" />
	</item>
	</channel>
</rss>

