TwitterIrcGatewayの基本設定

バックアップするとき用のメモ書き

サーバー

ホスト名:119.82.26.195(ドメイン失効してしまったらしい・・)
ポート番号:16669

コンフィグ

/join #Console
show
Set EnableRepliesCheck True
set EnableTypableMap true
Group
Invite #Group_Name User_Name

基本難しい設定とかしてないです。

Google Wave Robots API V2

Python Tutorialを参考にまずはデモを動かしてみます。
http://code.google.com/intl/ja/apis/wave/extensions/robots/python-tutorial.html

Debian環境だとこんな感じです。

$ python --version
Python 2.5.2

Python 2.5以上ということで動作環境としては問題なさそうですね。

$ cd /home/eros/wave/bot
$ svn checkout http://wave-robot-python-client.googlecode.com/svn/trunk/src/waveapi waveapi

Subversionでwaveapiをダウンロードします。

Google App Engine上で、
https://appengine.google.com/

Google App Engine

Google wave API Challenge セットアップHackathonに参加するため、突貫でGoogle App Engineの環境整えてみました。
waveのbotを設置するための場所として、Google App Engineが必要となるわけです。

開発環境は、Debian

Google App Engine SDK
http://code.google.com/intl/ja-JP/appengine/downloads.html

実はJavaPythonも知らないので、今回は軽そうなPython環境を選択しました。

Google App Engine SDK for PythonLinux/その他のプラットフォームから、google_appengine_1.3.1.zipをダウンロードします。

google_appengineに以下のようなファイルが展開されます。

$ ls -F
BUGS README VERSION bulkload_client.py* demos/ google/ new_project_template/ templates/
LICENSE RELEASE_NOTES appcfg.py* bulkloader.py* dev_appserver.py* lib/ remote_api_shell.py* tools/

ローカルのテスト環境になります。

ここにサンプルをおいてもいいんですけど、混乱しそうなのでgoogle_appengineと同じ階層にテスト用のディレクトリを作ります。

ls -F
appengine/ wave/

wave以下にサンプル用のhelloworldディレクトリを置くことにします。

スタート ガイド: Python
http://code.google.com/intl/ja/appengine/docs/python/gettingstarted/

上記のガイドを参考にして、動かしてみましょう。

helloworld.py

print 'Content-Type: text/plain'
print ''
print 'Hello, world!'

お約束のHello, world!を表示するリクエストハンドラです。

app.yaml

application: helloworld
version: 1
runtime: python
api_version: 1

handlers:
- url: /.*
  script: helloworld.py

Plagger使っている人にはおなじみのYAML形式の設定ファイルですね。

この二つのファイルで準備完了です。
さっそく動かしてみましょう。

$ ./appengine/dev_appserver.py /home/eros/wave/helloworld/

http://localhost:8080/
に接続して、Hello, world!と表示されれば成功です。

仕上げにGoogle App Engineに上げてみましょう。

./appengine/appcfg.py update ./wave/helloworld/


Linux上からだと毎回メアドとパスワード入力しなくちゃならないんですかねぇ。

さて、Google App Engine環境の用意ができたので、ようやくGoogle Wave Robots V2を試せるようになりました。

EcVps

ちょっと海外のテスト用のサーバーを利用したくなったのでDeliciousのタグを辿って、VPS探してみました。

EcVps
http://ecvps.com

月額$10.00 (USD)とかなりお安いと思います。

仮想化はOpenVZを利用しており、OSはDebianを選択しました。
Debianサーバーを運用するのは初めてなので備忘録としてこれから色々書き込んでいきます。

Debian GNU/Linux徹底入門第3版 Sarge対応

Debian GNU/Linux徹底入門第3版 Sarge対応

[入門] Debian パッケージ

[入門] Debian パッケージ

calendar

calendarは、今日の日付に関連した出来事を表示してくれるコマンドです。

インストールして実行してみると

calendar
calendar: no calendar file: ``calendar'' or ``~/.calendar/calendar''

ファイルがないよと言われてしまいます・・。

cd /usr/share/calendar
ls
calendar.all
calendar.birthday
calendar.christian
calendar.computer
calendar.croatian
calendar.discord
calendar.fictional
calendar.french
calendar.german
calendar.history
calendar.holiday
calendar.judaic
calendar.music
calendar.openbsd
calendar.pagan
calendar.russian
calendar.space
calendar.ushistory
calendar.usholiday
calendar.world
de_DE.ISO_8859-1/
fr_FR.ISO8859-1/
hr_HR.ISO_8859-2/
ru_RU.KOI8-R/

沢山のカレンダーファイルのサンプルがあるので、好きなものを選びましょう。
今回は、お勧め詰め合わせファイルのcalendar.worldを選択しました。

mkdir .calendar
cp /usr/share/calendar/calendar.world .calendar/calendar

歴女には必須のコマンドですね!

詳説世界史研究

詳説世界史研究

fortune

雑学系コマンド。
portsyumでインストール。

作業中に行き詰まったときなど、このコマンドと打ってみるといいでしょう。
ログイン時に表示させるのもいいですね。

FreeBSDDebianの場合は

'/usr/games/fortune'

CentOSの場合は

'/usr/bin/fortune'

環境変数に追加。

UNIXシェルスクリプトコマンドブック

UNIXシェルスクリプトコマンドブック

Tritonnのインストール

今までSenna使ったことなかったのですが、TritonnならRPMでラクチンインストールができるようなので試してみました。

http://sourceforge.jp/projects/tritonn/releases/

rpm -ivh MySQL-client-5.0.67-tritonn.1.0.12.i386.rpm MySQL-devel-5.0.67-tritonn.1.0.12.i386.rpm MySQL-server-5.0.67-tritonn.1.0.12.i386.rpm MySQL-shared-5.0.67-tritonn.1.0.12.i386.rpm mecab-0.97-tritonn.1.0.12.i386.rpm mecab-ipadic-2.7.0.20070801-tritonn.1.0.12.i386.rpm senna-1.1.4-tritonn.1.0.12.i386.rpm

まとめてRPM指定すると依存とかうまい具合に解決してくれます。

MySQLのコンフィグは後で設定しますか。

現場で使える MySQL (DB Magazine SELECTION)

現場で使える MySQL (DB Magazine SELECTION)

CentOSにGaucheをインストール

先日プログラミングGaucheを購入したので、CentOSにもインストールしてみました。
残念ながら、CentOS用のRPMがないようですが、specファイルがあるので自分で作ってみます。

参考記事
http://d.hatena.ne.jp/t2y-1979/20080902/1220345859

まずはRPM作成の環境構築。

yum install rpm-build gcc gdbm gdbm-devel

Gaucheをダウンロードしてきて、RPMを作成して、インストールします。

wget http://prdownloads.sourceforge.net/gauche/Gauche-0.8.14.tgz
rpmbuild -ta Gauche-0.8.14.tgz
rpm -ivh /usr/src/redhat/RPMS/i386/Gauche-*.rpm

早速起動してみます。

$ gosh
gosh> (+ 1 2)
3
gosh> (exit)

とりあえずお約束のHello, Worldを。

vi hello.scm

(define (main args)
  (print "Hello, World.")
  0)

実行。

$ gosh hello.scm
Hello, World.

あとは本を読みながら、CGIを作ってみようかと思います。


プログラミングGauche

プログラミングGauche

CentOS 初期設定(リポジトリ追加)

CentOSってデフォルトの状態では、ろくすっぽパッケージが入ってないのですよね・・。

CentOSリポジトリを増やす
http://rally.jp/comp/archives/2008/02/centos.php

上記の記事を参考にして、設定します。

まずは、yum-fastestmirrorをインストール。

/etc/rc.d/init.d/yum-updatesd stop
chkconfig yum-updatesd off
yum install yum-fastestmirror
wget ftp://ftp.riken.jp/Linux/centos/5.2/os/i386/CentOS/yum-cron-0.6-1.el5.centos.noarch.rpm
rpm -ihv yum-cron-0.6-1.el5.centos.noarch.rpm
/etc/rc.d/init.d/yum-cron start
chkconfig yum-cron on

次に、Extra Packages for Enterprise Linux (EPEL) をインストールします。
DLはこちらから。
http://fedoraproject.org/wiki/EPEL

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
rpm -ihv epel-release-5-3.noarch.rpm

後は、Dag Wieersさんところのリポジトリ追加しておけばとりあえず事足りるかな。
http://dag.wieers.com/rpm/

レンタルサーバー移行

sakuraで借りていたレンタルサーバーがなぜかWeb接続が激重状態に。

いくら設定を見直しても原因がわからず、4年近く借りていたこともあり、新しいプランに移行することにしました。

専用レンタルサーバホスティング)TOP>専用サーバ>エントリー
http://server.sakura.ad.jp/dedicated/entry/

マシン自体の性能も上がることだし、よしとしたいところですが、以前利用できたFreeBSDが対象から外れてCentOSしか使えません・・。
しょうがないのでこれを機会にRedHat系の使い方を思い出しながら、勉強していきたいと思います。

以前購入したFedora7で作るネットワークサーバ構築ガイドを参考にしたいと思います。