検索:
以降の記事を見る

This is ARAKI's daily notes.

実ノ商人ハ先モ立チ我モ立ツコトヲ思フナリ

管理/
カテゴリ/ 技術系技術系エントリの登録: 日記(全部)Feed-icon-14x14:

カテゴリ: debian の記事 [リスト] debianの登録

Debianオフィシャルデベロッパ。ar at debian.org
#1 [debian][大学] hazelsct@debian.orgとgpg鍵交換をした
東大生産研の招きで講演にくる,というポスターに何故かDebianの文字を水曜に発見していたので,即座に調べてメールを送っておいた.そんなわけで招いていた生産研の岡部研究室におじゃまに行く.

何もしらない材料系の教授の前でパスポートをみせて鍵交換したら,変人扱いされて写真をとられてしまった.

15分くらいしゃべってから,講演に.前半はマグネシウム精錬の話.さっぱりわからん.後半は,材料科学で使えるオソtoolの話.彼が作ったものもいっぱい.Transport Phenomena Archiveなるものがあって,いっぱいtoolとか資料がためられている.

written by Ar- at Sun Nov 29 02:31:53 UTC 2009
#1 [debian][大学] 東京エリアDebian勉強会、2009年12月勉強会の参加募集pageをatndにつくりました.
東京Debian勉強会と忘年会 : ATNDをつくりましたので,みなさんぜひよろしく.
12/12の土曜日.東大駒場第二キャンパスです.

written by Ar- at Thu Nov 19 12:41:15 UTC 2009
#1 [debian] 東京Debian勉強会11月

まあうつってない人が数人いますが.こんなかんじでオリンピックセンターでおこなわれました
今回のネタはgnuplot,R言語,octaveというわけだったのですが,nakaoさんのツッコミというかフォローというかがすごい.統計ネタから画像処理ネタまで.

そして,岩松さんが,勉強会の資料をgitで処理する方法を整理してくれました.そのうち公開されるでしょう(←されました).これが今回一番の収穫だったのかもしれません.

次回は12/12の土曜.東大駒場2キャンパス,先端科学技術研究センター3号館の中2階でやります.
ちなみに今日あるいたところ,オリンピックセンターからは徒歩30分ほどでした.まだ何をやるのか決まってませんが.
忘年会な気分で今年のDebian総括とか夕方までやって,夜は下北沢でも行きますかね.



written by Ar- at Sun Nov 15 14:32:16 UTC 2009
#1 [centos][git][debian] CentOS5.3でgitoriousを動かすまで.

CentOS5.3でgitoriousを動かすまで.

以下は,gitorious.orgにある2009年11月7日版で動かす話.

おおむね,http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-centos.txt にある通りやればいいのだが,いかんせんupdateされていないので,酔狂な人以外はubuntuでやるのがいいと思います.

CentOSのpackage以外で利用したものは以下の通り.
  • ImageMagickのインストール.ImageMagick-6.5.5-3を自分は使った.
    • http://ftp.de.debian.org/debian/pool/main/i/imagemagick/imagemagick_6.5.5.3.orig.tar.gz
  • aspellとaspell-enのインストール.
    • http://ftp.de.debian.org/debian/pool/main/a/aspell/aspell_0.60.6.orig.tar.gz
    • http://ftp.de.debian.org/debian/pool/main/a/aspell-en/aspell-en_6.0-0.orig.tar.gz
  • sphinxのインストール
    • http://www.sphinxsearch.com/downloads.html
  • gitのインストール
    • git-1.6.5.2
  • oniguruma
    • onig-5.9.1.tar.gz
  • ruby enterprise.

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はもういらない.


written by Ar- at Sun Nov 08 22:16:31 UTC 2009
#1 [debian][git] gitoriousをdebian lennyにいれる

参考

  • http://d.hatena.ne.jp/bannyan/20090131/1233399237
  • http://d.hatena.ne.jp/Hirohiro/20090522/1243016921 (おすすめ)
  • http://gitorious.org/gitorious/mainline/blobs/master/doc/recipes/install-ubuntu.txt と
  • http://gitorious.org/gitorious/mainline/blobs/master/doc/README
  • http://gitorious.org/gitorious/pages/UbuntuInstallation
  • http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_serverにかかれているとおり.

基本ライブラリをdebでいれる.

 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

REEのインストール

 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>

gitoriousに必要なgemをいれる.

 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

gitoriousの設定

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]

/etc/init.dに必要なdaemonを追加

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 .

git userをつくる

 adduser git
 chown -R git:git /home/gitorious
 su - git

*.ymlの設定

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しまくり.

 rake tmp:create
 rake db:create RAILS_ENV=production
 rake db:migrate RAILS_ENV=production
 rake ultrasphinx:bootstrap RAILS_ENV=production

.bash_profile

 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の設定.

apacheにSSL設定

起動

  • 本体はpassengerであがる.

  • RAILS_ENV=production ./script/poller start


トラブル

ssh鍵が登録できない

broker.ymlを設定する.

 gem install stompserver 
 ln -s /opt/ruby-enterprise-1.8.7-20090928/bin/stompserver /usr/bin

さらに /etc/init.d/stompを設定する.

aspellがおかしい.

http://millarian.com/programming/installing-aspell-and-raspell-for-ultrasphinx/ をまず見る.

rootでこれをやる.

 rake ultrasphinx:spelling:build RAILS_ENV=production

written by Ar- at Sun Nov 08 04:36:40 UTC 2009
#1 [debian] Debian lennyにEucalyptusをいれてhadoopを動かす

Debian lennyにEucalyptusをいれてhadoopを動かすまでを公開することにする.

localのswitchが遅いとEucalyptusは泣きがはいるな..GbE以外爆発しろ,というかんじか.


written by Ar- at Fri Oct 30 10:37:14 UTC 2009
#1 [debian][ruby] lennyにRuby Enterpriseをいれてみた

ふとおもって試してみた.http://rubyforge.org/frs/download.php/64475/ruby-enterprise-1.8.7-20090928.tar.gzからとってきて,展開して.installというコマンドを叩くだけという簡単さ.

ちゃんとインストール前に依存するライブラリの存在も調べてくれる.自分は

 apt-get install libreadline5-dev

をやるだけですんだ.

インストール先は /opt/ruby-enterprise-1.8.7-20090928 といったかんじになる.

ubuntu用のdebをdebian用に書きかてる人もいるのでそっちがいい人は使うといいと思います.


written by Ar- at Mon Oct 05 07:14:25 UTC 2009
#1 [debian] lvmとext3の縮小

lvmの余裕diskがないので/homeを縮めてspaceをあけることにした./homeをめいいっぱいでかいext3 on lvmにしてたのを40Gに縮めることにした.

# umount /home
# fsck.ext3 -f /dev/lvm/home
# resize2fs /dev/lvm/home 40G
# mount -a
# lvreduce -L 40G /dev/lvm/home

written by Ar- at Sun Oct 04 03:59:03 UTC 2009
#1 [debian] Debian lennyでXenをこさえてみる

ちょっとlennyでxenをこさえてみることにした.

 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

written by Ar- at Sun Oct 04 03:55:05 UTC 2009
#1 [debian] キーサインパーティーその後はenigmailをつかった
普段ならいちいちfileをdownloadして処理するのだが,今回はその数が多く,そしてmailがいまimapになってしまっているので大量の処理が実に面倒..
というわけで,久しぶりにenigmailをつかおうとおもったら,thunderbird3では(当然だけど)未対応.

こまったなとおもっていたら,対応版があった.
Enigmail: Enigmail Nightly Builds
Thunderbird (but not in Seamonkey), the current nightly builds do not work on Seamonkey.
Author's nightly builds
Contributed nightly builds

ありがたく処理をする.gpgのはいってるパスを指定するだけで使えるのでラク.mewの入れ子はわからないけど,signing-partyというかcaffが送ってくるキーの処理は楽チン.gpg-agentを使わなくても,5分間はThunderbirdのほうで保持をしてくれる.もちろんgpg-agentをつかうことも可能.

written by Ar- at Fri Sep 18 00:21:44 UTC 2009
カテゴリ名(記事数: カテゴリの説明) > サブカテゴリ [+]
reading categories...