<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="ja">
<title>技術メモ</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/mtips/" />
<modified>2007-08-20T08:17:26Z</modified>
<tagline></tagline>
<id>tag:www.harasho.biz,2008:/mtips/2</id>
<generator url="http://www.movabletype.org/" version="3.21-ja">Movable Type</generator>
<copyright>Copyright (c) 2007, takata</copyright>
<entry>
<title>Plesk7でTTLを短くする方法</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2007/08/plesk7ttl.html" />
<modified>2007-08-20T08:17:26Z</modified>
<issued>2007-08-20T08:16:06Z</issued>
<id>tag:www.harasho.biz,2007:/mtips/2.618</id>
<created>2007-08-20T08:16:06Z</created>
<summary type="text/plain">mysql -uadmin -p`cat /etc/psa/.psa.shado...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>DNS</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa </p>

<p>INSERT INTO misc VALUES ('SOA_TTL','300');</p>

<p>quit<br />
</p>]]>

</content>
</entry>
<entry>
<title>netstatでプロセスがわからないとき</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2007/03/netstat.html" />
<modified>2007-03-29T02:26:07Z</modified>
<issued>2007-03-29T02:24:32Z</issued>
<id>tag:www.harasho.biz,2007:/mtips/2.615</id>
<created>2007-03-29T02:24:32Z</created>
<summary type="text/plain">lsofをつかう。 lsof -i:8889 で8889ポート使ってるプロセスを...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>サーバ設定その他</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>lsofをつかう。</p>

<p>lsof -i:8889<br />
で8889ポート使ってるプロセスをみる。</p>]]>

</content>
</entry>
<entry>
<title>Servlet APIでURL等、リクエストされたパスを解析</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/09/servlet_apiurl.html" />
<modified>2006-09-30T13:29:03Z</modified>
<issued>2006-09-30T13:26:57Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.506</id>
<created>2006-09-30T13:26:57Z</created>
<summary type="text/plain">似たようなメソッドがありすぎていつもググるので覚え書きとしてここに記す。 @IT...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>似たようなメソッドがありすぎていつもググるので覚え書きとしてここに記す。</p>

<p><a href="http://www.atmarkit.co.jp/fjava/javatips/067jspservlet030.html">@IT</a></p>]]>

</content>
</entry>
<entry>
<title>「&apos;GMap2&apos;は宣言されていません。」IEでGoogleMapsが表示できない</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/09/gmap2iegooglema.html" />
<modified>2006-09-28T05:21:32Z</modified>
<issued>2006-09-28T05:17:56Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.503</id>
<created>2006-09-28T05:17:56Z</created>
<summary type="text/plain"> というエラーが起きた場合、文字コードが関係している可能性が高い。 Google...</summary>
<author>
<name>harasho</name>

<email>harada@neo-partners.co.jp</email>
</author>
<dc:subject>javascript</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p><br />
<p><br />
というエラーが起きた場合、文字コードが関係している可能性が高い。<br />
</p><br />
<p><br />
GoogleMapsはutf-8の必要があるので、コンテンツの文字コードがutf-8以外の場合、javascriptのcharsetを明示的に指定してやる必要がある。<br />
</p><br />
<p><br />
詳しくは<a href="http://www.xoopsnote.com/wiki/index.php?javascript%20%A4%C8%CA%B8%BB%FA%A5%B3%A1%BC%A5%C9">こちらのサイト</a>で解説。<br />
</p><br />
</p>]]>

</content>
</entry>
<entry>
<title>Maven2でサードパーティのjarファイルをデプロイする</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/09/maven2jar.html" />
<modified>2006-09-18T14:50:13Z</modified>
<issued>2006-09-18T14:48:49Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.494</id>
<created>2006-09-18T14:48:49Z</created>
<summary type="text/plain">mvn deploy:deploy-file \ 	-Dfile= \ 	-Dg...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>mvn deploy:deploy-file \<br />
	-Dfile=<path-to-file> \<br />
	-DgroupId=<group-id> \<br />
    	-DartifactId=<artifact-id> \<br />
	-Dversion=<version> \<br />
	-Dpackaging=<packaging> \<br />
	-DrepositoryId=<reposirtory-id> \<br />
	-Durl=<url></p>]]>

</content>
</entry>
<entry>
<title>タブ補完ができるCUIのFTPクライアント</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/08/cuiftp.html" />
<modified>2006-08-25T13:37:40Z</modified>
<issued>2006-08-25T13:29:56Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.477</id>
<created>2006-08-25T13:29:56Z</created>
<summary type="text/plain">macにスイッチしてFTPクライアントをどうしようか迷いながらも、Cyberdu...</summary>
<author>
<name>harasho</name>

<email>harada@neo-partners.co.jp</email>
</author>
<dc:subject>Mac OSX</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>macにスイッチしてFTPクライアントをどうしようか迷いながらも、<a href="http://cyberduck.ch/">Cyberduck</a>を使っていました。が、どうにも遅くて使いづらい。結局コマンドでやらざるを得ないようだけど、こんなの見つけたので使うことにしました。<br />
<a href="http://lftp.yar.ru/"><br />
LFTP - sophisticated file transfer program</a></p>

<p>詳しくはこちらのページを見ればよい。<br />
<a href="http://www.goodpic.com/mt/archives2/2006/05/lftp_ftp.html">http://www.goodpic.com/mt/archives2/2006/05/lftp_ftp.html</a></p>

<p>でも、上記ページでちょっとインストールのコマンドが変。以下のように普通にやればよい。</p>

<p>$ ./configure<br />
$ make<br />
$ sudo make install</p>]]>

</content>
</entry>
<entry>
<title>IEでSSL経由のファイルダウンロードができない？</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/07/iessl.html" />
<modified>2006-07-26T06:42:38Z</modified>
<issued>2006-07-26T06:38:17Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.331</id>
<created>2006-07-26T06:38:17Z</created>
<summary type="text/plain">IEの仕様で、httpのレスポンスヘッダに&quot;No-Cache&quot;があると、うまくダ...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>ブラウザ</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>IEの仕様で、httpのレスポンスヘッダに"No-Cache"があると、うまくダウンロードできないようです。<br />
SSLの場合だけ。<br />
<a href="http://support.microsoft.com/kb/323308/ja">技術情報</a></p>]]>

</content>
</entry>
<entry>
<title>UNION構文</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/07/union.html" />
<modified>2006-07-13T11:42:25Z</modified>
<issued>2006-07-13T11:40:09Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.322</id>
<created>2006-07-13T11:40:09Z</created>
<summary type="text/plain">(SELECT a FROM t1 WHERE a=10 AND B=1) UN...</summary>
<author>
<name>tokuyama</name>

<email>tokuyama@neo-partners.co.jp</email>
</author>
<dc:subject>DB</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>(SELECT a FROM t1 WHERE a=10 AND B=1)<br />
UNION<br />
(SELECT a FROM t2 WHERE a=11 AND B=2)<br />
ORDER BY a LIMIT 10;</p>

<p>このようにすると、一つの結果セットに二つのテーブルの結果が格納される。</p>

<p><a href="http://dev.mysql.com/doc/refman/4.1/en/union.html">http://dev.mysql.com/doc/refman/4.1/en/union.html</a></p>

<p>ただし、UNION is available from MySQL 4.0.0 on. だって。</p>]]>

</content>
</entry>
<entry>
<title>IEで position:absolute した要素が消えるバグ</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/07/ie_positionabso.html" />
<modified>2006-07-07T14:30:36Z</modified>
<issued>2006-07-07T14:27:13Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.321</id>
<created>2006-07-07T14:27:13Z</created>
<summary type="text/plain">IEでのみ、position:absoluteで設定した要素が表示されない現象。...</summary>
<author>
<name>harasho</name>

<email>harada@neo-partners.co.jp</email>
</author>
<dc:subject>CSS + XHTML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>IEでのみ、position:absoluteで設定した要素が表示されない現象。<br />
やっぱりIEのバグ。</p>

<p>本来影響を受けないはずのfloatの影響。<br />
直前にあるfloatをclearする必要がある。</p>

<p>IEなんてなくなればいいのに。</p>

<p><a href="http://pinotan.blog15.fc2.com/blog-entry-195.html">http://pinotan.blog15.fc2.com/blog-entry-195.html</a></p>]]>

</content>
</entry>
<entry>
<title>mysqlコマンドでSQLファイルを実行するときのファイルエンコードの指定</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/07/mysqlsql.html" />
<modified>2006-07-06T01:05:25Z</modified>
<issued>2006-07-06T01:02:33Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.320</id>
<created>2006-07-06T01:02:33Z</created>
<summary type="text/plain">mysql -u username -p --default-character...</summary>
<author>
<name>tokuyama</name>

<email>tokuyama@neo-partners.co.jp</email>
</author>
<dc:subject>DB</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>mysql -u username -p --default-character-set=utf8 DBNAME < sql_file.sql</p>]]>

</content>
</entry>
<entry>
<title>tomcat5でシンボリッックリンクを有効にする</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/07/tomcat5.html" />
<modified>2006-07-04T14:12:14Z</modified>
<issued>2006-07-04T14:00:54Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.316</id>
<created>2006-07-04T14:00:54Z</created>
<summary type="text/plain">tomcatはデフォルトでwebアプリケーション下のリンクをたどらない。 有効に...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>サーバ設定その他</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>tomcatはデフォルトでwebアプリケーション下のリンクをたどらない。<br />
有効にするには、$CATALINA_HOME/conf/CATALINA/host_name/app_name.xmlで、<br />
<blockquote><br />
&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />
&lt;Context path="/app_name"<br />
    reloadable="true"<br />
    swallowOutput="true"<br />
    useNaming="false" allowLinking="true"&gt;<br />
  &lt;WatchedResource&gt;/usr/local/tomcat/conf/context.xml&lt;/WatchedResource&gt;<br />
&lt;/Context&gt;<br />
</blockquote ><br />
のように、allowLinking属性をtrueに設定する。</p>]]>

</content>
</entry>
<entry>
<title>redirect_toでの起こりがちな問題</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/06/redirect_to.html" />
<modified>2006-06-30T01:37:22Z</modified>
<issued>2006-06-30T01:34:39Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.314</id>
<created>2006-06-30T01:34:39Z</created>
<summary type="text/plain">ひとつのアクションに複数のredirect_toがある場合、return fal...</summary>
<author>
<name>tokuyama</name>

<email>tokuyama@neo-partners.co.jp</email>
</author>
<dc:subject>Ruby on Rails</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>ひとつのアクションに複数のredirect_toがある場合、return falseした方がいいと。</p>

<blockquote>One problem with this is that the redirect_to may cause an error with multiple redirects if another redirect_to comes down the line. A simple fix is to add "and return false" after the redirect_to: redirect_to :protocol => "https://" and return false unless (...) </blockquote>

<p><a href="http://www.styledbits.com/articles/2006/06/04/adding-ssl-to-your-rails-app-in-5-minutes">http://www.styledbits.com/articles/2006/06/04/adding-ssl-to-your-rails-app-in-5-minutes</a></p>]]>

</content>
</entry>
<entry>
<title>Mac OSX, subclipseで日本語のファイル更新でエラー</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/06/mac_osx_subclip.html" />
<modified>2006-06-26T06:27:12Z</modified>
<issued>2006-06-26T06:21:29Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.311</id>
<created>2006-06-26T06:21:29Z</created>
<summary type="text/plain">Can&apos;t convert string from &apos;UTF-8&apos; to nat...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>Mac OSX</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<blockquote>Can't convert string from 'UTF-8' to native encoding</blockquote>
というエラーがでて日本語ファイルがダウンロードできなかったが、JavaHLというのが必要らしい。
http://subclipse.tigris.org/faq.html#get-javahl
なんらかの方法で入れたsubversionクライアントをコマンドからsvn updateしても同じエラー。。。
subclipseの場合、EclipseのPreferences...=>Team=>svnで、JavaHLじゃなくてJavaSVN(Pure Java)
のほうを選択すると問題なくなった。]]>

</content>
</entry>
<entry>
<title>JUnitでマルチスレッドのテストができない</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/06/junit.html" />
<modified>2006-06-21T19:14:25Z</modified>
<issued>2006-06-21T19:06:07Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.308</id>
<created>2006-06-21T19:06:07Z</created>
<summary type="text/plain">JUnitだとできないものらしい。テストメソッド自身のスレッド=mainスレッド...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>Java</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>JUnitだとできないものらしい。テストメソッド自身のスレッド=mainスレッドが終了した段階で<br />
テストメソッドの中で生成したスレッドが終わってしまう。<br />
<a href="http://groboutils.sourceforge.net/">groboutils</a>を使えばできる、と下記にはあったが、groboutils自体がJUnit３に依存してるけど今書いてたテストコードはJunit4。。。<br />
そもそもマルチスレッドな時点で"Unit"なテスト単位かというと微妙なので、今回はテストやめた。</p>

<blockquote>
<a href="http://today.java.net/pub/a/today/2003/08/06/multithreadedTests.html">http://today.java.net/pub/a/today/2003/08/06/multithreadedTests.html</a>
</blockquote>]]>

</content>
</entry>
<entry>
<title>rsync serverの簡易設定</title>
<link rel="alternate" type="text/html" href="http://www.harasho.biz/archives/mtips/2006/06/rsync_server.html" />
<modified>2006-06-21T08:59:50Z</modified>
<issued>2006-06-21T08:44:25Z</issued>
<id>tag:www.harasho.biz,2006:/mtips/2.305</id>
<created>2006-06-21T08:44:25Z</created>
<summary type="text/plain">sshとか使わず、rsyncをサーバで立ち上げて簡易なミラーリング用に設定する。...</summary>
<author>
<name>takata</name>

<email>takata@choreo.jp</email>
</author>
<dc:subject>サーバ設定その他</dc:subject>
<content type="text/html" mode="escaped" xml:lang="ja" xml:base="http://www.harasho.biz/mtips/">
<![CDATA[<p>sshとか使わず、rsyncをサーバで立ち上げて簡易なミラーリング用に設定する。</p>

<p>RHELだったが、/etc/xinetd.d/rsync がすでに存在するので、「disable = yes」をコメント。<br />
/etc/rsyncd.conf　を作成<br />
（パラメータは<a href="http://www.infoscience.co.jp/technical/rsync/rsyncd_conf.html">ここ</a>を参照）<br />
<blockquote><br />
log file=/var/log/rsyncd.log<br />
[module-name]<br />
path=/www.neo-partners.co.jp/html<br />
comment=neopartners document root<br />
max connections=2<br />
auth users=username<br />
secrets file=/etc/rsyncd.secrets<br />
hosts allow=192.168.0.2<br />
timeout=60<br />
read only=true<br />
</blockquote></p>

<p>/etc/rsyncd.secretsにパスワードを書いておく（べた書き、セキュアなのが必要ならssh+を検討する）。<br />
xinetdを再起動(confファイルはサーバへの接続ごとに読まれるので変更後の再起動必要なし)。</p>

<p>クライアント側で<br />
rsync 192.168.0.1::<br />
とかやるとmodule-nameとconfで設定したコメントが表示されるはず。<br />
クライアント側にパスワードを書いた/etc/rsyncd.pass　みたいなファイルを用意して、<br />
<blockquote><br />
rsync -az --delete --password-file=/etc/rsyncd.pass username@192.168.0.2::module-name /backup/html<br />
</blockquote><br />
みたいなのをcronに登録。</p>]]>

</content>
</entry>

</feed>