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

<channel>
	<title>appling weblog &#187; UNIX/Linux</title>
	<atom:link href="http://blog.appling.jp/archives/category/unix-linux/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.appling.jp</link>
	<description>appling comes from Apple and Playing.</description>
	<lastBuildDate>Fri, 10 Feb 2012 06:22:04 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>MacPortsをクリーニング</title>
		<link>http://blog.appling.jp/archives/2121</link>
		<comments>http://blog.appling.jp/archives/2121#comments</comments>
		<pubDate>Thu, 18 Mar 2010 03:12:55 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Cleaning]]></category>
		<category><![CDATA[Commandline]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://blog.appling.jp/?p=2121</guid>
		<description><![CDATA[MacPortsで入れているソフトウェアをアップグレードしていくと、その残骸であるテンポラリファイルや古いバージョンで塵が積もるようにディスクスペースを圧迫してきます。たまにクリーニングしてあげることですっきりさせてあげ [...]]]></description>
			<content:encoded><![CDATA[<p>MacPortsで入れているソフトウェアをアップグレードしていくと、その残骸であるテンポラリファイルや古いバージョンで塵が積もるようにディスクスペースを圧迫してきます。たまにクリーニングしてあげることですっきりさせてあげましょう。</p>

<p>まずはディスクスペースをどれくらい使っているかの確認</p>

<pre><code>du -sh /opt
</code></pre>

<p>次にテンポラリファイルの整理</p>

<pre><code>sudo port clean --all installed
</code></pre>

<p>そして古いバージョンの整理</p>

<pre><code>sudo port -f uninstall inactive
</code></pre>

<p>あまりソフトウェアを入れていない私の環境でも591M => 347Mに節約できることが出来ました。アップグレードの度にクリーニングを行っているのでこれくらいで収まっていると思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/2121/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ターミナルの設定ファイル</title>
		<link>http://blog.appling.jp/archives/1984</link>
		<comments>http://blog.appling.jp/archives/1984#comments</comments>
		<pubDate>Sun, 01 Nov 2009 08:33:42 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://blog.appling.jp/?p=1984</guid>
		<description><![CDATA[ターミナルのテーマおよび設定ファイル Snow Leopardになって変わっている部分もあるのでアップデートしました。設定ファイルで使わないだろうという部分は削っています。]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://dl.getdropbox.com/u/136684/terminal-files.dmg">ターミナルのテーマおよび設定ファイル</a></li>
</ul>

<p>Snow Leopardになって変わっている部分もあるのでアップデートしました。設定ファイルで使わないだろうという部分は削っています。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1984/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>command拡張子が便利</title>
		<link>http://blog.appling.jp/archives/1910</link>
		<comments>http://blog.appling.jp/archives/1910#comments</comments>
		<pubDate>Sun, 13 Sep 2009 05:31:35 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[Shell Script]]></category>

		<guid isPermaLink="false">http://blog.appling.jp/?p=1910</guid>
		<description><![CDATA[シェルスクリプトについて調べていたら偶然にcommnad拡張子が使えることを知りました。shの代わりにcommandと付けておくとスクリプトファイルをダブルクリックするだけでシェルスクリプトが実行されるのです。sudo認 [...]]]></description>
			<content:encoded><![CDATA[<p>シェルスクリプトについて調べていたら偶然にcommnad拡張子が使えることを知りました。shの代わりにcommandと付けておくとスクリプトファイルをダブルクリックするだけでシェルスクリプトが実行されるのです。sudo認証が必要な時は、ターミナル.appが自動的に起動してパスワードを要求して入力が終わるとウインドウが閉じます。</p>

<pre><code>shellscript.command
</code></pre>

<p>試しに先日エントリーした「<a href="http://blog.appling.jp/archives/1899" title="Snow LeopardでVolume Logicを使う">Snow LeopardでVolume Logicを使う</a>」の一連のファイル操作をシェルスクリプトで書いてみました。</p>

<p><a href="http://blog.appling.jp/wp-content/uploads/2009/09/vl-sl-shellscript.zip">http://blog.appling.jp/wp-content/uploads/2009/09/vl-sl-shellscript.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1910/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MacPortsの再構築</title>
		<link>http://blog.appling.jp/archives/1837</link>
		<comments>http://blog.appling.jp/archives/1837#comments</comments>
		<pubDate>Wed, 05 Aug 2009 09:45:12 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[Rebuild]]></category>

		<guid isPermaLink="false">http://blog.appling.jp/?p=1837</guid>
		<description><![CDATA[なんとなくMacPorts環境とGitHub環境を再構築しました。不具合が生じたとか、ファイル構造がおかしくなったとかじゃないんですけど、いろんなコマンドをいじり倒したのでここでクリーンな環境に戻して使い続けようかなと。 [...]]]></description>
			<content:encoded><![CDATA[<p>なんとなくMacPorts環境とGitHub環境を再構築しました。不具合が生じたとか、ファイル構造がおかしくなったとかじゃないんですけど、いろんなコマンドをいじり倒したのでここでクリーンな環境に戻して使い続けようかなと。現段階だと再構築しても被害が少ないので。再構築手順も押さえておきたいという気持ちから行いました。</p>

<p>まずは <a href="http://guide.macports.org/#installing.macports.uninstalling">MacPortsのアンインストール</a> から</p>

<pre><code>sudo rm -rf \
    /opt/local \
    /etc/manpaths.d/macports \
    /etc/paths.d/macports \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0</code></pre>

<p><a href="http://guide.macports.org/#installing.macports">インストール</a> はディスクイメージから行いました。インストールが完了したら .bash_profile へパスを書き入れておきましょう。コマンドパスとmanページの表示を行う上で重要です。</p>

<pre><code># MacPorts Path --------------------------
export PATH=/opt/local/bin:/opt/local/sbin/:$PATH
export MANPATH=/opt/local/share/man:/opt/local/man:$MANPATH</code></pre>

<p>お好みのものをインストール。私は、bash, vim, git-core, lv, nkf をとりあえず入れておきました。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1837/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacPortsのアップグレードでエラー</title>
		<link>http://blog.appling.jp/archives/1704</link>
		<comments>http://blog.appling.jp/archives/1704#comments</comments>
		<pubDate>Thu, 25 Jun 2009 03:12:13 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Commandline]]></category>
		<category><![CDATA[MacPorts]]></category>

		<guid isPermaLink="false">http://appling.sakura.ne.jp/wordpress/?p=1704</guid>
		<description><![CDATA[コマンドラインツールのインストールや更新に便利なパッケージ管理ソフト The MacPorts を使っている訳ですが、インストールされているコマンドツールが更新されていたのでアップグレードしたところ、いくつかのエラーが出 [...]]]></description>
			<content:encoded><![CDATA[<p>コマンドラインツールのインストールや更新に便利なパッケージ管理ソフト <a href="http://www.macports.org/" title="The MacPorts Project -- Home">The MacPorts</a> を使っている訳ですが、インストールされているコマンドツールが更新されていたのでアップグレードしたところ、いくつかのエラーが出てインストールされないものが出たのでした。</p>

<ul>
<li>cyrus-sasl2</li>
<li>curl</li>
</ul>

<p>この２つがエラーをはいてインストールされない。cyrus-sasl2 についてはエラー内容を読むと、アンインストールしてからインストールするように書かれていたので、その手順でやるとインストールできました。</p>

<pre><code>$ sudo port -f uninstall cyrus-sasl2
$ sudo port install cyrus-sasl2
</code></pre>

<p>次に、curl なんですが、エラー内容を読んでもよくわからないので</p>

<pre><code>$ sudo port clean curl
$ sudo port install curl
</code></pre>

<p>と実行したら、なんかうまくいったみたい。ふぅ〜、よかった。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1704/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SayKanaコマンド</title>
		<link>http://blog.appling.jp/archives/1478</link>
		<comments>http://blog.appling.jp/archives/1478#comments</comments>
		<pubDate>Mon, 18 May 2009 17:00:45 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Command]]></category>

		<guid isPermaLink="false">http://appling.sakura.ne.jp/wordpress/?p=1478</guid>
		<description><![CDATA[SayKana : かな入力したものを合成音声で喋らせるコマンドラインツール (Via SayKana: わかばマークのMacの備忘録.) 面白そうなので入れてみた。 sample.mp4 $ saykana "こんにち [...]]]></description>
			<content:encoded><![CDATA[<blockquote>

<p>SayKana : かな入力したものを合成音声で喋らせるコマンドラインツール</p>

<p>(Via <a href="http://wakabamac.blog95.fc2.com/blog-entry-927.html">SayKana</a>: わかばマークのMacの備忘録.)</p>

</blockquote>

<p>面白そうなので入れてみた。 <a href="http://appling.sakura.ne.jp/wordpress/wp-content/uploads/2009/05/sample.mp4" title="sample.mp4">sample.mp4</a></p>

<pre><code>$ saykana "こんにちわ、いいてんきですね。"
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1478/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://appling.sakura.ne.jp/wordpress/wp-content/uploads/2009/05/sample.mp4" length="12026" type="video/mp4" />
<enclosure url="http://appling.sakura.ne.jp/wordpress/wp-content/uploads/2009/05/sample.mp4" length="12026" type="video/mp4" />
		</item>
		<item>
		<title>.xzという新しい圧縮フォーマット</title>
		<link>http://blog.appling.jp/archives/1438</link>
		<comments>http://blog.appling.jp/archives/1438#comments</comments>
		<pubDate>Mon, 11 May 2009 06:20:28 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Compress]]></category>
		<category><![CDATA[gnutar]]></category>
		<category><![CDATA[xz]]></category>

		<guid isPermaLink="false">http://appling.sakura.ne.jp/wordpress/?p=1438</guid>
		<description><![CDATA[GNUプロジェクトから3月5日にGNU tar 1.22がリリースされました。新しいバージョンでは、新たに「xz圧縮フォーマット」をサポートする“&#8211;xz”オプションが追加されています。（“-J”にショートカッ [...]]]></description>
			<content:encoded><![CDATA[<p>GNUプロジェクトから3月5日にGNU tar 1.22がリリースされました。新しいバージョンでは、新たに「xz圧縮フォーマット」をサポートする“&#8211;xz”オプションが追加されています。（“-J”にショートカットがアサインされている）。</p>

<p>.tar.xzフォーマットでは、圧縮時間が約7倍かかるものの一般的に利用されている.tar.gzフォーマットと比べ約40%のサイズまで圧縮効率が向上しています。</p>

<p>この目新しい.tar.xzフォーマットでアーカイブ圧縮して配布することはないとしても、このフォーマットをダウンロードして伸張解凍することはあるだろうなぁということで環境を整えました。そのうちGUIアプリケーションで対応するものが出てくるとは思いますが、現時点では対応するアプリケーションがないのでコマンドラインから行うしかないようです。</p>

<ul>
<li><a href="http://blog.livedoor.jp/dankogai/archives/51209697.html" title="404 Blog Not Found:tips - xzってどうよ!?">404 Blog Not Found:tips &#8211; xzってどうよ!?</a></li>
</ul>

<p>xzコマンドとGnu Tar 1.22以降をMacPorts経由でインストール</p>

<pre><code>$ sudo port selfupdate
$ sudo port install gnutar xz-devel
</code></pre>

<p>伸張解凍には、aliasを.bashrcに書き込んでおくと便利かもね。</p>

<pre><code>alias unxz="/opt/local/bin/gnutar Jxvf"
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1438/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSHパスワードなしでログイン</title>
		<link>http://blog.appling.jp/archives/1395</link>
		<comments>http://blog.appling.jp/archives/1395#comments</comments>
		<pubDate>Sat, 18 Apr 2009 03:14:14 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://appling.sakura.ne.jp/wordpress/?p=1395</guid>
		<description><![CDATA[エントリー「SSH 秘密鍵を利用する &#124; appling weblog」の続きになります。 パスワード(パスフレーズ)を指定することなくログインできる秘密鍵を作成できることを知りました。パスワードを指定していてもキーチェ [...]]]></description>
			<content:encoded><![CDATA[<p>エントリー「<a href="http://appling.sakura.ne.jp/wordpress/archives/471" title="SSH 秘密鍵を利用する | appling weblog">SSH 秘密鍵を利用する | appling weblog</a>」の続きになります。</p>

<p>パスワード(パスフレーズ)を指定することなくログインできる秘密鍵を作成できることを知りました。パスワードを指定していてもキーチェインに登録できるので、パスワード入力の煩わしさを感じていなかったんだけどパスワードなしでログインできるのはそれはそれで便利かなと導入してみることに。</p>

<ul>
<li><a href="http://blog.livedoor.jp/dankogai/archives/50922070.html" title="404 Blog Not Found:tips - sshでパスワード無しログイン">404 Blog Not Found:tips &#8211; sshでパスワード無しログイン</a></li>
</ul>

<p>ssh-keygenオプション「<code>-N ''</code>」を利用するのがポイント。</p>

<pre><code>$ ssh-keygen -d -f ~/.ssh/nopass-dsa -N ''
</code></pre>

<p>リモート先の認証ファイルを書き換えたとして、試しにログインしてみましょう。</p>

<pre><code>$ ssh -i ~/.ssh/nopass-dsa remote.example.com
</code></pre>

<p>当然ですが、使用感はこれまでと変わりません。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1395/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gitの使い方メモ</title>
		<link>http://blog.appling.jp/archives/1332</link>
		<comments>http://blog.appling.jp/archives/1332#comments</comments>
		<pubDate>Fri, 27 Mar 2009 09:01:31 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://appling.sakura.ne.jp/wordpress/?p=1332</guid>
		<description><![CDATA[バージョン管理システムに慣れてないとGitを使いこなすのは難しいね。少しずつトライ&#38;エラーで慣れてきてはいますが、ある程度全体を見渡せるまでには時間がかかりそう。今は練習なので、バックアップしてあるファイルを対象 [...]]]></description>
			<content:encoded><![CDATA[<p>バージョン管理システムに慣れてないとGitを使いこなすのは難しいね。少しずつトライ&amp;エラーで慣れてきてはいますが、ある程度全体を見渡せるまでには時間がかかりそう。今は練習なので、バックアップしてあるファイルを対象としているので安心だけど、いざ本番となればこうはいかないだろうなぁ。もう三日目で挫折する予感。 :p</p>

<p>Gitコマンドを使わなくてもGitHubウェブアプリでどうにかなるし、ここは状況を見ながらやり易い方で対応していこう。</p>

<p>基本的な作業のコマンド例をメモしておこう。</p>

<p><strong>対象に含めないファイルを決める</strong><br />
.gitignore ファイルを作成し、対象に含めないファイルを記述</p>

<p><strong>変更のあったファイルをコミット</strong></p>

<pre><code>$ git commit -a -m "commit text"
</code></pre>

<p><strong>新たにコミットを付け替える</strong></p>

<pre><code>$ git commit --amend -m "commit text"
</code></pre>

<p><strong>addしたファイルを止める</strong></p>

<pre><code>$ git rm --cached &lt;file name&gt;
</code></pre>

<p><strong>タグを公開</strong></p>

<pre><code>$ git push --tags
</code></pre>

<p>git-pull コマンドでも同じで &#8211;tags オプションを付けておかないといけないらしい。</p>

<p><strong>タグの削除</strong></p>

<pre><code>$ git tag -d &lt;tag&gt; # ローカルのタグを削除
$ git push origin :refs/tags/&lt;tag&gt; # リモート先のタグを削除
</code></pre>

<p><strong>リモート先のファイル変更</strong></p>

<pre><code>To git@github.com:Pafuxu/my_files.git
 ! [rejected]        master -&gt; master (non-fast forward)
error: failed to push some refs to 'git@github.com:Pafuxu/my_files.git'
</code></pre>

<p>リモート先ファイルに何らかの変更が加えられているので、 git-pull して同期させましょう。ローカル側を優先する場合は以下のコマンド。</p>

<pre><code>$ git push origin +master:master
</code></pre>

<p>まだあったような気がするけど、気づいたら書き加えて行くことにしよう。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1332/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gitを始めました</title>
		<link>http://blog.appling.jp/archives/1322</link>
		<comments>http://blog.appling.jp/archives/1322#comments</comments>
		<pubDate>Thu, 26 Mar 2009 12:46:40 +0000</pubDate>
		<dc:creator>Pafuxu</dc:creator>
				<category><![CDATA[UNIX/Linux]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://appling.sakura.ne.jp/wordpress/?p=1322</guid>
		<description><![CDATA[久しぶりにターミナル.appを長時間使い倒したよ。この頃よく見かけることがあるGitHubを使いたくてGitを扱える環境を整えました。Gitとは、 リーナス・トーバルズ によって開発された分散型バージョン管理システム。動 [...]]]></description>
			<content:encoded><![CDATA[<p>久しぶりにターミナル.appを長時間使い倒したよ。この頃よく見かけることがあるGitHubを使いたくてGitを扱える環境を整えました。Gitとは、 <a href="http://ja.wikipedia.org/wiki/リーナス・トーバルズ" title="リーナス・トーバルズ">リーナス・トーバルズ</a> によって開発された<a href="http://ja.wikipedia.org/wiki/Git" title="Git - Wikipedia">分散型バージョン管理システム。動作速度に重点が置かれている。</a>詳しいことは、調べてもらえればすぐに分かると思うのでこれくらいに。</p>

<p>さて、Gitのインストールは<a href="http://www.macports.org/" title="The MacPorts Project -- Home">MacPorts</a>を使って行いました。</p>

<pre><code>$ sudo port install git-core
</code></pre>

<p>関連するライブラリやランタイムが多いので時間がかかります。ゆっくりコーヒーでも飲みながら待ちましょう。</p>

<p>今回は、GitHubアカウントの取得からローカルファイルの公開までを駆け足で説明してみようと思います。</p>

<ul>
<li><p><a href="http://github.com/" title="Secure source code hosting and collaborative development - GitHub">GitHubホームページ</a>でアカウント登録をします。登録内容に、SSH公開鍵も一緒に登録します。SSH公開鍵の発行は以前にエントリーした「<a href="http://appling.sakura.ne.jp/wordpress/archives/471" title="SSH 秘密鍵を利用する | appling weblog">SSH 秘密鍵を利用する | appling weblog</a>」を参考にしてください。</p>

<p>$ cat ~/.ssh/id_dsa.pub | pbcopy</p></li>
<li><p>GitHubダッシュボードよりリポジトリの作成をします。作成が完了する前に、Gitコマンドの説明がありますので手順にそってローカル側の環境を整えれば完了となります。最後に、「When you&#8217;re done: Continue」と書かれたリンクを押すことでリポジトリが作成されます。</p></li>
</ul>

<p>う〜ん、駆け足すぎたかなぁ&#8230;。あとは、「ファイル編集=>コミット=>公開」の繰り返しとなります。気をつけてもらいたいのは、Gitに関わる操作は必ずGitコマンドを介して操作してください。じゃないと、管理情報が壊れてどうやって復旧したらいいのか悩むことになります。(経験者は語る)</p>

<p>Git環境設定を以下に置いておきます。</p>

<script src="http://gist.github.com/86070.js" type="text/javascript"></script>

<p>あ、忘れてた。GitHubで「my_files」と題して<a href="http://github.com/Pafuxu/my_files/tree/master">ドットファイルを公開</a>してますのでよろしかったらご覧ください。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.appling.jp/archives/1322/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

