2012年1月30日月曜日

CentOS5.7でChiliProject


◆環境
CentOS5.7
最小パッケージ

◆RPMパッケージ
◆◆wget
◆◆git
rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
yum install git
◆◆ruby
・ruby本体
ruby-1.8.7.249-1.x86_64.rpm
・ruby-devel
ruby-devel-1.8.7.249-1.x86_64.rpm
・rubygemsインストール
ruby-irb-1.8.7.249-1.x86_64.rpm
ruby-libs-1.8.7.249-1.x86_64.rpm
ruby-rdoc-1.8.7.249-1.x86_64.rpm
rubygems-1.3.7-1.noarch.rpm
◆◆make
◆◆gcc
◆◆ImageMagick関連
yum install -y {libwmf,lcms,ghostscript,ImageMagick}{,-devel}
◆◆sqlite関連
yum install sqlite{,-devel}
◆◆rmagick用Microsoftコアフォント
# wget http://quattorsrv.lal.in2p3.fr/packages/lemon/sl-i386/msttcorefonts-2.0-1.noarch.rpm# rpm -ivh msttcorefonts-2.0-1.noarch.rpm # ln -s /usr/X11R6/lib/X11/fonts/truetype /usr/share/fonts/default/TrueType

◆mercurial
hgコマンドでプラグインを取得するため
yum install mercurial
◆gemパッケージ
gem install bundler


◆アプリ実行構成
CP2.7.0

◆ChiliProjectのダウンロード
git clone git://github.com/chiliproject/chiliproject.git cd chiliproject git checkout -b my-stable origin/stable  
◆ChiliProjectの導入設定
・gem環境構成
CPルートで
 bundle install --without test development
→CentOS5.7は最新のrmagickのgem構築に失敗するのでGemfileを編集
これはGemfile内に記載あり
→mysqlとpgのgem構築に失敗するのでGemfileをコメントアウト
 vi Gemfile
# diff Gemfile.bak Gemfile
30c30
< gem "rmagick", ">= 1.15.17"
---
> #gem "rmagick", ">= 1.15.17"
44c44
< #gem "rmagick", "< 2.0.0"
---
> gem "rmagick", "< 2.0.0"
55c55
< gem "mysql2", "~> 0.2.7"
---
> #gem "mysql2", "~> 0.2.7"
59c59
< gem "pg", "~> 0.9.0"
---
> #gem "pg", "~> 0.9.0"
66c66
< gem "mysql"
---
> #gem "mysql"
85c85
< gem "activerecord-jdbcmysql-adapter"
---
> #gem "activerecord-jdbcmysql-adapter"

・空のデータベースを作成する。(sqliteなので不要)
・config/database.yml
config/database.yml.exampleを参考にconfig/database.ymlを作成する
cp -p config/database.yml.example config/database.yml
vi config/database.yml
SQLiteの場合
production: adapter: sqlite3 database: db/chiliproject.db
・config/configuration.yml
config/configuration.yml.exampleを参考にconfig/configuration.ymlを作成する
cp -p config/configuration.yml.example config/configuration.yml
→とりあえずそのまま
・Generate a session store secret
bundle exec rake generate_session_store
・データベース基本構造を作成する
RAILS_ENV=production bundle exec rake db:migrate
・デフォルト設定データをデータベースに作成する
RAILS_ENV=production bundle exec rake redmine:load_default_data
・パーミッションを設定する
→Windowsでは不要
mkdir -p tmp public/plugin_assets sudo chown -R chiliproject:chiliproject files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets
・起動してみる
bundle exec script/server -e production -p 3300
◆Pluginインストール時の操作
・コピーする
・ディレクトリ名を適切にする
・DBを更新する
bundle exec rake db:migrate:plugins RAILS_ENV=production


◆Plugins
・パーキングロットチャート
git clone git://github.com/daipresents/redmine_parking_lot_chart.git
・redmine_absolute_dates
Redmineの作成日、更新日などの相対表現表示を絶対表現になおすプラグイン
git://github.com/suer/redmine_absolute_dates.git
・redmine_attachments_size
貼りつけているファイルの総サイズを表示するプラグイン
git://github.com/suer/redmine_attachments_size.git

Wikiでテンプレートを選択できるようにする
git://github.com/generaldesoftware/RedMine-plantillas-plugin.git

タグ付けできるようににする
git://github.com/friflaj/redmine_tagging.git
・Wikiの機能拡張
hg clone https://bitbucket.org/haru_iida/redmine_wiki_extensions

チケットをGETで書ける
hg clone https://code.google.com/p/redmine-post-link-plugin/

チケットからグラフ作成
git://github.com/tsukano/redmine_arrangeable_graph_maker.git
config/config.yml の中の「graph_font_path」の値として、日本語フォントまでのパスを指定。
・知識データベース
git://github.com/alexbevi/redmine_knowledgebase.git
・ミーティング管理
git://github.com/amartel/redmine_meetings.git
・ガントチャート改良
git://github.com/kulesa/redmine_better_gantt_chart.git
.リポジトリサーチ
redmine_reposearch
git://github.com/Surgo/redmine_reposearch
・設計変更を記録する
redmine_arch_decisions
git://github.com/bigokro/redmine_arch_decisions.git
・用語集
http://sourceforge.jp/projects/rp-glossary/downloads/53770/rp-glossary-0.6.1.zip/
・マイページ編集プラグイン
git://github.com/vividtone/redmine_vividtone_my_page_blocks.git

◆参考
https://www.chiliproject.org/projects/chiliproject/wiki/Download
https://www.chiliproject.org/projects/chiliproject/wiki/Installation

◆プラグインインストールメモ
・知識データベースredmine_knowledgebase
以下をインストールする必要あり
rubygemのacts-as-taggable-on
プラグインの
acts_as_taggable_on_steroids (http://github.com/jviney/acts_as_taggable_on_steroids)
git://github.com/jviney/acts_as_taggable_on_steroids.git

2012年1月21日土曜日

node.js試行1


node.jsのワンライナーWebサーバに衝撃を受けてnode.jsを始めてみる。
nave + npm + node.jsの構成でやってみる。
ついでにcoffeescriptも

【環境】
Lubuntu11.10

【準備】
以下のパッケージは入れておくこと
・git
・curl
・libssl-dev
・g++

!naveをインストール
naveの最新版をGithubからclone
$ cd ~/mytools
$ git clone http://github.com/isaacs/nave.git

!node.js
!!インストール
$ cd ~/mytools/nave
$ ./nave.sh install latest

!!使用するための設定(パスを通す)
$ ./nave.sh use latest

!npmインストール
→特に不要。npmコマンドがすぐに使えるはず。

!coffeescriptインストール
$ npm install -g coffee-script

!バージョン確認
$ node -v
v0.7.0

$ npm -v
1.1.0-2

$ coffee -v
CoffeeScript version 1.2.0

2011年11月21日月曜日

[Android]F-12C(V13) root化

F-12CをlinuxPCからroot化したのでメモ
ドライバ導入とかいらない分こっちの方が楽かも
あとroot化ツールの自動実行スクリプトが間違っていたことがわかった。
解凍してそのまま実行するとハマるかも。
【手順】
・zergRush_automated_Linux_rootをダウンロードする。
・ベンダIDの記載
# echo "0x04C5" > ~/.android/adb_usb.ini
・ zergRush_automated_Linux_rootを解凍する(例ではホームディレクトリ直下)
・ zergRush_automated_Linux_rootを解凍したディレクトリに入って以下コマンドを実行する。
(提供スクリプトの内容を打ち込んだだけだが結果としてミスを発見できてよかった)
実行ログ
# cd ~/zergRush_automated_Linux_root
# ./files/adb shell rm -r /data/local/tmp
# ./files/adb shell mkdir /data/local/tmp
# ./files/adb push ./files/zergRush /data/local/tmp/
329 KB/s (23052 bytes in 0.068s)
# ./files/adb shell chmod 755 /data/local/tmp/zergRush
# ./files/adb shell /data/local/tmp/zergRush
[**] Zerg rush - Android 2.2/2.3 local root
[**] (C) 2011 Revolutionary. All rights reserved.
[**] Parts of code from Gingerbreak, (C) 2010-2011 The Android Exploid Crew.
[+] Found a GingerBread ! 0x00016118
[*] Scooting ...
[*] Sending 149 zerglings ...
[+] Zerglings found a way to enter ! 0x10
[+] Overseer found a path ! 0x000161e0
[*] Sending 149 zerglings ...
[+] Zerglings caused crash (good news): 0x40119cd4 0x0054
[*] Researching Metabolic Boost ...
[+] Speedlings on the go ! 0xafd25611 0xafd390bf
[*] Popping 24 more zerglings
[*] Sending 173 zerglings ...
[+] Rush did it ! It's a GG, man !
[+] Killing ADB and restarting as root... enjoy!
# ./files/adb wait-for-device
# ./files/adb push ./files/busybox /data/local/tmp
3204 KB/s (1075144 bytes in 0.327s)
# ./files/adb shell chmod 755 /data/local/tmp/busybox
# ./files/adb shell /data/local/tmp/busybox mount -o remount,rw /system
# ./files/adb push files/busybox /system/xbin
2923 KB/s (1075144 bytes in 0.359s)
# ./files/adb shell chown root.shell /system/xbin/busybox
# ./files/adb shell chmod 04755 /system/xbin/busybox
# ./files/adb shell /system/xbin/busybox --install -s /system/xbin
# ./files/adb shell rm -r /data/local/tmp/busybox
# ./files/adb push ./files/su /system/bin/su
360 KB/s (22228 bytes in 0.060s)
# ./files/adb shell chown root.shell /system/bin/su
# ./files/adb shell chmod 06755 /system/bin/su
# ./files/adb shell rm /system/xbin/su
# ./files/adb shell ln -s /system/bin/su /system/bin/su
link failed File exists
★ここを/system/xbin/suに修正
# ./files/adb shell rm /system/xbin/su
rm failed for /system/xbin/su, No such file or directory
# ./files/adb shell ln -s /system/bin/su /system/xbin/su
# ./files/adb push ./files/Superuser.apk /system/app/
3001 KB/s (762010 bytes in 0.247s)
# ./files/adb shell rm -r /data/local/tmp
# ./files/adb reboot
以上

2011年10月10日月曜日

[DragonFly BSD]Xの設定(X ディスプレイマネージャの設定)

■XDMを使用する場合
~/.xsessionに言語とxの起動コマンドを設定する。
以下は日本語でXfceを使用する例
% echo "#!/bin/sh" > ~/.xsession
% echo "export LANG=ja_JP.UTF-8" >> ~/.xsession
% echo "/usr/pkg/bin/startxfce4" >> ~/.xsession

% chmod +x ~/.xsession
注)
"/usr/pkg/bin/startxfce4"は使用したいX環境で異なる。
Gnome: "/usr/pkg/bin/gnome-session"
KDE: "exec startkde"
Xfce: "/usr/pkg/bin/startxfce4"
Fluxbox: "/usr/pkg/bin/startfluxbox"
LXDE: "/usr/pkg/bin/

・XDMの有効化
/etc/ttysのttyv8のエントリを以下のように設定する。

ttyv8 "/usr/pkg/bin/xdm -nodaemon" xterm on secure

■GDMを使用する場合
・~/.xsessionの設定はXDMと同様
・GDMの有効化
/etc/rc.confに以下を設定してリブートする。
gdm_enable="YES"

■KDMを使用する場合
・~/.xsessionの設定はXDMと同様
・KDMの有効化
/etc/ttysのttyv8のエントリを以下のように設定する。

ttyv8 "/usr/pkg/bin/kdm -nodaemon" xterm on secure

[DragonFly BSD]Xの設定(Xface)

Xfaceはメタパッケージがあるのでインストールが楽


# cd /usr/pkgsrc/meta-pkgs/xfce4
# bmake bin-install clean
注)
"bmake install clean"してもよいが時間がかかる。

使用したい各ユーザで以下を設定してstartxすれば起動する。
% echo "/usr/pkg/bin/startxfce4" > ~/.xinitrc

[DragonFly BSD]Xの設定(Xのインストール)

GUIがないバージョンをインストールしたためX環境の構築を始める。
UbuntuではLXDEをつかっているのでLXDEを使いたいがとりあえずはfluxboxとかxfceがつかえればOK。
まずはstartxできるまで。


Xのインストール

# echo "X11_TYPE=modular" >> /etc/mk.conf

# cd /usr/pkgsrc/x11/modular-xorg-server
# bmake bin-install clean
# cd /usr/pkgsrc/meta-pkgs/modular-xorg-drivers
# bmake bin-install clean
# cd /usr/pkgsrc/meta-pkgs/modular-xorg-fonts
# bmake bin-install clean
# cd /usr/pkgsrc/meta-pkgs/modular-xorg-libs
# bmake bin-install clean
# cd /usr/pkgsrc/meta-pkgs/modular-xorg-apps
# bmake bin-install clean

# startx

とりあえずこれでtwmは使用可能。
不具合はなかった。


【参考】
http://www.dragonflybsd.org/docs/newhandbook/X/

[DragonFly BSD]日本語環境の構築


■シェルのロケールの設定
●Cシェル系の場合「~/.cshrc」

setenv LANG "ja_JP.UTF-8"
●bashの場合「~/.bashrc」

export LANG="ja_JP.UTF-8"

■日本語フォントのインストール
ライセンス上の制約から、「/usr/pkg/etc/mk.conf」に次のような設定行を加える。(jisx0208fonts導入時の情報のためipafontで必要かは不明)
ACCEPTABLE_LICENSES+=no-commercial-use

IPA日本語フォントを含むパッケージ「ipafont」をインストール
# pkg_search -v ipafont
# cd /usr/pkgsrc/fonts/ipafont/
# bmake install clean

IPA日本語フォントを含むパッケージ「ipaexfont」をインストール

他にも日本語フォントを含むパッケージは「jisx0208fonts」、「jisx0212fonts」、「jisx0213fonts」などがあるがダサすぎるので入れなくていいと思う。

多国語フォントのパッケージ「intlfonts」もインストール
# cd /usr/pkgsrc/fonts/intlfonts/
# bmake install clean


■X環境の日本語化
X環境の設定を参照

■日本語IMEの設定
追記予定
ibus-mozcを使いたい。
mozcはja-mozc?


# cd /usr/pkgsrc/inputmethod/ibus-anthy


# bmake bin-install clean


.xinitrc の scim 関係の設定を以下に変更

export XIM="ibus"
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="xim"
export XMODIFIERS="@im=ibus"

ibus-daemon -d -x &
【参考】
DragonFly BSD 2.2における日本語環境の構築
http://sourceforge.jp/magazine/09/03/10/0750248