2007 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2008 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2009 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2010 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2011 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 |
2012 | 01 | 02 |
2012-02-08
■[Software][UNIX] gitをCentOS5(Final)にインストールして使ってみる。

CentOS5(Final)にgitをインストールして使ってみる。
インストール
参照したサイト。
http://d.hatena.ne.jp/mrgoofy33/20110206/1296952248
http://www.qualysite.co.jp/tech-blog/?p=3131
http://1000g.5qk.jp/tag/%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/
git.repoの追加
[git] name=Base git repository baseurl=http://www.kernel.org/pub/software/scm/git/RPMS/$basearch enabled=1 gpgcheck=0
これなんだけど、yum updateを実行すると
.... http://www.kernel.org/pub/software/scm/git/RPMS/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: git. Please verify its path and try again ....
というエラーがでる。なので結局git.repoを削除した。
rpmforge.repoの追加
これはすでに追加してあった。
[rpmforge] name = Red Hat Enterprise $releasever - RPMforge.net - dag #baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge enabled = 0 protect = 0 gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag gpgcheck = 1
gitのインストール
つまり、rpmforgeの設定だけを行った状態で、以下を実行したところうまくいってしまった。
# yum install git --enablerepo=rpmforge .... Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing for dependencies: git i386 1.7.8.2-2.el5.rf rpmforge 6.7 M perl-Git i386 1.7.8.2-2.el5.rf rpmforge 25 k Transaction Summary ============================================================================= Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 6.8 M Is this ok [y/N]: y Downloading Packages: (1/2): perl-Git-1.7.8.2-2 100% |=========================| 25 kB 00:00 (2/2): git-1.7.8.2-2.el5. 100% |=========================| 6.7 MB 00:13 .... Installing: perl-Git ######################### [1/2] Installing: git ######################### [2/2] Dependency Installed: git.i386 0:1.7.8.2-2.el5.rf perl-Git.i386 0:1.7.8.2-2.el5.rf Complete! # which git /usr/bin/git # git --version git version 1.7.8.2 #
使い方
http://www.ne.jp/asahi/hishidama/home/tech/git/github.html
1. sshの公開鍵を登録
github.comにログインしてaccount settingsのSSH Public Keysからssh公開鍵を登録。
ssh-keygenで作った~/.ssh/id_dsa.pubをコピペするのだが、1行になるようにペーストすること(teratermでは改行しちゃうので注意)。
以下のようにsshでテストしてみる。
$ ssh git@github.com The authenticity of host 'github.com (XXX.XX.YYY.ZZZ)' can't be established. RSA key fingerprint is XX:YY:ZZ:aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'github.com,XXX.XX.YYY.ZZZ' (RSA) to the list of known hosts. Hi githubのユーザID! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed. $
「githubのユーザIDで認証されたが、shellを提供していないので接続終了」とメッセージが出ればOK。
2. githubでリポジトリを作成
ログイン画面のトップにある、「Create A Repository」の絵をクリックし、「Click New Repository」をクリックしてプロジェクト名を入力。他は任意。
登録すると使い方が表示される。
3. ローカルの作業環境の作成
上記で表示された使い方をもとにしてローカルマシンで作業環境を作成する。
githubを初めて使う場合、最初だけ以下を実行。
$ git config --global user.name "githubのユーザID" $ git config --global user.email githubの登録時に指定したメールアドレス
以下から作業環境の作成。
$ mkdir jquery-pagescroll $ cd jquery-pagescroll/ $ git init Initialized empty Git repository in /home/foo/bar/github/jquery-pagescroll/.git/ $ touch README $ git add README $ git commit -m 'first commit' [master (root-commit) 0148510] first commit 1 files changed, 24 insertions(+), 0 deletions(-) create mode 100644 README $ git remote add origin git@github.com:"githubのユーザID"/jquery-pagescroll.git $ git push -u origin master Counting objects: 3, done. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 587 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To git@github.com:"githubのユーザID"/jquery-pagescroll.git * [new branch] master -> master Branch master set up to track remote branch master from origin. $
gitの特徴としては、git remode add origin ....にてorigin(gitでは慣例の名前)としてgithubのリポジトリを結び付けてpushする。masterは初期値のブランチ名らしい。
READMEファイルがあるとそれがgithubのリポジトリページで表示される。拡張子により、wiki風だったりかけるらしい。
2012-02-03
■[PHP][Software] PHP5.3でwordpressのevent-calendar pluginを動作させるには

wordpressのプラグインである、event-calendar(3.1.4)だが、PHP5.3にするとエラーになる。
以下のサイトの通り、参照渡しをやめると動作するらしい。
http://penguin.firetree.net/pipermail/eventcalendar/2009-August/005572.html
ちなみにPHP5.3では、参照を期待している関数をcall_user_func_array()で呼び出す場合、関数の引数として指定するものでも参照で宣言しないといけないらしい。以下のサイトが詳細に説明してくれている。
wordpressでは、pluginの関数は、call_user_func_array()で呼び出され、その際、呼び出す関数への引数には参照でないものが指定されているとエラーになるようだ。
2012-01-25
■[UNIX] ubuntu 11.10 に java6 を入れる。

archive.canonical.com だけではだめだった。
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" $ sudo add-apt-repository "deb http://archive.canonical.com/ lucid-updates partner" $ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse" $ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse" $ sudo apt-get update $ sudo apt-get install sun-java6-jdk
2012-01-11
■[UNIX][Software] CentOSでObjective-Cをインストール

Objective-Cのお勉強のためインストール。gccにObjective-Cのライブラリをインストールする形のようだ。
# cat /etc/redhat-release CentOS release 5 (Final) # yum install gcc-objc .... # rpm -qa | grep libobjc libobjc-4.1.2-51.el5 #
サンプルコード
Objective-Cではインタフェイスを記述して実装するという手順を踏む。
ソースコードは*.hと*.mとあり、*.mに両方書いてもいいが、ヘッダのインポート、インタフェイスは*.hに記述して実装は*.mに書いておく。
$ cat hello.h /** hello.h */ #import <stdio.h> #import <objc/Object.h> @interface HelloWorld : Object - (void) printMessage; @end $ cat hello.m /** hello.m */ #import "hello.h" @implementation HelloWorld - (void) printMessage { printf("Hello World\n"); } @end int main(int argc, char **argv) { // id obj = [HelloWorld alloc]; // [obj printMessage]; [[HelloWorld alloc] printMessage]; return 0; } $ gcc -o hello hello.m -lobjc $ ./hello Hello World $
-lobjcの指定が必要。
2011-12-16
■[JavaScript][HTML][PHP] PHPのために指定した配列用name属性をjavascriptで扱うには

PHP側で配列として処理するためにname属性を'foo'のように指定した場合、この属性をjavascriptで扱う場合には以下のように、document.form.elements['foo']とする必要がある。
document.form.foo は当然、 undefined であるし、 document.form.foo[] も構文エラーになるため。
<script type="text/javascript"> //<![CDATA[ function my_confirm(df) { if (df.elements['foo[]'].length > 0) { for (var i = 0; i < df.elements['foo[]'].length; i++) { if (fo.elements['foo[]'][i].checked) { alert("checked = " + fo.elements['foo[]'][i].value); } } } return confirm("ok?"); } //]]> </script> .... <form action="bar.php" method="post" name="form" onsubmit="return my_confirm(document.form);"> <input type="checkbox" name="foo[]" value="a" />A <input type="checkbox" name="foo[]" value="b" />B <input type="checkbox" name="foo[]" value="c" />C <input type="submit" value="submit" /> <input type="reset" value="reset" /> </form>