<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Mazn.net</title>
	<link>http://www.mazn.net/blog</link>
	<description>やってみて　調べてみて　苦労しなけりゃ 箱は動かじ</description>
	<pubDate>Tue, 06 Jan 2009 12:40:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/feed" />
		<item>
		<title>echoコマンドで改行やタブを扱うには@Linux (Debian Etch)</title>
		<link>http://www.mazn.net/blog/2009/01/06/169.html</link>
		<comments>http://www.mazn.net/blog/2009/01/06/169.html#comments</comments>
		<pubDate>Tue, 06 Jan 2009 12:36:15 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2009/01/06/169.html</guid>
		<description><![CDATA[UNIX系OSでも最も有名な部類に入るコマンドechoは、引数の文字列や変数の中身を表示することができます。つまりCでいうprintf、JAVAでいうSystem.out.printlnみたいなものですね。
# echo "hoge"
hoge
改行文字\nがあってもそのまま出力します。
# echo "hoge\nhoge"
hoge\nhoge
-eオプションによって\nは改行として扱われます。
# echo -e "hoge\nhoge"
hoge
hoge
ただし、ここで一つ注意。ダブルクォーテーション がないと\がbashで解釈されて認識されません。
# echo -e hoge\nhoge
hogenhoge
\をエスケープしてあげればダブルクォーテーションはいらなくなります。
# echo -e hoge\\nhoge
hoge
hoge
シェルスクリプトで文字列の入った変数を加工したりする場合はバグが混入してしまうため、注意が必要です。
例えばtmp.txtに以下の文字列が入っていたとします。
good job
abcdefg
hogehoge
good morning
この中から、goodが含まれる行をgrepで取り出して表示させようとしたシェル(tmp.sh)の例を示します。
#!/bin/bashtmp=`grep good tmp.txt`
echo $tmp
echo
echo -e $tmp
echo
echo -e "$tmp"
echo
これを実行すると以下のようになります。
# ./tmp.sh
good job good morning

good job good morning

good job
good morning
-eオプションやダブルクォーテーションがないと、すべて1行で表示されているのがわかります。まだechoで表示するだけならよいですが、パイプ&#8221;&#124;&#8221;で繋げて文字列を複雑に処理していると、わかりづらくなってしまいますね。
ちなみに-eオプションはタブ(\t)やベル(\b)といった制御文字も扱えるようです。
# echo -e "a\tb"
a	b
↑ 余談ですが、HTMLでタブは&#8221;＆＃ｘ０００９；&#8221;を半角で書くと表示できます。
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2009/01/06/169.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2009/01/06/169.html" />
	</item>
		<item>
		<title>PlayStation HOMEが最悪な状況に・・・</title>
		<link>http://www.mazn.net/blog/2008/12/29/168.html</link>
		<comments>http://www.mazn.net/blog/2008/12/29/168.html#comments</comments>
		<pubDate>Mon, 29 Dec 2008 07:52:47 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[日常]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/29/168.html</guid>
		<description><![CDATA[久しぶりにPlayStation HOMEにログインすると、最悪な状況になってます。
フリーズするし、持ってたアイテムは消えるし、ワールドマップで移動出来ないし、アバターの頭が禿げてるし・・・・
全然準備が足らなかったのでは？　&#62; SCEさん
あまりにもお粗末です。 アイテムはお金が絡んでいるだけに、早く修正して欲しいものです。
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/29/168.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/29/168.html" />
	</item>
		<item>
		<title>Cisco IOSエミュレータDynamipsを使ってみる＠CentOS 5</title>
		<link>http://www.mazn.net/blog/2008/12/28/167.html</link>
		<comments>http://www.mazn.net/blog/2008/12/28/167.html#comments</comments>
		<pubDate>Sun, 28 Dec 2008 11:40:57 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[ネットワーク]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/28/167.html</guid>
		<description><![CDATA[Ciscoのスイッチやルータの設定の勉強をしたくて、DynamipsというCisco IOSエミュレータを使ってみた。
まずはdynamips-0.2.8rc2とその周辺ツールdynagen-0.11.0をダウンロードして解凍。IOSは別途入手する必要があります。
dynagenのディレクトリに以下の設定ファイル(config.net)を作成。
[localhost]
Autostart = true
Workingdir = /root/cisco/tmp/
Console = 2000
UDP = 11000
Debug = 0

[[7200]]
image = /root/cisco/images/c7200-jk9s-mz.124-13b.bin
npe = npe-400
ram = 160

[[ROUTER R1]]
s1/0 = R2 s1/0
model = 7200

[[router R2]]
model = 7200
一つめコンソールでdynamipsを起動
# ./dynamips-0.2.8-RC2-x86.bin -H 7200
Cisco Router Simulation Platform (version 0.2.8-RC2-x86)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Oct 14 2007 10:41:26

ILT: loaded table "mips64j" from cache.
ILT: loaded table "mips64e" from cache.
ILT: loaded [...]]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/28/167.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/28/167.html" />
	</item>
		<item>
		<title>PC電源ユニット ENERMAX MODU82+ EMD525AWT購入</title>
		<link>http://www.mazn.net/blog/2008/12/25/166.html</link>
		<comments>http://www.mazn.net/blog/2008/12/25/166.html#comments</comments>
		<pubDate>Thu, 25 Dec 2008 13:44:40 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[日常]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/25/166.html</guid>
		<description><![CDATA[PCのATX電源として、Seasonic の&#8221;SS-300FS&#8221;を長年使っていたのですが、急にPCの電源が落ち、なぜかファンがずっと回っているという状態でお亡くなりになったので、ENERMAXの&#8221;MODU82+ EMD525AWT&#8221;を購入しました。
Seasonicは購入4年目ぐらいに一度ファンが回らなくなり、 ファンを自分で交換してからさらに約3年の計約7年、近年4年間ぐらいは24時間電源入れっぱなしのサーバに使用していたので、かなり頑張ってくれたと思います。取り外してカバーを外したところ電解コンデンサが液漏れしていたので、完全に寿命のようです。さすがにコンデンサ交換は面倒そうなので、諦めました。
SS-300FSは当時は静音を謳っていたため購入したのですが、思ったよりはうるさく、負荷によってファンの速度が変わる様子も見られず、すこし残念な思いをした気がします。
しかし今回購入したEMD525AWTはネットでの評判通りかなり静かです。背面ではなく内部の大きなファンのおかけでしょう。CPUファンの音が目立つようになりました。ただし残念なことが一点、内部のファンが出っ張っており私のケースでは電源ユニット部の支えと干渉してしまい、ネジは2本分しか固定することができませんでした。まっ、2本あれば固定できるので、当分これで使用していきます。
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/25/166.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/25/166.html" />
	</item>
		<item>
		<title>BRAVIAでDNLAを使用してみる</title>
		<link>http://www.mazn.net/blog/2008/12/14/165.html</link>
		<comments>http://www.mazn.net/blog/2008/12/14/165.html#comments</comments>
		<pubDate>Sun, 14 Dec 2008 12:24:05 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[サーバ構築]]></category>

		<category><![CDATA[日常]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/14/165.html</guid>
		<description><![CDATA[以前記事でかいたSonyの液晶テレビBRAVIAのKDL32-F1ですが、PS3用に使用していたTversityだと認識はするのですが対応していませんと言われてしまいます。そこで試しにTwonkyMediaの試用版 (ver 4.4.9) をインストールしてみました。
Windows版のインストーラがあるので、インストールはすごく簡単で、BRAVIAでも認識してくれましたが、認識したのは音楽ファイルだけで、jpgやmpegなどの画像、動画はクロスバーにアイコンさえ出てきません。 BRAVIAJ シリーズで動画が再生できたとの報告があるので期待したのですが、残念です。
Windows Media Player 11の共有機能だと、音楽・画像・動画が共有できました。ただし動画はmpeg2しか再生できないようです。
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/14/165.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/14/165.html" />
	</item>
		<item>
		<title>電車の運行情報をチェックしてメール送信をするシェルスクリプト@bash</title>
		<link>http://www.mazn.net/blog/2008/12/13/164.html</link>
		<comments>http://www.mazn.net/blog/2008/12/13/164.html#comments</comments>
		<pubDate>Sat, 13 Dec 2008 10:59:44 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/13/164.html</guid>
		<description><![CDATA[電車の遅延や事故などの運行情報を公開しているサイトがありますが、使用している路線に何か変化があった場合に携帯にメールを送るサービスは有料ばかりなので、ちょこっとシェルを書いてみました。
24時間起動しているサーバ環境があることが前提です。また、lynxがインストールされている必要がありますし、もちろんサーバからメールを送信できる環境でないと動きません。
train.sh
#!/bin/bash
# written by mazn [ http://www.mazn.net/ ]

# 関東の鉄道情報を使用します
urls=(http://transit.goo.ne.jp/unkou/kantou.html)
# 送信先 (複数指定可能)
mailto=("@docomo.ne.jp" "@docomo.ne.jp")
# 差出人
mailfrom="train info &#60;train_info@dummy&#62;"

filename=/tmp/train.txt
sendflg=0
d=`LANG=C date`
contents=""

function sendMail {
        for to in ${mailto[@]}; do
                header=""
           [...]]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/13/164.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/13/164.html" />
	</item>
		<item>
		<title>スイッチの初期化 @ Cisco Catalyst 2960</title>
		<link>http://www.mazn.net/blog/2008/12/13/163.html</link>
		<comments>http://www.mazn.net/blog/2008/12/13/163.html#comments</comments>
		<pubDate>Sat, 13 Dec 2008 02:52:44 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/13/163.html</guid>
		<description><![CDATA[スイッチのパスワードを忘れてしまいログインできなくなった場合は初期化することになります。Catalyst 2960では以下の手順で初期化できます。2900XL/3500XL、2940、2950/2955、2970 シリーズ、3550、3560、3750 シリーズなどもほぼ同様の手順で初期化できるようです。

電源ケーブルを抜きます
シリアルコンソールにPCを繋ぎ、ターミナルソフトを立ち上げておきます
スイッチのmodeボタンを押しっぱなしのまま電源を投入します
LED がオレンジ色の点滅から緑色の点灯に変わったら、Mode ボタンを放します
flash_initコマンドを実行します
switch: flash_init

load_helper コマンドを実行します
switch: load_helper

dir flash: コマンドを実行します
※&#8221; : &#8220;を最後に忘れずにつけます
switch: dir flash:

コンフィギュレーション ファイル名を変更します
switch: rename flash:config.text flash:config.old

システムをブートします

switch: boot

以下のメッセージで&#8221;no&#8221;を入力します
Continue with configuration dialog? [yes/no]: no

enableモードに入ります
Switch&#62;enable
Switch#

setupを実行して初期設定コマンドを実行します。
Switch# setup


上記だと全て初期化されますが、下記の参考では設定を残したままパスワードだけ回復手順が記載されています。
参考 : Cisco Catalyst 固定構成レイヤ 2 およびレイヤ 3 スイッチのパスワード回復手順
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/13/163.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/13/163.html" />
	</item>
		<item>
		<title>Webベースでマニュアルや仕様書などのドキュメント書き</title>
		<link>http://www.mazn.net/blog/2008/12/07/162.html</link>
		<comments>http://www.mazn.net/blog/2008/12/07/162.html#comments</comments>
		<pubDate>Sun, 07 Dec 2008 06:34:36 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/12/07/162.html</guid>
		<description><![CDATA[マニュアルや仕様書などのドキュメントを書くとき、どのようなツールを皆さん使っているのでしょうか。おそらく一般の人だとワードや一太郎、OpenOffice Writerなどのワープロ使ったり、論文だとTeXを使ったり、ちょっとした文章ならばパワーポイントを使ったり、最近だとDocBookを使ったりしてるのではないでしょうか。
そういう私も最近マニュアルを書くのにワードを使ってます。しかし機能が多すぎて使いこなせず、むしろ余計なお節介機能によって苦労させられます。また、テキストファイルではないので、複数人で作成するときにdiffを取れないのも残念です。
そこで複数人で文章作成のコラボレーションができるWikiのようなもので、 TeXのように自動組版ができ、最後はPDFなどで出力できるようなものがないかを探してみたところ、あるブログでたくさんのコメントで議論しているページがありました。
そこで紹介されていたものとして、以下がありましたので、紹介です。いずれ使ってみたらレポートの書きたいと思います。

DocBook Wiki
DocBookをWebベースで作成するツールでしょうか？PDFやhtmなどいろいろな形式で出力できそうです。
 DrupalのBookモジュール
DrupalというCMSとBookモジュールの組み合わせです。さらにDocBook形式でエクスポートするモジュールもあるようです。
Wikipublisher
名前の通り、Wikiを使った文章作成ツールのようです。
Wikibook
Wikipediaを使用しているようです。Wikipediaになにかプラグインでも入れているのでしょうか。
PmWiki の PublishPDFモジュール
これもWikiで作成してPDFで出力させるモジュールのようです。

他にもいろいろありそうですが、どのツールもあまりデモらしきものがないので、実際にインストールしてみたないと使用感があまりわからないのが残念です。
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/12/07/162.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/12/07/162.html" />
	</item>
		<item>
		<title>bashで配列のエクスポートができない@bash 3.2</title>
		<link>http://www.mazn.net/blog/2008/11/29/161.html</link>
		<comments>http://www.mazn.net/blog/2008/11/29/161.html#comments</comments>
		<pubDate>Sat, 29 Nov 2008 05:37:50 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[プログラミング]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/11/29/161.html</guid>
		<description><![CDATA[bashにおいて、サブシェル(呼び出し先の別のシェル)内で呼び出し元の変数を参照しようとする場合、export または declareに-xオプションを使用する必要がありますが、配列変数も同様にexportしても参照できません。
例えば以下の2つのシェルを書きます。
hoge.sh内容
#!/bin/bash
declare -a -x HOGE=("hoge1" "hoge2")    # 配列変数
declare -x FOO="foo"                    # 通常の変数
./foo.sh
foo.sh内容
#!/bin/bash

echo "HOGE="$HOGE
echo "FOO="$FOO
実行すると、下記のように配列の内容を表示できません。
# ./hoge.sh
HOGE=
FOO=foo
これは単純にbashが配列のexportをサポートしてないからのようです。なので、どうしても配列を&#8221;source&#8221;コマンドまたは&#8221;.&#8221; コマンドで実行してあげる必要があります。
hoge.sh内容(source版)
#!/bin/bash
declare -a -x HOGE=("hoge1" "hoge2")
declare -x FOO="foo"
source ./foo.sh
実行すると、下記のようにHOGEの内容が表示されます。
# ./hoge.sh
HOGE=hoge1
FOO=foo
もちろんsourceや&#8221;.&#8221;で実行した場合、サブシェルではなく同じシェル上で実行されるので、fool.sh内での変数宣言がhoge.sh内でも見られるようになりますので、変数名のぶつかりに注意する必要があります。
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/11/29/161.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/11/29/161.html" />
	</item>
		<item>
		<title>dsniffパッケージ@Debian Etch</title>
		<link>http://www.mazn.net/blog/2008/11/16/160.html</link>
		<comments>http://www.mazn.net/blog/2008/11/16/160.html#comments</comments>
		<pubDate>Sun, 16 Nov 2008 06:28:53 +0000</pubDate>
		<dc:creator>mazn</dc:creator>
		
		<category><![CDATA[IT技術]]></category>

		<category><![CDATA[セキュリティ]]></category>

		<guid isPermaLink="false">http://www.mazn.net/blog/2008/11/16/160.html</guid>
		<description><![CDATA[最近ブラッディ・マンデイというドラマの主人公がハッキングするシーンを解説するサイトがありますが、私も見ていて&#8221;tcpkill&#8221;というコマンドを使っていて、恥ずかしながら知らなかったので調べてみました。
Debian Etch ではdsniffというパッケージに入っているので、早速インストール
# apt-get install dsniff
tcpkillをはじめ、 以下のコマンドがインストールされました。
/usr/sbin/webmitm
/usr/sbin/msgsnarf
/usr/sbin/webspy
/usr/sbin/tcpnice
/usr/sbin/sshow
/usr/sbin/filesnarf
/usr/sbin/dnsspoof
/usr/sbin/tcpkill
/usr/sbin/dsniff
/usr/sbin/macof
/usr/sbin/sshmitm
/usr/sbin/arpspoof
/usr/sbin/urlsnarf
/usr/sbin/mailsnarf
結構な数のコマンドが同梱されています。ちなみに、tcpkillは任意のホストにtcpコネクションを閉じる偽パケットを送って、tcp通信を妨害できるようです。
eth0から出て行く21番ポート(FTP)を遮断
# tcpkill -i eth0 port 21
192.168.0.1 とのtcp通信を遮断
# tcpkill host 192.168.0.1
]]></description>
		<wfw:commentRss>http://www.mazn.net/blog/2008/11/16/160.html/feed</wfw:commentRss>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://www.mazn.net/blog/2008/11/16/160.html" />
	</item>
	</channel>
</rss>
