わんこ日記 ![[RDF]](images/rdf.png)
2009-06-21(Sun) [長年日記]
■ [git][Debian] git-daemonでリポジトリを公開する。
昨日の日記でgitを使い始めたことを書いたけど、RCSみたいなローカルだけの使い方だけではおもしろくないので公開用のリポジトリに挑戦した。
Debianでは、パッケージ: git-daemon-runをインストールすると、git clone git://localhost/git/... で取れるようにするためのgit-daemonが動き出す。
このパッケージやパッケージ: gitwebでは、/var/cache/git にリポジトリが有ることを期待しているので、
# cd /var/cache/git
# ln -s ~user/src/git-test/.git git-test.git
と実際のgitリポジトリまでのシンボリックリンクを張ってあげる必要がある。
gitwebは、これで見えるようになったんだけどgit cloneしようとすると
$ git clone git://localhost/git/git-test.git
Initialized empty Git repository in /home/user/src/clone-test/.git/
fatal: The remote end hung up unexpectedly
とエラーになってしまう。サーバ側には
2009-06-21_04:47:23.94637 [12345] Connection from 192.168.0.1:61491
2009-06-21_04:47:23.94651 [12345] Extended attributes (15 bytes) exist
2009-06-21_04:47:23.94782 [12345] Request upload-pack for /git/git-test.git
2009-06-21_04:47:23.94983 [12345] /var/cache/git/git-test.git: repository not exported.
2009-06-21_04:47:23.94984 [1234] [12345] Disconnected (with error)
[/var/log/git-daemon/currentより引用]
とログにエラー「repository not exported.」出てしまう。これは
$ touch /var/cache/git/git-test.git/git-daemon-export-ok
とすると
$ git clone git://on-o.com/git/local-git-test.git
Initialized empty Git repository in /home/user/src/clone-test/.git/
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 32 (delta 5), reused 32 (delta 5)
Receiving objects: 100% (32/32), done.
Resolving deltas: 100% (5/5), done.
とうまくいうようになった。
参考: Re: libpng.git hosting via sourceforge
公開用のリポジトリを作るには
$ git clone --bare ~/proj proj.git
$ touch proj.git/git-daemon-export-ok
[Git ユーザマニュアル - git リポジトリの公開より引用]
というのが正しいお作法らしい。
さて取れたから、pushも出来るだろうと思ってpushすると
$ git push
warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated. This may
warning: not necessarily be what you want to happen.
warning:
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning: 'nothing' : Do not push anything
warning: 'matching' : Push all matching branches (default)
warning: 'tracking' : Push the current branch to whatever it is tracking
warning: 'current' : Push the current branch
とエラーになる。
git-daemonの起動時にreceive-packを有効にしておけば良さそう。
[[git-daemon]git-pushすると「fatal: The remote end hung up unexpectedly」というエラーが発生するより引用]
てことだ…
■ [git] 「パッケージ: git-daemon-run」イヤになったのでinetdでgit-daemonを起動する
git-daemon-runパッケージだが、exportやらrecive-packやら色々設定が必要なのと、いつも必要なわけではないのに立ち上がりっぱなしというのがイヤになって、inetdで立ち上げることにする。
git 9418/tcp # Git Version Control System
[/etc/servicesより引用]
を追加するのが正しいんだろうけどservicesには登録せず直接port番号で
# update-inetd --add "9418 stream tcp nowait gitdaemon.nobody /usr/sbin/tcpd /usr/lib/git-core/git-daemon --enable=receive-pack --syslog --inetd --verbose --base-path=/var/cache /var/cache/git"
として、inetdでgit-daemonを起動するようにした。
※--export-allをつけようか悩んだけどgitwebで見たいだけのものも有るのでつけないことにした。
/var/cache/git以下のファイルにはgitdaemonユーザへの書き込み権限を与えるとpushできるようになった。
今後はcloneやpushが必要なセントラルリポジトリを作るときには
$ cd /var/cache/git
$ git clone --bare <ローカルなリポジトリ>/.git
$ touch git-daemon-export-ok ←これをやらないとclone禁止 gitwebのみ
$ chown -R gitdaemon . ←これをやらないとpush禁止
とする。
2009-06-20(Sat) [長年日記]
■ [git] gitを使い始める
RCS見たいにローカルにリポジトリを持っていることも、CVSみたいにリモートでみんなで共有のリポジトリを持つことも可能なgitは便利そうなので使ってみることにする。
#CVSからいつかはsubversionと思っていたけど、結局subversionはtDiaryなどのソースを取ってくるクライアントしか使わないままgitに移行です。
まずは、
$ git config --global user.email <メールアドレス>
$ git config --global user.name <なまえ>
とメールアドレスとなまえを登録。名前は/etc/passwdのGE...フィールドに入っているから登録しなくてもOK。
$ git clone --depth 1 git://<リポジトリ>
でソースをもってこれる。「--depth」をつけると新しいリビジョンだけ取ってくる。
自分でリポジトリを作りたいときには、その場所で
$ git init
すれば、RCSのようにその場で自分のリポジトリが作れてgitを使えるようになる。
あとは、必要に応じて
$ git add <ファイル1>
$ git add <ファイル2>
$ git commit
としていけば、普通のハージョン管理ソフトと同じように使える。
$ git branch <ブランチ名>
$ git checkout <ブランチ名>
でブランチが作れる。
git merge masterでマージや、git rebase <タグ>でわかれめを変えるなんて芸当がかっこいい。
参考:
■ [git][Debian] GUIでgitを操作する。
$ git guiで利用できる パッケージ: git-guiは、Tcl/TKで作られているみたいだけど、GUIで操作できて、なかなか良い。
ただし、commit時に漢字でコメントを入れると入力はされているが漢字を表示すること出来ない。
リポジトリ圧縮など出来ないので機能は少ないがDebian squeezeからならば、パッケージ: gitgの方が画面もきれいだし、そのような問題が起こらずに良いみたい。
■ [git][emacs] emacsでgitを操作する
emacsでも基本的には、cvsやsubversionと同じでvcが何とかしてくれるので、普通にfileを開いてc-x v vとすれば、そのファイルがadd&commitされる。
Debian Sid(unstable)にしかないけど、 パッケージ: magitをインストールするとM-x magit-logで
Commits in HEAD
* experimental 試験ブランチでfile2に追加
* Merge branch 'master' into experimental
|\
| * master マスターにコンフリクトしたものを追加
* | うーむ新しいファイルはvcでは c-x v v が二回でadd,commitになるみたい
* | vcではaddしないでも直接追加できちゃうのね
|/
* emacsから追加
* 漢字を追加
* file1にさらに追加
* file1に一行書き加えた。
* まずはfile1を作ってみた。
で、gitgばりにログの確認が出来るようになる。
2009-06-19(Fri) [長年日記]
■ [Debina] viewvcを使う
昔はviewcvsで、おうちサーバのCVSリポジトリを見ていたが、いつのまにか
The ViewCVS software was recently renamed to ViewVC. This package is intented for easy translation to the new ViewVC packages, and can be removed with no ill effect after its installation.
[dummy package to migrate to ViewVCより引用]
ってことで、CVSだけではなくてsubversionにも対応したパッケージ: viewvcを使うことになったらしいので、早速viewvcをインストール。
/usr/share/doc/viewvc/README.debianにはapacheの設定には手を出していないのでdocrootを何とかせよと書いてあるので
--- viewvc.conf.org 2009-06-20 19:25:48.000000000 +0900
+++ viewvc.conf 2009-06-20 19:46:43.000000000 +0900
@@ -402,6 +402,8 @@
# files will get served from this location, otherwise static files will
# be served by the ViewCVS script which is less efficient
#docroot = /doc
+#add tkyn
+docroot = /viewvc
# Show last changelog message for sub directories
# The current implementation makes many assumptions and may show the
と
Alias /viewvc /usr/share/viewvc
[/etc//etc/apache2/conf.d/viewvcより引用]
と設定して、viewvcのCSSなどを置いてあるドキュメントルートを準備した。
早速、アクセスしてみると
An Exception Has Occurred
Python Traceback
Traceback (most recent call last):
File "/usr/lib/viewvc/viewvc.py", line 3766, in main
request.run_viewvc()
File "/usr/lib/viewvc/viewvc.py", line 394, in run_viewvc
self.view_func(self)
File "/usr/lib/viewvc/viewvc.py", line 1777, in view_directory
generate_page(request, "directory", data)
File "/usr/lib/viewvc/viewvc.py", line 845, in generate_page
template = get_view_template(request.cfg, view_name, request.language)
File "/usr/lib/viewvc/viewvc.py", line 839, in get_view_template
template = ezt.Template(tname)
File "/usr/lib/viewvc/ezt.py", line 293, in __init__
self.parse_file(fname, base_format)
File "/usr/lib/viewvc/ezt.py", line 298, in parse_file
self.parse(_FileReader(fname), base_format)
File "/usr/lib/viewvc/ezt.py", line 686, in __init__
self.text = open(fname, "rb").read()
IOError: [Errno 2] No such file or directory: "/usr/lib/templates/directory.ezt"
[http://localhost/viewvc.cgiより引用]
とエラーになる。
/etc/viewvc/viewvc.confで何とか出来るかと思ったのだけど、やり方が分からず、とりあえず
# cd /usr/lib
# ln -s /etc/viewvc/templates .
したら使えるようになった。(ちょっと格好悪いね)
2009-06-17(Wed) [長年日記]
■ ルータから外側のアドレスを取得する
以前つかっていたNEC atermの時にはADSLモデム Aterm WD735GV の WAN 側 IP アドレスを取得する方法に書いてある
#!/usr/bin/perl
use SOAP::Lite;
my $soap = SOAP::Lite
->ns('urn:schemas-upnp-org:service:WANPPPConnection:1')
->proxy('http://te4100:2869/upnp/control/WANPPPConn1');
my $som = $soap->GetExternalIPAddress();
my $ip = $som->valueof('//GetExternalIPAddressResponse/NewExternalIPAddress');
print "$ip\n";
で取得できていたけど、最近利用しているFujitsu FA11-W5では、これでは動かなかった。
UPnPのサービス名がちがっているのかもしれないと思って、探してみることにした。
まず、ルータのUPuPを見つけるために「 適当なスクリプト集」のssdp:discoverの改良版を利用してルータのアクセスURLを見つけた
$ UPnPls.pl
M-SEARCH * HTTP/1.1
Host:239.255.255.250:1900
Man:"ssdp:discover"
ST:upnp:rootdevice
MX:3
------------------------------
HTTP/1.1 200 OK
Server: Unknown/0.0 UPnP/1.0 Web Server
EXT:
LOCATION: http://192.168.0.1:80/InternetGatewayDevice.xml
CACHE-CONTROL: max-age = 1830
ST: upnp:rootdevice
USN: uuid:69ab1a4c-ea86-b043-5396-19384cb7aebf::upnp:rootdevice
==============================
------------------------------
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=60
EXT:
LOCATION: http://192.168.0.20:51001/MediaServerGen.xml
SERVER: MontaVista Linux/2.1 UPnP/1.0 SONY NSC SDK (UPnP Core)/1.3.4
ST: upnp:rootdevice
USN: uuid:68ea2c50-9bf1-129d-2813-123456789012::upnp:rootdevice
X-AV-Server-Info: av = 2.0 ; cn = "Sony Corporation" ; mn = "CSV-E77" ; mv = "1.0.0" ;
X-AV-Physical-Unit-Info: pa = "CoCoon Channel Server CSV-E77" ; pl = b13D2b9OuENPWd5ZufaWgVadfadyVIEeitVFtNec= ;
==============================
CoCoonも見つかっているけど、ルータはInternetGatewayDevice.xmlでルートデバイスのDevice description情報がとれることが分かった。
つぎに、そのURLにアクセスすると
<service>
<serviceType>urn:schemas-upnp-org:service:WANPPPConnection:1</serviceType>
<serviceId>urn:upnp-org:serviceId:WANPPPConn1</serviceId>
<SCPDURL>WANPPPConnection.xml</SCPDURL>
<controlURL>/EmWeb/UPnP/Control/4</controlURL>
<eventSubURL>/EmWeb/UPnP/Eventing/4</eventSubURL>
</service>
[http://FA11-W5/InternetGatewayDevice.xmlより引用]
となっていて、controlURLが分かった。そこで
*** atermGrobalIP 2007-09-25 13:46:41.000000000 +0900
--- fw11-w5-GrolbalIP 2009-06-17 14:09:00.000000000 +0900
***************
*** 2,8 ****
use SOAP::Lite;
my $soap = SOAP::Lite
->ns('urn:schemas-upnp-org:service:WANPPPConnection:1')
! ->proxy('http://te4100:2869/upnp/control/WANPPPConn1');
my $som = $soap->GetExternalIPAddress();
my $ip = $som->valueof('//GetExternalIPAddressResponse/NewExternalIPAddress');
print "$ip\n";
--- 2,8 ----
use SOAP::Lite;
my $soap = SOAP::Lite
->ns('urn:schemas-upnp-org:service:WANPPPConnection:1')
! ->proxy('http://te4100/EmWeb/UPnP/Control/4');
my $som = $soap->GetExternalIPAddress();
my $ip = $som->valueof('//GetExternalIPAddressResponse/NewExternalIPAddress');
print "$ip\n";
とproxyの所を微妙に変えれば良いみたい。念のために
<action>
<name>GetExternalIPAddress</name>
−<argumentList>
[http://FW11-W5/WANPPPConnection.xmlより引用]
で、同じサービスが有ることを確認して、実行した見たら見事外側のIPアドレスを取得できた。
参考: 「UPnPを利用してグローバルIPを取得する - 2」 UPnPでのグローバルIPを取る仕組みについて解説
2009-06-12(Fri) [長年日記]
■ [Debian] Adobe Reader 9.1で日本語が表示できなくなっていた
2008年12月17日の日記「debian-multimediaのacroreadパッケージでも日本語対応」から、debian-multimedia.orgのパッケージを利用してAdobe Reader(Acrobat Reader)で、日本語表示が出来ていたのだけど、9.1にバージョンアップしたら、2008年12月13日の日記で書いたように
The japanese Language Support Package is required to display this page properly. Under the couurrent configuration, this resource is not available. You can download it from
http://www.adobe.com/products/acrobat/acrrasianfontpack.html
[Adobe Reader警告より引用]
がまた出るようになってしまったので、debian-multimedia.orgのパッケージが悪いのかと思って、Adobeからdebパッケージをダウンロードしてきて、インストールしてみたけど、状況は変わらない。
Adobeが配布しているdebパッケージからして日本語が良くないのかしらん・・・
とりあえず、gnomeのドキュメントビュアー(evince)で、日本語PDFは見えるようなので、そちらを使っている。
2009-06-11(Thu) [長年日記]
■ [OpenPNE] 2009/06/08 Ver.2.14beta2 リリース
ってことで、5月29日の日記と同じくupdate
$ svn update
....
リビジョン 11899 に更新しました。
$ cd setup/sql/mysql41/update
$ mysql --user=www-data --default-character-set=utf8 openpne <update16-for2.14beta2-alter-c_member-drop-is_search_rdresult.sql
■ [Debian] subversionの調子が悪い
このsubversionでのupdateのときに
$ svn update
svn: OPTIONS (URL: 'https://trac.openpne.jp/svn/OpenPNE/trunk'): サーバに接続できませんでした (https://trac.openpne.jp)
というエラーが出た。ブラウザーで見ると該当ページは開けるので変だなと思って調べると
今使われているアクセスモジュールがバグってる、腐ってる
[svn(subversion)が突然使えなくなった [プログラム]より引用]
ということで、Debian squeezeのsvnが利用しているhttpsアクセスモジュールの不具合のようです。
http-library = serf
[~/.subversion/serversに追記より引用]
としてsvn updateを使えるようにしました。
2009-05-29(Fri) [長年日記]
■ [OpenPNE] 2.14beta1にupgrade
5月1日の日記と同じく
svn update
cd setup/sql/mysql41/update/
mysql --user=www-data --default-character-set=utf8 openpne <update12-for2.14beta1-alter-c_commu_admin_invite-drop-index_c_commu_id_c_memer_id_to.sql
mysql --user=www-data --default-character-set=utf8 openpne <update13-for2.14beta1-alter-c_commu-add-columns.sql
mysql --user=www-data --default-character-set=utf8 openpne <update14-for2.14beta1-alter-c_commu-drop-columns.sql
mysql --user=www-data --default-character-set=utf8 openpne <update15-for2.14beta1-alter-c_member-add-column-is_search_result.sql
で、βということだけど、とりあえず使ってみる。
2009-05-25(Mon) [長年日記]
■ [Debian] Sidを使い始める
オープンソース構内交換機 (PBX)のAsteriskをインストールしたので、それに接続したくてSIPに対応したソフトフォンであるekigaを久しぶりに起動したら、起動した時点でクラッシュして動かない・・・
バグレポートを送ったら、「Debian Sid(unstable)に入っているekiga 3.2を試してみてね」ということだったので、ひさしぶりにSidを使えるようにしてみた。
deb http://cdn.debian.or.jp/debian/ sid main contrib non-free
[/etc/apt/sources.listに追加より引用]
Package: *
Pin: release a=testing-proposed-updates
Pin-Priority: 105
Package: *
Pin: release a=testing-backports
Pin-Priority: 110
Package: *
Pin: release a=unstable
Pin-Priority: 90
[/etc/apt/preferencesより引用]
と言う漢字で、まずは、Debian Squeeze(testing)をインストールするけど、指名すればDebian Sid(unstable)も使えるようにして、ekiga 3.2をインストールしたら使えるようになった。
また、Sidには、以下のような楽しそうなものが増えていたので入れてみた。
・magit :A Emacs interface for Git
・op-panel :switchboard type application for the Asterisk PBX
・vmware-package VMwareのtarballから.debパッケージを作るコマンドmake-vmpkg (まだVMware Server 2.0には対応していないので、まだalienのお世話にならないといけない)
・playonlinux :front-end for Wine"
「asterisk-app-fax :Softfax application for Asteris」は、まだ足りないパッケージが有って動かせなくて残念だった。
以下のパッケージはamd64環境でi386のパッケージが使えそうで気になったのだけど、使い方がよく分からないので、まだ入れていない。
・ia32-archive :Create a local archive of converted i386 debs for amd64 and ia64
・ia32-apt-get :Apt-get and dpkg wrapper for on-the-fly ia32-libs conversion
というわけで以下のような感じ
$ apt-show-versions |grep /sid
convirt/sid uptodate 0.8.2-3
ekiga/sid uptodate 3.2.1~git20090515.9d0263-1
libopal3.6.1/sid uptodate 3.6.1~dfsg-1
magit/sid uptodate 0.7-1
motion/sid uptodate 3.2.11-1
op-panel/sid uptodate 0.27.dfsg-2
playonlinux/sid uptodate 3.4-1
snes9express/sid uptodate 1.42-7
ttf-ipafont/sid uptodate 00203-7
ttf-ipafont-jisx0208/sid uptodate 00103-5
vmware-package/sid uptodate 0.22
2009-05-24(Sun) [長年日記]
■ [Debian] 各種ゲームコンソールのエミュレータ
DebianってファミコンなどなどいろいろなエミュレータのPackageがそろっているのね〜
■色々エミュレート出来る
Atari Lynx, GameBoy, GameBoy Color, GameBoy Advance, NES (ファミリーコンピュータ), PC Engine (TurboGrafx 16), PC-FX, SuperGrafx, NeoGeo Pocket, NeoGeo Pocket Color, WonderSwan
Atari 2600, Lynx,NES(ファミリーコンピュータ), SNES(スパーファミコン), GameBoy, Sega Master System, Sega Megadrive, Game Gear, Colecovision, Vectrex, Apple II, Atari 400/800, Commodore 64/128, IBM PC XT/AT (MDA and CGA), ZX80, ZX Spectrum, TI99/4, TRS-80, MSX.
■ファミリーコンピュータ
・fceu
* 圧縮 (PKZIP, gzip) された ROM イメージでも使用可
6502動的コンパイラーということもあり、まだi386のパッケージしかない。
参考: ファミリーコンピュータのゲームROMイメージ efp
■スーパーファミコン
・GTK+ front-end for snes9x : snes9express
■セガサターン
* booting games from CD-ROM and ISO files
* booting games with either an emulated or original BIOS
■PlayStation
■ゲームボーイ/ゲームボーイ/カラー
■ゲームボーイ アドバンスド
・a GTK+ front-end to VisualBoyAdvance emulator
■APPLE][
1984〜1987年頃にTL/1や6502アセンブラで作ったプログラムの入ったフローピーが読めれば楽しいのに、媒体は残っていても、それを読めるドライブが無いのが残念
2009-05-23(Sat) [長年日記]
■ [Debian] Debian squeeze(testing)でupdateできないパッケージが発生
apti[Debian] Debian squeeze(testing)でupdateできないパッケージが発生
aptiude udpateしたら、nautilus-filename-repairer 0.0.5-1と、nautilus-image-converter 0.2.1-2が、libnautilus-extension1が新しくなった影響で入らなくなった。
それぞれ<0.0.5-2,<0.3だとダメなようなので、それ以上のものをexperimentalから持ってきて代用することにした。
あと、Debian testingでは最近gnome周りが結構updateが激しいけど、compiz関係は更新がゆっくりで齟齬が良く出ているので、あまり使っていないcompizやfusionはしばし使わないことにした。ude udpateしたら、nautilus-filename-repairer 0.0.5-1と、nautilus-image-converter 0.2.1-2が、libnautilus-extension1が新しくなった影響で入らなくなった。
それぞれ<0.0.5-2,<0.3だとダメなようなので、それ以上のものをexperimentalから持ってきて代用することにした。
あと、Debian testingでは最近gnome周りが結構updateが激しいけど、compiz関係は更新がゆっくりで齟齬が良く出ているので、あまり使っていないcompizやfusionはしばし使わないことにした。
|
|

