それにしても問題だったのは,TXができて以来,あのへんの道がかわりすぎで,記憶にある道とかなり違っていること.
わかったのは,東大柏の前から,がんセンターのほうにむかって,バッティングセンターのひとつ先を左折すると,高速につきあたって,そこを右にまがると,到着するということ.
この角だ.
大きな地図で見る
ついでなのでPlanetLabの日本でのユーザというか研究していることをちょろちょろしらべていました.
ただ,遊びでつかうには,ネットワークを遮断されかねないので自分でやる気にはならない..
http://cdn.debian.net.nyud.net/debianみたいに .nyud.net を後ろにつけるだけで使えるので,わりと便利に昔は使っていました.
ftp.jp.debian.orgを日本以外から引くと日本じゃないサーバが帰ってくることを指摘されたので修正しました.
]]>以下は,gitorious.orgにある2009年11月7日版で動かす話.
おおむね,http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-centos.txt にある通りやればいいのだが,いかんせんupdateされていないので,酔狂な人以外はubuntuでやるのがいいと思います.
CentOSのpackage以外で利用したものは以下の通り.http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-centos.txtにある通りなのだが違うところ.
/etc/init.d/git-daemon
#!/bin/bash
#
# Init file for Gitorious GIT-Daemon daemon
#
# chkconfig: 2345 55 25
# description: GIT-Daemon server daemon
#
# processname: git-daemon
# pidfile: /var/www/gitorious/log/git-daemon.pid
# source function library
. /etc/rc.d/init.d/functions
PATH=/usr/local/ruby-enterprise/bin:/usr/local/bin:$PATH
RETVAL=0
PROG="git daemon"
GIT_DAEMON="/usr/local/ruby-enterprise/bin/ruby /var/www/gitorious/script/git-da
emon -d"
LOCK_FILE=/var/lock/git-daemon
PID_FILE=/var/www/gitorious/log/git-daemon.pid
do_check_pid() {
if [ -f $PID_FILE ]; then
PID=`cat $PID_FILE`
RUNNING=`ps --pid $PID | wc -l`
else
PID=0
RUNNING=0
fi
}
runlevel=$(set -- $(runlevel); eval "echo \$$#" )
start()
{
do_check_pid
if [ $RUNNING != 2 ] ; then
echo -n $"Starting $PROG: "
/bin/su git -c "$GIT_DAEMON"
sleep 1
if [ -f $PID_FILE ] ; then
success
else
failure
fi
RETVAL=$?
else
echo -n $"$PROG already running"
failure
fi
[ "$RETVAL" = 0 ] && touch $LOCK_FILE
echo
}
stop()
{
do_check_pid
echo -n $"Stopping $PROG: "
if [ $RUNNING != 2 ] ; then
failure $"Stopping $PROG"
else
killproc -p $PID_FILE
fi
RETVAL=$?
# if we are in halt or reboot runlevel kill all running sessions
# so the TCP connections are closed cleanly
if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
killproc -p $PID 2>/dev/null
fi
[ "$RETVAL" = 0 ] && rm -f $LOCK_FILE
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f $LOCK_FILE ] ; then
if [ "$RETVAL" = 0 ] ; then
stop
# avoid race
sleep 5
start
fi
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart}"
RETVAL=1
esac
exit $RETVAL
/etc/init.d/ultrasphinx
#!/bin/bash
#
# Init file for Gitorious Ultrasphinx daemon
#
# chkconfig: 2345 55 25
# description: Ultrasphinx server daemon
#
# processname: searchd
# pidfile: /var/www/gitorious/db/sphinx/log/searchd.pid
PATH=/usr/local/ruby-enterprise/bin:/usr/local/bin:$PATH
RETVAL=0
START_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:start RAILS_ENV=production"
STOP_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:stop RAILS_ENV=production"
RESTART_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:restart RAILS_ENV=production"
STATUS_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:status RAILS_ENV=production"
LOCK_FILE=/var/lock/git-ultrasphinx
PID_FILE=/var/www/gitorious/db/sphinx/log/searchd.pid
case "$1" in
start)
/bin/su git -c "$START_CMD"
;;
stop)
/bin/su git -c "$STOP_CMD"
;;
status)
/bin/su git -c "$STATUS_CMD"
;;
restart)
/bin/su git -c "$RESTART_CMD"
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL
/etc/init.d/stomp
#!/bin/bash
#
# Init file for Gitorious stomp daemon
#
# chkconfig: 2345 55 25
# description: stomp server daemon
#
# processname: stomp
# pidfile: /var/www/gitorious/log/stomp.pid
# source function library
. /etc/rc.d/init.d/functions
PATH=/usr/local/ruby-enterprise/bin:/usr/local/bin:$PATH
RETVAL=0
PROG=/usr/local/bin/stompserver
DAEMON=/usr/local/bin/stompserver
LOCK_FILE=/var/lock/stomp
#PID_FILE=/var/www/gitorious/log/stomp.pid
runlevel=$(set -- $(runlevel); eval "echo \$$#" )
start()
{
echo -n $"Starting $PROG: "
$DAEMON > /dev/null &
sleep 1
}
stop()
{
echo -n $"Stopping $PROG: "
killall stompserver
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
RETVAL=1
esac
exit $RETVAL
おわったらこの3つの/etc/init.d以下のファイルはchkconfig -add file名 で追加.
crontabにtask_performerはもういらない.
]]>apt-get install -y build-essential apache2 mysql-server mysql-client git git-svn apg geoip-bin libgeoip1 libgeoip-dev sqlite3 libsqlite3-dev imagemagick libpcre3 libpcre3-dev zlib1g zlib1g-dev libyaml-dev libmysqlclient15-dev apache2-dev postfix apt-get install libonig2 memcached aspell-en aspell libaspell-dev
wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.tar.gz tar xvfz sphinx-0.9.8.tar.gz cd sphinx-0.9.8 ./configure && make && make install
cd /home/gitorious git clone git@gitorious.org/gitorious/mainline.git
apt-get install uuid uuid-dev openjdk-6-jre wget http://www.powertech.no/apache/dist/activemq/apache-activemq/5.2.0/apache-activemq-5.2.0-bin.tar.gz tar xzvf apache-activemq-5.2.0-bin.tar.gz -C /usr/local/ adduser --system --no-create-home activemq echo "export ACTIVEMQ_HOME=/usr/local/apache-activemq-5.2.0" >> /etc/activemq.conf echo "export JAVA_HOME=/usr/" >> /etc/activemq.conf chown -R activemq /usr/local/apache-activemq-5.2.0/data
/usr/local/apache-activemq-5.2.0/conf/activemq.xml の書き換え
<networkConnector name="localhost" uri="static://(tcp://127.0.0.1:61616)"/>
wget http://launchpadlibrarian.net/15645459/activemq mv activemq /etc/init.d chmod +x /etc/init.d/activemq
wget http://rubyforge.org/frs/download.php/64475/ruby-enterprise-1.8.7-20090928.tar.gz apt-get install libreadline5-dev
展開して installというスクリプトを叩くとインストール開始.
おわるとこんなのが表示.
If want to use Phusion Passenger (http://www.modrails.com) in combination with Ruby Enterprise Edition, then you must reinstall Phusion Passenger against Ruby Enterprise Edition, as follows: /opt/ruby-enterprise-1.8.7-20090928/bin/passenger-install-apache2-module Make sure you don't forget to paste the Apache configuration directives that the installer gives you. If you ever want to uninstall Ruby Enterprise Edition, simply remove this directory: /opt/ruby-enterprise-1.8.7-20090928
/etc/profileに追加
export PATH=/opt/ruby-enterprise-1.8.7-20090928/bin:$PATH export LD_LIBRARY_PATH="/usr/local/lib" export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
source /etc/profile
passengerのインストーラ起動
passenger-install-apache2-module
/etc/apache2/mods-available/passenger.loadを作る
LoadModule passenger_module /opt/ruby-enterprise-1.8.7-20090928/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so PassengerRoot /opt/ruby-enterprise-1.8.7-20090928/lib/ruby/gems/1.8/gems/passenger-2.2.5 PassengerRuby /opt/ruby-enterprise-1.8.7-20090928/bin/ruby
a2enmod passenger
/etc/apache2/sites-available/gitoriousを編集してからa2ensite gitorious
<VirtualHost *:80> ServerName codes.mlab.t.u-tokyo.ac.jp DocumentRoot /home/gitorious/gitorious/public # <-- be sure to point to 'pu blic'! </VirtualHost>
apt-get install libonig-dev libmagick9-dev gem install raspell mime-types oniguruma textpow chronic BlueCloth ruby-yadis ruby-openid rmagick geoip ultrasphinx rspec rspec-rails RedCloth echoe daemons geoip --no-rdoc --no-ri
public/.htaccsss 以下のように書いてあるのを消した.
RewriteEngine on RewriteRule ^projects/([a-zA-z0-9\-_]+)/?$ /$1 [R=301,L] RewriteRule ^projects/([a-zA-z0-9\-_]+)/repos/([a-zA-z0-9\-_]+)(.+)?$ /$1/$2$3 [R=301,L]
doc/templates/ubuntu/{git-ultrasphinx,git-daemon} を /etc/init.d以下にコピーしてかきかえる.そして chmod +x しとく.
root@codes:/etc/init.d# update-rc.d git-ultrasphinx start 99 2 3 4 5 . root@codes:/etc/init.d# update-rc.d git-daemon start 99 2 3 4 5 .
adduser git chown -R git:git /home/gitorious su - git
config/database.ymlをexampleからコピーして作成.rootのパスワードを設定する.
config/gitorious.ymlをいじる.重要なのは,cookie_secret, gitorious_host
rake をうごかしてみるといくつか足りないgemがあるようなので追加.
gem install rdiscount stomp diff-lcs json mocha gem install rdiscount -v 1.3.1.1 gem install ruby-hmac
rake tmp:create rake db:create RAILS_ENV=production rake db:migrate RAILS_ENV=production rake ultrasphinx:bootstrap RAILS_ENV=production
export RUBY_HOME=/opt/ruby-enterprise-1.8.7-20090928 export GEM_HOME=$RUBY_HOME/lib/ruby/gems/1.8/gems export PATH=$RUBY_HOME/bin:$PATH
logrotateの設定.
broker.ymlを設定する.
gem install stompserver ln -s /opt/ruby-enterprise-1.8.7-20090928/bin/stompserver /usr/bin
さらに /etc/init.d/stompを設定する.
http://millarian.com/programming/installing-aspell-and-raspell-for-ultrasphinx/ をまず見る.
rootでこれをやる.
rake ultrasphinx:spelling:build RAILS_ENV=production]]>
localのswitchが遅いとEucalyptusは泣きがはいるな..GbE以外爆発しろ,というかんじか.
]]>ちゃんとインストール前に依存するライブラリの存在も調べてくれる.自分は
apt-get install libreadline5-dev
をやるだけですんだ.
インストール先は /opt/ruby-enterprise-1.8.7-20090928 といったかんじになる.
ubuntu用のdebをdebian用に書きかてる人もいるのでそっちがいい人は使うといいと思います.
]]># umount /home # fsck.ext3 -f /dev/lvm/home # resize2fs /dev/lvm/home 40G # mount -a # lvreduce -L 40G /dev/lvm/home]]>
xen-tools xen-utils-common xen-utils xen-hypervisor-3.2-1 linux-image-2.6.26-2-xen-amd64
あたりをapt-getでいれる.
とりあえずリブートしてxenで起動するかを見る.問題なかったらイメージをつくる.
/etc/xen-tools/xen-tools.conf を適当に設定.いじったのはこのくらい.
dir = /home/xen dist = lenny # Default distribution to install. image = sparse # Specify sparse vs. full disk images. gateway = 10.2.1.1 netmask = 255.255.0.0 mirror = http://ftp.jp.debian.org/debian/ serial_device = hvc0
lvmで使うなら,
lvm = lvmhoge
をさらに指定.lvmhogeの部分は,
sudo lvdisplay |grep "VG Name"
で出てくる文字になる.
おわったらrootで!
xen-create-image --ip 10.2.3.4 --verbose --hostname hoge.araki.net
無事イメージができているか確認する.
起動
# xm create -c hoge.araki.net
sshではいれるようにする
http://www.xen-support.com/?p=16 に詳しい.
apt-get install udev
そのあとで /etc/fstabに
none /dev/pts devpts defaults 0 0
さらに
mount -a]]>
Thunderbird (but not in Seamonkey), the current nightly builds do not work on Seamonkey.
Author's nightly builds
Contributed nightly builds

arduinoのpageからlinux用のarduino-0012-linux.tgz をとってきて展開しただけでは使えないので,必要なjava関係とAVRのbuild環境をとってきていれる.
apt-get install avrdude sun-java6-jre sun-java6-fonts sun-java6-plugin gcc-avr avr-libc
そしたらMakefileをcopyする.
~/working-dir/arduino-0012/hardware/cores/arduino/Makefile .
んでubuntuにあわせていろいろ変更.
そのdiffをはっておく.
$ diff -u Makefile.orig Makefile --- Makefile.orig 2009-01-01 12:44:21.000000000 +0900 +++ Makefile 2009-01-01 12:37:24.000000000 +0900 @@ -35,8 +35,10 @@ # $Id$ TARGET = $(notdir $(CURDIR)) -INSTALL_DIR = /Users/dmellis/Source/arduino/trunk/build/macosx/build/work -PORT = /dev/tty.usb* +## INSTALL_DIR = /Users/dmellis/Source/arduino/trunk/build/macosx/build/work +INSTALL_DIR = $(HOME)/working-dir/arduino-0012 +PORT = /dev/ttyUSB* UPLOAD_RATE = 19200 AVRDUDE_PROGRAMMER = stk500v1 MCU = atmega168 @@ -46,7 +48,8 @@ # Below here nothing should be changed... ARDUINO = $(INSTALL_DIR)/hardware/cores/arduino -AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin +## AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin +AVR_TOOLS_PATH = /usr/bin SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \ $(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \ $(ARDUINO)/wiring_pulse.c $(ARDUINO)/wiring_serial.c \ @@ -93,7 +96,7 @@ # Programming support using avrdude. Settings and variables. AVRDUDE_PORT = $(PORT) AVRDUDE_WRITE_FLASH = -U flash:w:applet/$(TARGET).hex -AVRDUDE_FLAGS = -V -F -C $(INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf \ +AVRDUDE_FLAGS = -V -F -C $(INSTALL_DIR)/hardware/tools/avrdude.conf \ -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \ -b $(UPLOAD_RATE)]]>
| 旧 | 新 | |
| Ubuntu | 7.10 | 8.04 |
| rails | 1.2.6 | 2.2.2 |
| DB2 | 9.5 | 9.5(同じ) |
| gem | 0.84(rubygems.debのやつ) | 1.3.1 |
| ibm_db | 0.94 | 1.0.0 |
そしてActiveScaffoldも使っている.
sudo gem update --system sudo apt-get remove rubygems
sudo -s . /home/db2inst1/sqllib/db2profile export IBM_DB_DIR=/home/db2inst1/sqllib export IBM_DB_LIB=/home/db2inst1/sqllib/lib32 gem install ibm_db gem install rails -y gem install rake -y
rails2.2では1.2時代に動いてたactive_scaffoldはもう動かない.http://activescaffold.com/ をみるとやりかたが書いてある.
git clone git://github.com/activescaffold/active_scaffold.git vendor/plugins/active_scaffold && rm -rf vendor/plugins/active_scaffold/.git
config/environment.rbに config.action_controller.sessionを追加.
config.action_controller.session = { :session_key => "hogecode", :secret => "
abcdefghijklmnopqrstuvwxyz...." }
rake db:migrateかますと,config/environments/development.rbがおかしいことを
指摘してくれる
$ rake db:migrate --trace ..... ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! undefined method `cache_template_extensions=' for ActionView::Base:Class /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/initializer.rb:530:in `send'
http://d.hatena.ne.jp/zariganitosh/20080621/1214110380 にある
config/environments/development.rbの「config.action_view.cache_template_extensions= false」オプションは推奨されなくなり、何の影響も与えないらしい...。削除してくださいと警告されているので、削除してしまった。(警告なので削除しなくてもサーバーは起動する。)
というかんじ.
PAGESIZEが小さいとDB2におこられることがある.
== Initial: migrating ========================================================
-- create_table("contacts", {:force=>true})
-> 0.1195s
-- create_table("inbounds", {:force=>true})
rake aborted!
An error has occurred, this and all later migrations canceled:
ActiveRecord::StatementInvalid: [IBM][CLI Driver][DB2/LINUX] SQL0286N A default table space could not be found with a page size of at least "8192" that authorization ID "DB2INST1" is authorized to use.
しょうがないのでdbをつくりなおす.(db2inst1 ユーザでおこなう)
$ db2 drop db xdmsdev $ db2 create database xdmsdev using codeset utf-8 territory us PAGESIZE 32 K
できたら
rake db:migrate
が,rake test:unitsはibm_db 1.0.0では対応してないようだ.
rake aborted! Task not supported by 'ibm_db'
とりあえずこれでokだった.donrailsの場合はCSRFを自前で対応していたり,いろいろ凝ったことをしているので大変だったが,こっちはあんがいとうまくいった.
]]>etchにminimalからイメージをつくる
$ sudo vzctl create 1002 --ostemplate debian-4.0-i386-minimal --hostname araki2 Creating VPS private area: /var/lib/vz/private/1002 Performing postcreate actions VPS private area was created
IPアドレスを設定.bridgeを手で用意したりトンネル設定する必要もない.
$ sudo vzctl set 1002 --ipadd 210.157.x.y --nameserver 210.157.x.z --saveおわったら vzctl start 1002して,vzctrl enter 1002ではいり,apt-get update.(sshが例の穴いりのやつなので..)
/homeをmountする. vzctl start 1002時に/homeがmountされるように,/etc/vz/conf/1002.mountを
#!/bin/sh mount --bind /home /var/lib/vz/root/1002/homeとする.おわったらこれに+xをしておく.
uid,gidをvipwとvigwしてhostにあわせた.
/etc/vz/conf/1002.umountも用意してみたんだが,どうもいらんようであります.
]]>