Sakura共用サーバにportsをインストール

sakura共用サーバの容量が3Gにアップしたので、portsを入れられるか試してみた。

ports treeの取得。

portsnapで更新するため、portsディレクトリを作って、そこにportsnap.confを書く。

% mkdir ~/usr/ports
% mkdir -p ~/usr/local/var/db/portsnap
% mkdir -p ~/usr/ports/distfiles
% vi ~/usr/ports/portsnap.conf

portsnap.confの内容はこんな感じ。homeのところは適宜変更を。

# Default directory where compressed snapshots are stored.
WORKDIR=/home/(ここを変えて)/usr/local/var/db/portsnap

# Default location of the ports tree (target for "update" and  "extract").
PORTSDIR=/home/(ここを変えて)/usr/ports

# Server or server pool from which to fetch updates.  You can change
# this to point at a specific server if you want, but in most cases
# using a "nearby" server won't provide a measurable improvement in
# performance.
SERVERNAME=portsnap.FreeBSD.org

# Trusted keyprint.  Changing this is a Bad Idea unless you've received
# a PGP-signed email from <security-officer@FreeBSD.org> telling you to
# change it and explaining why.
KEYPRINT=9b5feee6d69f170e3dd0a2c8e469ddbd64f13f978f2f3aede40c98633216c330

# Example of ignoring parts of the ports tree.  If you know that you
# absolutely will not need certain parts of the tree, this will save
# some bandwidth and disk space.  See the manual page for more details.
#
# WARNING: Working with an incomplete ports tree is not supported and
# can cause problems due to missing dependencies.  If you have REFUSE
# directives and experience problems, remove them and update your tree
# before asking for help on the mailing lists.
#
REFUSE arabic chinese french german hebrew hungarian
REFUSE korean polish portuguese russian ukrainian vietnamese
REFUSE x11 x11-clocks x11-drivers x11-fm x11-fonts x11-servers x11-themes x11-toolkits x11-wm
REFUSE palm cad astro

あとはportsnapでこのコンフィグファイルを指定すればおーけー。

% portsnap -f ~/usr/ports/portsnap.conf fetch extract update

展開後で402Mほど。

インストール

全部homeのusr/localというディレクトリ以下にインストールすることにする。

参考:

まずはディレクトリを作る

% mkdir -p ~/usr/local
% cd ~/usr/local
% mkdir -p bin sbin etc lib tmp/dist tmp/work var/db/pkg var/db/ports var/run

さらに、以下の設定.zshrcにする。(chshで/usr/local/bin/zshに変えている場合)

export INSTALL_AS_USER=yes
export PREFIX=${HOME}/usr/local
export LOCALBASE=${HOME}/usr/local
export PKG_DBDIR=${LOCALBASE}/var/db/pkg
export PKG_TMPDIR=${LOCALBASE}/tmp/
export PORT_DBDIR=${LOCALBASE}/var/db/pkg
export DISTDIR=${LOCALBASE}/tmp/dist
export WRKDIRPREFIX=${LOCALBASE}/tmp/work
export PORTSDIR=${HOME}/usr/ports
export PKGTOOLS_CONF=${LOCALBASE}/etc/pkgtools.conf
export DEPENDS_TARGET='install clean'

export X11BASE=${LOCALBASE}

export PKG_CONFIG_PATH="$HOME/usr/local/lib/pkgconfig:$HOME/usr/local/libdata/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig"

# Set user and group variables to ourself
export BINOWN=`whoami`
export BINGRP=`id -G -n ${BINOWN}`
export SHAREOWN=${BINOWN}
export SHAREGRP=${BINGRP}
export MANOWN=${BINOWN}
export MANGRP=${BINGRP}

# Make sure files are installed with correct default permissions
export BINMODE=744
export SHAREMODE=644
export MANMODE=644

# Make sure we don't really try to become root, but just execute everything as ourselves
export SU_CMD="sh -c"

# Make sure the systemdefault make.conf is not read
export __MAKE_CONF=${LOCALBASE}/etc/make.conf

# Keep our own version of ldconfig hints
export LDCONFIG="/sbin/ldconfig -i -f ${LOCALBASE}/var/run/ld-elf.so.hints"
#export LDCONFIG="/sbin/ldconfig -f=${LOCALBASE}/var/run/ld-elf.so.hints -i -R=${LOCALBASE}/etc/ld-elf.so.conf "
export LD_LIBRARY_PATH=${LOCALBASE}/lib
export LD_RUN_PATH=${LOCALBASE}/lib

export PATH=${LOCALBASE}/bin:${LOCALBASE}/sbin:${PATH}
export MANPATH_MAP=${LOCALBASE}/bin:${LOCALBASE}/man

# Set application specific variables to make sure it doesn't pick up things from the main system
export APXS=${LOCALBASE}/sbin/apxs
export PERL=${LOCALBASE}/bin/perl
export PERL5=${PERL}
export SITE_PERL=${LOCALBASE}/lib/perl5/site_perl/5.8.8
export SITE_PERL5=${SITE_PERL}
export PERL_VERSION=5.8.8
export PERL_VER=${PERL_VERSION}

その後、ldconfigのサーチディレクトリを更新。

% ldconfig -r | awk '/search/ {print $3}' | tr ":" "\n" > ~/usr/local/etc/ld-elf.so.conf
% echo ${HOME}/usr/local/lib >> ~/usr/local/etc/ld-elf.so.conf
make !

あとは普通にmake installできる。

でも、perlをインストールの時にハマってる。

use.perlで、/etc/manpath.configを勝手に書き換えようとしてpermission deniedを出してくる。use.perlあたりが悪さしてると思うんだけどなぁ。

FreeBSDでCabal

Haskellを触る必要がでてきたため、まずパッケージ管理システムであるCabalの、コマンドであるcabalを使おうと思った。しかし、Portsにあるかと思ったらない感じ?

仕方ないのでtarを取ってきた。FreeBSDPortsghcも-6.8.3のままのようだし、ちょっと遅れてるのかな。

最初Cabal libraryを取ってきて入れたんだけど、その中にはcabalコマンドは入っていないみたい。入っているのはcabal-installの方。で、しかもcabal-installを入れるときにCabal Libraryも入るっぽいので、cabal-installだけでいいんだと思う。

% curl -O http://www.haskell.org/cabal/release/cabal-install-0.6.0.tar.gz
% gzip -dc cabal-install-0.6.0.tar.gz | tar xvf -
% cd cabal-install-0.6.0
% sh ./bootstrap.sh

これで、$HOME/.cabal/というディレクトリとその中にパッケージとか入る。
しかし、cabalコマンドも、$HOME/.cabal/binに入れられてしまっているようだ。ま、これはこれでいいんだけれども、わざわざpathを通すのもめんどいので、/usr/local/bin/にコピーしちゃった。

% sudo cp /home/shirou/.cabal/bin/cabal /usr/local/bin

これでいいのかどうかは分からないけど、ま、動いてそうだしいっか。

ちなみにcabalコマンドの使いかたは、かずさんのページを参照のこと。
http://d.hatena.ne.jp/kazu-yamamoto/20081027/1225082163

セカイカメラの方向推定方法を考えてみた

セカイカメラ(http://www.tonchidot.com/Sekai_Camera.html)」は

ライブビュー(目の前の空間)をダイレクトにiPhoneのスクリーンに表示し、ロ
ケーションのディレクション情報をもとにサーバサイドから必要な情報を集めて
きて表示する

ものらしいです。問題は、Google携帯 G-1のようにコンパスを搭載しないで向いている方向をどうやって知るかです。精度が高いディレクション情報がないと、なにを画面のどこに表示すればいいか分からないですからね。


で、2008-09-11 - 社怪人の日記 で述べられているように、画像認識までは行わずに、特徴量だけを送ってサーバサイドで方向を認識しているのではないかと思います。

そこで、グーグル、「Street View」の撮影とあわせて3Dデータを収集 - CNET Japan を見てください。GoogleはStreet Viewを撮るときに合わせて3Dデータも収集しているそうです。

3Dデータがあるならば、これを利用して以下の方法でそれなりに精度良く方向を求められそうです。ほんとかな。

  • 1. カメラに写っている画像の特徴量を抽出
    • 街中を想定すれば、直線だけでもかなりいけそう
  • 2. 抽出した特徴量と、GPSによる位置情報をサーバに送信
  • 3. サーバでは、受け取ったGPSを元にその周辺の3Dデータから、見えるであろう風景の特徴量を360度ぶん作成
    • ただし、上下方向を考えるともうちょっと広い範囲で作る必要があるかも
  • 4. サーバで、特徴量同士を比較し適合する方角を検索
    • このとき、ずれがあれば差分を元により正確な位置が分かるかも
  • 5. 方向と位置が分かればサーバ側で表示すべき情報を探してiphoneに送信
  • 6. iphoneでは、送信されてきた情報をカメラ画像に加えて表示

衛星写真から作成しているらしいけど、Google Earthでは3Dモデルがあるのでそれを利用すればできそうです(法律的に使っていいかはともかく)。


でも、向いている方向を取りたいだけであれば、G-1のようにコンパスを搭載するのが早いような気がしますけどねぇ。

SPADAさようなら

7年間乗ってきた、HONDA SPADAとさようならしました。

出張から帰ってきてバイクを見たら、倒れて、ヘッドライト、テールランプ、ウィンカーが割れてた。ナンバープレートが曲がるぐらいの勢いで後ろから当て逃げされ、その衝撃で隣の鉄パイプの柵にぶつかり、ヘッドライト他が割れた様子。エンジンは問題なくかかったが、もしかしたらフロントフォークが歪んでるかもしれない。

最近全然乗ってないし5万キロを越えたし、いろいろなところにがたが来ていていつ止まってもおかしくなかった。次に大きな修理が必要になったら廃車しようと決めていたので、今回を期に廃車することにした。

こいつで田切に行ったり房総半島一周したりしたなぁ。バイクを止めた横で海を見ながらたき火をしたこともあった。高速道路でガス欠になり、リザーブも使い切ったところでガソリンスタンドに入ったこともあった。箱根の先が見えない霧の中を勢い良く飛ばしたこともあった。走っている時は、まるで飛んでいるようだった。いろいろな思い出。ありがとう。

sshアタック

昨日の21時ごろから今日の朝4時ぐらいまで、これぐらいのホストからsshに対して攻撃が来た。存在しないユーザでのloginは複数回きた時点でblockするようになってるから問題はない(存在するユーザへもある程度間違えるとblock)んだが、ここまでいろいろなところから集中して攻撃が来るのはこの1年ぐらいなかったかなぁ。

めんどいからDNS引いてないけど、日本国内なホストもあるのかな。

   22        1652 deny ip from 12.206.87.124 to any
   14        1120 deny ip from 24.213.180.14 to any
   23        1784 deny ip from 58.181.129.115 to any
   23        1784 deny ip from 58.236.16.101 to any
   14        1072 deny ip from 58.26.105.190 to any
   23        1808 deny ip from 59.106.23.143 to any
   24        1912 deny ip from 59.37.75.23 to any
   18        1380 deny ip from 60.48.124.85 to any
   21        1528 deny ip from 60.51.189.51 to any
   25        1972 deny ip from 61.144.207.111 to any
   30        2112 deny ip from 62.101.248.229 to any
   14        1120 deny ip from 62.157.90.26 to any
   26        1920 deny ip from 62.205.186.130 to any
   29        2144 deny ip from 62.225.15.82 to any
   23        1784 deny ip from 62.33.104.150 to any
   18        1488 deny ip from 62.48.116.233 to any
   25        1904 deny ip from 62.60.136.250 to any
   21        1564 deny ip from 62.72.101.154 to any
   25        1904 deny ip from 62.72.110.203 to any
   22        1676 deny ip from 62.85.65.147 to any
   25        1597 deny ip from 63.151.168.71 to any
   25        1904 deny ip from 63.239.43.58 to any
   23        1784 deny ip from 64.149.146.242 to any
   23        1784 deny ip from 64.72.87.100 to any
   24        1840 deny ip from 65.203.231.41 to any
   24        1820 deny ip from 66.139.79.116 to any
   22        1740 deny ip from 66.193.171.135 to any
   24        1864 deny ip from 66.240.195.20 to any
   18        1448 deny ip from 67.124.217.17 to any
   21        1568 deny ip from 67.152.2.17 to any
   29        2212 deny ip from 67.154.137.92 to any
   48        3292 deny ip from 67.52.100.181 to any
   26        1956 deny ip from 68.116.46.9 to any
   19        1444 deny ip from 68.183.248.4 to any
   22        1740 deny ip from 68.197.46.163 to any
   21        1680 deny ip from 68.58.136.68 to any
   26        1964 deny ip from 68.60.238.129 to any
   26        1964 deny ip from 69.129.245.28 to any
  231       14228 deny ip from 69.15.13.206 to any
   24        1820 deny ip from 69.176.215.40 to any
   15        1172 deny ip from 69.178.7.129 to any
   17        1424 deny ip from 69.217.30.214 to any
   12        1032 deny ip from 69.250.167.72 to any
   20        1560 deny ip from 69.26.203.10 to any
   18        1384 deny ip from 69.53.116.164 to any
   24        1844 deny ip from 69.60.124.68 to any
   27        2024 deny ip from 69.60.118.191 to any
    2         100 deny ip from 69.64.166.23 to any
   16        1268 deny ip from 70.107.248.126 to any
   22        1740 deny ip from 70.167.18.201 to any
   24        1820 deny ip from 70.46.14.34 to any
   17        1384 deny ip from 70.62.168.95 to any
   22        1608 deny ip from 71.205.145.35 to any
   19        1508 deny ip from 71.242.245.111 to any
    0           0 deny ip from 71.39.108.189 to any
   23        1760 deny ip from 71.72.243.57 to any
   18        1384 deny ip from 72.193.32.133 to any
   23        1784 deny ip from 74.7.213.142 to any
   28        2084 deny ip from 74.93.235.237 to any
   28        2152 deny ip from 75.146.101.28 to any
   22        1515 deny ip from 75.147.27.85 to any
   19        1564 deny ip from 75.157.134.166 to any
   18        1332 deny ip from 75.49.251.71 to any
   23        1784 deny ip from 76.160.167.251 to any
   23        1784 deny ip from 76.236.72.71 to any
   24        1844 deny ip from 76.30.203.187 to any
   24        1820 deny ip from 77.104.220.225 to any
   21        1660 deny ip from 77.56.83.105 to any
   24        1852 deny ip from 77.60.202.205 to any
   15        1228 deny ip from 78.140.92.83 to any
   16        1332 deny ip from 78.96.220.78 to any
   14        1120 deny ip from 79.121.35.121 to any
   25        1800 deny ip from 79.14.30.59 to any
   23        1772 deny ip from 80.120.78.54 to any
   18        1296 deny ip from 80.152.226.13 to any
   19        1336 deny ip from 80.152.230.40 to any
   23        1784 deny ip from 80.152.217.169 to any
   24        1888 deny ip from 80.152.152.203 to any
   25        1896 deny ip from 80.152.190.171 to any
   15        1224 deny ip from 80.153.125.224 to any
   25        1904 deny ip from 80.153.1.168 to any
   23        1784 deny ip from 80.227.150.70 to any
   18        1456 deny ip from 80.254.183.199 to any
   22        1632 deny ip from 80.33.220.57 to any
   18        1320 deny ip from 80.35.236.230 to any
   24        1844 deny ip from 80.59.91.169 to any
   21        1656 deny ip from 81.115.206.153 to any
   11         892 deny ip from 81.140.3.90 to any
   16        1288 deny ip from 81.149.101.27 to any
   24        1844 deny ip from 81.17.33.139 to any
   23        1784 deny ip from 81.173.210.24 to any
   25        1904 deny ip from 81.173.206.100 to any
   22        1736 deny ip from 81.208.92.170 to any
   13        1060 deny ip from 81.224.164.181 to any
   10         788 deny ip from 81.241.231.149 to any
   22        1552 deny ip from 81.25.39.234 to any
   17        1340 deny ip from 81.33.4.161 to any
   23        1644 deny ip from 81.33.20.215 to any
   22        1632 deny ip from 82.135.206.104 to any
   22        1628 deny ip from 82.207.110.198 to any
   27        1916 deny ip from 82.207.104.34 to any
   23        1784 deny ip from 82.209.52.162 to any
   23        1784 deny ip from 82.247.17.134 to any
   19        1488 deny ip from 82.66.64.189 to any
   24        1844 deny ip from 82.76.179.11 to any
   22        1648 deny ip from 83.103.70.170 to any
   21        1592 deny ip from 83.12.137.44 to any
   21        1456 deny ip from 83.16.46.66 to any
   25        1904 deny ip from 83.16.61.114 to any
   19        1508 deny ip from 83.165.217.84 to any
    9         720 deny ip from 83.17.126.94 to any
   20        1380 deny ip from 83.209.62.164 to any
   21        1592 deny ip from 83.211.221.90 to any
   20        1488 deny ip from 83.221.196.202 to any
   23        1784 deny ip from 83.246.94.139 to any
   23        1784 deny ip from 83.246.95.144 to any
   20        1552 deny ip from 83.64.95.194 to any
   22        1732 deny ip from 83.65.75.130 to any
   16        1288 deny ip from 84.114.15.179 to any
   22        1680 deny ip from 84.20.3.226 to any
   21        1628 deny ip from 84.242.66.10 to any
   23        1784 deny ip from 84.52.138.103 to any
   23        1780 deny ip from 84.9.60.95 to any
   21        1504 deny ip from 84.92.176.223 to any
   22        1608 deny ip from 84.92.165.51 to any
   13        1112 deny ip from 85.105.95.136 to any
   23        1784 deny ip from 85.105.124.205 to any
   20        1508 deny ip from 85.125.11.210 to any
   20        1512 deny ip from 85.126.224.131 to any
   25        1928 deny ip from 85.13.122.80 to any
   24        1844 deny ip from 85.14.218.104 to any
   11         928 deny ip from 85.144.133.30 to any
   25        1788 deny ip from 85.152.35.2 to any
   26        1872 deny ip from 85.222.53.48 to any
   19        1556 deny ip from 85.25.139.12 to any
   22        1632 deny ip from 85.46.179.82 to any
   19        1512 deny ip from 85.93.97.50 to any
   23        1784 deny ip from 87.106.14.168 to any
   11         888 deny ip from 87.139.53.47 to any
   20        1512 deny ip from 87.139.20.244 to any
   22        1656 deny ip from 87.216.50.50 to any
   22        1648 deny ip from 87.241.8.203 to any
   17        1392 deny ip from 88.146.223.210 to any
   21        1656 deny ip from 88.149.192.134 to any
   23        1692 deny ip from 88.149.179.83 to any
   23        1780 deny ip from 88.149.158.50 to any
   25        1904 deny ip from 88.162.125.7 to any
   23        1784 deny ip from 88.175.248.100 to any
   23        1784 deny ip from 88.191.13.186 to any
   23        1784 deny ip from 88.191.62.220 to any
   24        1844 deny ip from 88.191.37.211 to any
   31        2328 deny ip from 88.191.88.167 to any
   24        1844 deny ip from 88.195.12.108 to any
   20        1552 deny ip from 88.196.206.58 to any
   21        1612 deny ip from 88.196.54.98 to any
   24        1844 deny ip from 88.206.209.64 to any
   23        1784 deny ip from 88.58.94.210 to any
   24        1844 deny ip from 88.84.139.198 to any
   29        2144 deny ip from 88.87.195.14 to any
   24        1844 deny ip from 89.104.195.10 to any
   18        1408 deny ip from 89.130.230.119 to any
   21        1528 deny ip from 89.202.170.134 to any
   22        1672 deny ip from 89.216.242.73 to any
   24        1752 deny ip from 89.97.242.11 to any
   26        1920 deny ip from 89.97.62.16 to any
  390       23804 deny ip from 89.97.203.134 to any
   21        1568 deny ip from 90.188.155.248 to any
   24        1652 deny ip from 91.113.238.21 to any
   19        1512 deny ip from 91.114.86.222 to any
   26        1964 deny ip from 91.199.22.112 to any
   26        1964 deny ip from 91.64.130.61 to any
   15        1228 deny ip from 92.104.254.121 to any
   20        1544 deny ip from 97.76.164.202 to any
   21        1500 deny ip from 119.113.0.4 to any
   25        1856 deny ip from 119.113.0.7 to any
   21        1688 deny ip from 121.223.232.208 to any
   25        1904 deny ip from 121.241.39.131 to any
   23        1808 deny ip from 121.33.199.39 to any
   25        1972 deny ip from 121.33.199.40 to any
  441       26888 deny ip from 121.33.199.37 to any
   18        1460 deny ip from 122.224.128.212 to any
   15        1212 deny ip from 124.178.255.142 to any
   23        1784 deny ip from 124.178.240.222 to any
   24        1844 deny ip from 124.42.124.87 to any
   22        1632 deny ip from 124.59.47.6 to any
   24        1844 deny ip from 125.142.211.133 to any
   25        1904 deny ip from 125.209.91.90 to any
   22        1720 deny ip from 125.5.167.213 to any
   22        1744 deny ip from 125.73.142.7 to any
  233       14452 deny ip from 125.77.106.246 to any
   23        1676 deny ip from 132.178.212.95 to any
   32        2144 deny ip from 132.208.132.34 to any
   20        1580 deny ip from 135.196.243.201 to any
   25        1936 deny ip from 140.123.79.121 to any
   23        1784 deny ip from 141.35.151.18 to any
   16        1176 deny ip from 149.99.41.218 to any
   27        2048 deny ip from 163.17.173.129 to any
   26        2032 deny ip from 165.21.82.44 to any
   29        2168 deny ip from 169.236.10.63 to any
   20        1432 deny ip from 189.16.248.251 to any
   26        1964 deny ip from 189.43.21.244 to any
   24        1800 deny ip from 189.45.1.1 to any
   22        1632 deny ip from 190.10.205.210 to any
   21        1572 deny ip from 190.144.4.212 to any
   24        1844 deny ip from 190.144.38.91 to any
   22        1596 deny ip from 190.15.193.42 to any
   18        1500 deny ip from 190.24.210.198 to any
   22        1720 deny ip from 190.67.78.146 to any
   23        1784 deny ip from 190.8.192.66 to any
   16        1320 deny ip from 192.150.194.150 to any
   19        1512 deny ip from 193.231.33.1 to any
   19        1512 deny ip from 194.108.136.72 to any
   25        1904 deny ip from 194.187.130.33 to any
   22        1300 deny ip from 194.2.63.197 to any
   15        1228 deny ip from 194.228.118.57 to any
   15        1228 deny ip from 194.63.135.235 to any
   23        1784 deny ip from 194.78.221.189 to any
   16        1292 deny ip from 194.84.60.1 to any
   20        1616 deny ip from 195.168.193.227 to any
   22        1632 deny ip from 195.190.125.194 to any
   21        1552 deny ip from 195.22.37.70 to any
   21        1628 deny ip from 195.250.188.225 to any
   22        1732 deny ip from 195.3.195.5 to any
   24        1432 deny ip from 195.78.45.225 to any
   19        1424 deny ip from 196.211.6.113 to any
   21        1464 deny ip from 196.30.144.138 to any
   22        1404 deny ip from 196.33.48.66 to any
   22        1588 deny ip from 196.34.133.85 to any
   24        1844 deny ip from 200.11.197.122 to any
   24        1844 deny ip from 200.111.65.186 to any
   21        1604 deny ip from 200.118.119.48 to any
   24        1776 deny ip from 200.126.208.207 to any
   20        1592 deny ip from 200.129.244.41 to any
   22        1720 deny ip from 200.141.223.99 to any
   24        1844 deny ip from 200.141.223.106 to any
   23        1692 deny ip from 200.148.241.202 to any
   24        1844 deny ip from 200.170.124.72 to any
   23        1784 deny ip from 200.186.10.106 to any
   22        1468 deny ip from 200.196.50.26 to any
   23        1784 deny ip from 200.196.88.18 to any
   24        1844 deny ip from 200.2.114.175 to any
   16        1280 deny ip from 200.206.190.174 to any
   24        1844 deny ip from 200.209.6.130 to any
   21        1504 deny ip from 200.210.29.172 to any
   22        1628 deny ip from 200.21.190.84 to any
   24        1752 deny ip from 200.21.193.154 to any
   24        1844 deny ip from 200.21.104.66 to any
   16        1288 deny ip from 200.213.21.3 to any
   18        1424 deny ip from 200.241.99.51 to any
   20        1528 deny ip from 200.248.82.130 to any
   23        1784 deny ip from 200.29.135.50 to any
   13         540 deny ip from 200.43.219.134 to any
   27        2024 deny ip from 200.53.121.213 to any
   20        1400 deny ip from 200.58.145.226 to any
  231       14256 deny ip from 200.62.212.244 to any
   22        1732 deny ip from 200.69.219.189 to any
   23        1688 deny ip from 200.74.143.51 to any
   26        1964 deny ip from 200.74.136.246 to any
   22        1720 deny ip from 200.78.191.235 to any
   23        1784 deny ip from 200.79.25.39 to any
   22        1535 deny ip from 201.147.111.94 to any
   16        1203 deny ip from 201.155.9.244 to any
   16        1256 deny ip from 201.16.17.246 to any
   23        1692 deny ip from 201.2.56.34 to any
   23        1784 deny ip from 201.226.217.83 to any
   20        1164 deny ip from 201.232.83.62 to any
   19        1512 deny ip from 201.236.192.195 to any
   20        1400 deny ip from 201.245.162.56 to any
   23        1784 deny ip from 201.25.144.18 to any
   23        1704 deny ip from 201.31.74.11 to any
   18        1424 deny ip from 201.34.253.228 to any
   23        1784 deny ip from 201.6.102.53 to any
   20        1436 deny ip from 201.65.62.130 to any
   25        1900 deny ip from 202.102.144.8 to any
   20        1616 deny ip from 202.141.141.27 to any
   22        1704 deny ip from 202.179.108.54 to any
   23        1808 deny ip from 202.181.164.220 to any
   12         880 deny ip from 202.71.216.126 to any
   25        1972 deny ip from 203.173.96.62 to any
   26        2032 deny ip from 203.70.179.113 to any
   25        1904 deny ip from 204.16.0.150 to any
   25        1664 deny ip from 206.170.79.57 to any
   31        2332 deny ip from 206.227.54.70 to any
   12         956 deny ip from 207.135.141.18 to any
   24        1844 deny ip from 207.250.25.67 to any
   26        1988 deny ip from 207.250.220.196 to any
   22        1720 deny ip from 208.180.110.228 to any
   18        1448 deny ip from 208.191.112.212 to any
   23        1756 deny ip from 209.190.33.214 to any
   23        1816 deny ip from 210.124.36.46 to any
   27        2008 deny ip from 210.245.52.85 to any
   24        1780 deny ip from 210.255.180.14 to any
   22        1680 deny ip from 211.144.151.111 to any
   23        1808 deny ip from 211.154.128.158 to any
   25        1972 deny ip from 211.35.142.37 to any
   18        1456 deny ip from 211.94.209.17 to any
   23        1784 deny ip from 212.14.40.1 to any
   19        1512 deny ip from 212.147.83.67 to any
   26        1964 deny ip from 212.160.173.29 to any
   15        1256 deny ip from 212.168.161.23 to any
   23        1740 deny ip from 212.202.37.116 to any
   21        1516 deny ip from 212.239.212.25 to any
   24        1844 deny ip from 212.24.177.170 to any
   21        1632 deny ip from 212.46.24.146 to any
   23        1692 deny ip from 212.49.104.62 to any
   23        1692 deny ip from 212.60.202.58 to any
   25        1904 deny ip from 212.91.188.165 to any
   22        1632 deny ip from 213.136.105.130 to any
  227       13840 deny ip from 213.136.104.6 to any
   15        1144 deny ip from 213.150.184.70 to any
   18        1374 deny ip from 213.180.161.7 to any
   22        1716 deny ip from 213.192.59.157 to any
   19        1484 deny ip from 213.201.150.218 to any
   28        1992 deny ip from 213.215.39.74 to any
  218       13416 deny ip from 213.227.217.58 to any
   22        1720 deny ip from 213.23.55.162 to any
   23        1780 deny ip from 213.23.22.123 to any
   24        1844 deny ip from 213.23.175.198 to any
   25        1904 deny ip from 213.23.193.42 to any
   23        1784 deny ip from 213.251.185.54 to any
    7         556 deny ip from 213.37.70.13 to any
   16        1276 deny ip from 213.60.211.30 to any
   23        1716 deny ip from 213.94.214.50 to any
   21        1608 deny ip from 213.98.133.164 to any
   24        1840 deny ip from 216.106.228.154 to any
   19        1564 deny ip from 216.197.204.76 to any
   23        1784 deny ip from 216.26.140.77 to any
   18        1272 deny ip from 216.45.122.217 to any
   24        1936 deny ip from 216.77.98.254 to any
   22        1680 deny ip from 217.11.254.171 to any
   25        1904 deny ip from 217.110.123.114 to any
   24        1844 deny ip from 217.114.117.14 to any
  209        9476 deny ip from 217.125.54.170 to any
   21        1376 deny ip from 217.126.90.161 to any
   19        1552 deny ip from 217.128.248.249 to any
   20        1428 deny ip from 217.220.122.58 to any
   21        1451 deny ip from 217.221.55.220 to any
   21        1592 deny ip from 217.30.115.102 to any
   23        1800 deny ip from 217.34.156.94 to any
   22        1720 deny ip from 217.41.8.44 to any
   22        1492 deny ip from 217.6.76.26 to any
   23        1784 deny ip from 217.6.247.3 to any
   20        1512 deny ip from 217.91.69.217 to any
   20        1572 deny ip from 217.91.97.160 to any
   24        1912 deny ip from 218.108.238.140 to any
   17        1428 deny ip from 218.201.201.6 to any
  440       26712 deny ip from 218.208.56.4 to any
   24        1912 deny ip from 218.241.129.42 to any
   16        1296 deny ip from 218.28.143.246 to any
   23        1780 deny ip from 219.137.213.220 to any
   34        2440 deny ip from 219.238.157.156 to any
   23        1648 deny ip from 219.93.187.38 to any
    9         360 deny ip from 220.194.201.208 to any
    2         100 deny ip from 220.199.6.2 to any
    1          40 deny ip from 220.202.78.234 to any
   25        1928 deny ip from 221.236.28.83 to any

Tracをsakuraサーバに入れる

準備

% mkdir ~/local

swigを入れる

% ./configure --prefix=$HOME/local/

apr-1とapr-utilを入れる

% ./configure --prefix=$HOME/local/

subversionを入れる

% cd ~/src
% curl -O http://subversion.tigris.org/downloads/subversion-1.5.1.tar.gz
% gzip -dc subversion-1.5.1.tar.gz | tar xvf -
% cd subversion-1.5.1
% ./configure --prefix=$HOME/local/ --without-berkeley-db --with-apr=$HOME/local/bin/apr-1-config --with-apr-util=$HOME/local/bin/apu-1-config --with-swig=$HOME/local/bin/swig
% make install
% make swig-py
% make install-swig-py

pysqliteを入れる

% cd ~/src
% curl -O
http://oss.itsystementwicklung.de/download/pysqlite/2.4/2.4.1/pysqlite-2.4.1.tar.gz
% gzip -dc pysqlite-2.4.1.tar.gz | tar xvf -
% cd pysqlite-2.4.1
% setenv LOCALBASE $HOME/local
% python setup.py build
% python setup.py install --prefix=$HOME/local

Tracを入れる

% cd ~/src
% curl -O http://ftp.edgewall.com/pub/trac/Trac-0.11.1.tar.gz
% gzip -dc Trac-0.11.1.tar.gz | tar xvf -
% cd Trac-0.11.1
% setenv PYTHONPATH $HOME/local/lib/python2.4/site-packages
% curl -O http://peak.telecommunity.com/dist/ez_setup.py   # <-- こういうのが必要だったみたい。
% python ez_setup.py --prefix=$HOME/local
% python setup.py install --prefix=$HOME/local

Tracとレポジトリを設定

% mkdir -p ~/trac/プロジェクト名
% trac-admin ~/trac/プロジェクト名 initenv
てきとうに設定

公開wwwを設定

% cd ~/www
% mkdir プロジェクト名
% cd プロジェクト名
% cp ~/src/Trac-0.11.1/cgi-bin/trac.cgi ./trac-orig.cgi
% cat > trac.cgi
#!/bin/sh
export LD_LIBRARY_PATH=/home/ユーザ名/local/lib
export TRAC_ENV=/home/ユーザ名/trac/プロジェクト名
export PYTHONPATH=/home/ユーザ名/local/lib/svn-python:/home/ユーザ名/local/lib/python2.4/site-packages /usr/local/bin/python /home/ユーザ名/www/プロジェクト名/trac-orig.cgi
% chmod 755 trac.cgi

.htaccessをいじる

DirectoryIndex trac.cgi

AuthUserFile       /home/ユーザ名/.trachtpasswd
AuthGroupFile     /dev/null
AuthName          "Type your password please."
AuthType           Basic
require valid-user

でも、これだとTrac全体にbasic authがかかるんだよな。loginだけにかけたいんだけどまだ不勉強のようで。