2010年4月4日日曜日

jQueryでセレクトリストの選択を解除する。

jQueryでどのコードが書けるのかが度々わからなくなっちゃうので、備忘録。

フォームからトランザクションを投げた後に、フォームの内容をクリアーしたいんだけど・・・
どうやったらいいかよくわからなかっちゃったけど、試した結果はとっても簡単でした。
// html
<select id='item'>
  <option value='1'>1111</option>
  <option value='2' selected>2222</option>
</select>

// javascript
$('#item').children().removeAttr('selected');


もちろん、以下の様な方法も可能。

$('#item').children().each(
  function(i){
    $(this).removeAttr('selected')
  }
);


「行数が増える事」「内部処理的にあまりかわらない事」を考えると前者の方は1行で済むので優秀。

2010年4月1日木曜日

本日

本日

01:30 出勤
11:30 退勤

16:30 出勤予定

なんで僕だけエイプリルフールじゃないの

2010年3月6日土曜日

TSUTAYA DISCASの回転率

僕は以前(2年くらい前かな)からTSUTAYA DISCASサービスを利用して、
DVDのレンタルをしています。

DVDのレンタルは・・・札幌にいた頃は、1枚100円レンタルの日に5枚くらいを借りていたのですが、
こっちに来た当初は、レンタル価格が思ったよりも高く、レンタル屋に行くにも電車に乗っていくから、あまり安くならない事にも気づき、行く事はなかったのですが・・・

DISCASサービスに出会ってからは、よく利用するようになりました。


このサービス、月2000円なのですが、貧乏症の私は1枚100円の単価は上げたくない。


そうすると、月に20枚弱のDVDを借りるのが目安。

サービスとしては、1回に2枚借りる事になるので、月に10回転。

そうすると、3日で1回転させる事になるのですが、
これがなかなか難しい。

郵便事情と社会人的な事情を考えると、最速で4日が限度。
一番うまくいったときでも16回転が限度でした。

ですが、最近はどうにも3回転くらいがやっとです。

なんか損した気分。

2010年3月4日木曜日

jqueryのダイアログ上からdatepickerを実行する。

また、jqueryでプチはまりました。

jquery uiのdialogで表示されたダイアログ上にフォームを配置して、
そのフォーム上からデータのやり取りをしようと、パーツを配置していったのですが・・・datepickerを配置してもどうにも表示されない。

firebugでちょっと調べたところ、
モーダルダイアログの背景レイヤーにz-indexの1000、
ダイアログ自体にz-indexの1001が設定されておりました。

datepicker自体にはz-indexの指定が無いため、
必然的に発生元となるダイアログよりも下層のレイヤーとなる為に表示されなかった模様です。

ネット調べてみると、dateickerに指定されているスタイルシートクラス「.ui-datepicker」にz-indexをつけて、非常に大きな値を設定する方法が紹介されていましたが、

私の性分として、その時々で決めた「決めうち数値」のルールは、
後から忘れてしまう事が多いので、あまり使いたく有りません。

なので簡単なスクリプトを書くです。
$('#date-input').datepicker({
  beforeShow: function(input, inst){
    $('#ui-datepicker-div')
      .css(
        'z-index',
        parseInt($($(input).parents('.ui-dialog').get(0)).css('z-index')) + 1
      );
  }
});


日本語で略して書くと
「datepickerが配置されているinputアイテムの上位にあるdialogのz-indexの値を調べて、+1した状態で表示する。」です。

dialogの上からdialogを表示してその上にdatepickerを配置する場合も一応ok。
できない場合は、「parents('.ui-dialog').get(0)」のgetの引数を変えてみるといいかも。
「0」指定で、一つ上のdialogが引っ張って来れるはず。

あと、「css('z-index')」で引っ張ってきた値は文字列なので、数値化する必要がある。

2010年2月19日金曜日

phpのsettype関数にぷちはまり

久しぶりにphpにはまりました。

実は構文チェックエンジンを作成してまして、
文書中の"true""false"という文字列を、ブール型のTRUEFALSEとして評価しなきゃいけない機会が発生しました。

ここで私は、settype関数を利用しました。
settype関数は第1引数の変数を第2引数で渡した型文字列で変換するというモノです。
settype(検査したい変数, 変換させたい型)
php:settype

変換に利用できる第2引数には以下が指定できます。
(この時、文字列で指定しなければならないので、クォートします。)
"boolean" or "bool"
"integer" or "int"
"float" or "double"
"string"
"array"
"object"
"null"

今回はブール型に変換したいので"boolean"を指定します。
ですが結果は以下のようになってしまいました。
$item_true = 'true';
$item_false= 'false';

settype($item_true, 'boolean');
settype($item_false, 'boolean');

var_dump($item_true); // boolean true と表示される
var_dump($item_false); // boolean true と表示される


ここで、"boolean" を "bool" に変更しても結果は同じ・・・

そしておかしさに気づいたのですが、上記の $item_true に適当な文字列を突っ込んでみても、boolean true に変換されてしまうのです。


これはと思って以下のように変更!

$item_true = '1';
$item_false= '0';

settype($item_true, 'boolean');
settype($item_false, 'boolean');

var_dump($item_true); // boolean true と表示される
var_dump($item_false); // boolean false と表示される


やっぱり!

phpのtruefalseはdefine定義で1, 0を表しているようなもんだから、変換の時は、1,0を元に評価してしまうのですね。わかります。


元々の目的は構文チェックエンジンの作成なので、
そういうことだったら、以下の記述で十分
$item = 'true';
if($item == 'true' || $item == 'TRUE')
{
  $result = true;
}
else
{
  $result = false;
}

var_dump($result); // boolean true と表示される

2010年2月15日月曜日

厄払い



先日14日に、西新井大師まで厄払いに行ってきましたー。

本当は年始に行こうと思っていたんですが、乗り遅れちゃったので旧正月に合わせていってきました。

お札買って、おみくじも引きました。
おみくじは久しぶりの大吉です!




ただ、何となく体がだるいのはなぜでしょうか・・・風邪をもらってきたかも・・・

2010年1月21日木曜日

PEACE MAKER見た

http://新撰組peacemaker.jp/

なんか違和感。

最初はアニメ化されたときに見てたから、
実写との違和感を感じてたんだと思ってたんだけど、

それもなんか違うなぁと・・・


何が違うかっていうのがさっきわかったんだけど、
このドラマって、お腐さん向けの臭いがぷんぷんすんだよね。


ボクは歴史大好き父さんの影響で、
おっさん向けのテイストで洗脳されてるっぽい。


だから、史実は別にしても「新撰組の隊士はこんな感じ」っていう小説やドラマで
デファクトスタンダードにされている人物像がベースになっちゃって、

漫画という形で、今までの古い常識にメスをいれた上で、
さらにドラマ化っていうと、ボクの知っているものとは全く別になってる上に、
歴史物はなるべく史実に沿って欲しいなんて思ってるもんだから、
やっぱり違和感は感じるなぁ。

2010年1月8日金曜日

AirMacDiskをセットアップしてみる(裸族のインテリジェントビル)



センチュリー社の「裸族のインテリジェントビル」を購入したので早速セットアップです。


ちょっとパソコンの数が増えてきたので、数を減らして管理を楽にしようというのが目的です。


今我が家には、「ファイルサーバ」兼「テレビ録画」兼「アプリサーバ」のパソコンが一台あるのですが、

こいつの「ファイルサーバ」機能をインテリジェントビルに移し、AirPortExtremeにつなげてNASとします。
そして「テレビ録画」機能は、地デジ対応TVキャプチャを買って地デジ対応したいと思います。
※「アプリサーバ」としての機能は、以前このブログでも紹介したMacサーバに移行済みです。



まずは、現状のパソコンのデータを移します。

そもそも、今「ファイルサーバ」として活躍してくれてるパソコンの容量は、
1TBのHDDを4台使ってRAID01を構成しています。

この4台をインテリジェントビルに移してRAID10として利用します。


データ移行ですが、実質のHDD容量が2TB(計算によりますが、windowsで見ると1.8TBと出ます。そう読み取ってください)あるうち、
実際の利用領域は「旧アプリサーバで200GB」「テレビ録画で500GB」なので、1.1TBの移行になります。

その1TBのデータですが、手持ちのHDDの関係で以下のように分割退避。
・500GBHDD
・80GBHDD×2
・60GBHDD
・メインwindows機残り200GB
・Macサーバ残り250GB

という事で、社会人な僕は寝る前の時間、寝てる間、会社にいってる間の時間を使って2日間かけて移行しました。



ようやく移行が終わったら、今度は物理的なセットアップです。

今までのパソコンから取り出して、インテリジェントビルにオン!
RAIDスイッチをいれたらokです!

そしたら、今度はフォーマット。

転送速度が気になるので、eSATAでメインwindows機につなげてNTFSフォーマット。(これは、寝る前にフォーマット設定して、会社行く前が80%超えたくらいの進捗だったので、10時間くらいでおわったかな?)



次は、AirPortExtremeにつなげてデータ転送・・・



HDDが見つからない・・・



AirPortのマニュアルを見ると認識されるとAirMacディスクユーティリティーに認識されると書いてあるけど、全然認識されない。


ではMacでは?
認識される・・・が、書き込めない!


なんで!?


あ、MacはHFSだ!


そんな訳で、HFSで再びフォーマット。
(実はNTFSにフォーマット後に、退避したデータを半分近く戻したので、再退避に1日つかいました・・・(;ω;))



今度は、Macで認識・・・できる!


windowsで認識・・・できない!

AirMacディスクユーティリティーでログインしようとしても・・・




というエラー。


これは、とっさの思いつきで回避できたのだけれども、
AirPortルータのアドレスを指定するとアクセスが可能です。

ただ、設定の度に時間かかるのがいやなので試してないけど、
AirMacディスクユーティリティーが必要だったのかはわからない・・・

2009年12月13日日曜日

xdebugインストール

xdebugはpeclでインストールする。

peclは別個で入れるかどうかするのですが、SuSEユーザの私は「php-devel」をインストールしたときに自動的に入ります。

それで早速コマンド
# pecl install xdebug
downloading xdebug-2.0.5.tar ...
Starting to download xdebug-2.0.5.tar (Unknown size)
...............................................................................................................................................................................................................................................................done: 1,340,928 bytes
67 source files, building
WARNING: php_bin /usr/bin/php5 appears to have a suffix 5, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
building in /var/tmp/pear-build-root/xdebug-2.0.5
running: /tmp/pear/temp/xdebug/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... no
checking for gcc... no
configure: error: in `/var/tmp/pear-build-root/xdebug-2.0.5':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
ERROR: `/tmp/pear/temp/xdebug/configure' failed

cc、gccがないからコンパイルできないぞ・・・と


yastでcc、gccをインストールして再実行。
# pecl install xdebug
downloading xdebug-2.0.5.tar ...
Starting to download xdebug-2.0.5.tar (Unknown size)
...............done: 1,340,928 bytes
67 source files, building
WARNING: php_bin /usr/bin/php5 appears to have a suffix 5, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, ...): suspicious cache-id, must contain _cv_ to be cached
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:1994: AC_CACHE_CHECK is expanded from...
aclocal.m4:3555: AC_LIBTOOL_LINKER_OPTION is expanded from...
aclocal.m4:5493: _LT_AC_LANG_C_CONFIG is expanded from...
aclocal.m4:5492: AC_LIBTOOL_LANG_C_CONFIG is expanded from...
aclocal.m4:2972: AC_LIBTOOL_SETUP is expanded from...
aclocal.m4:2952: _AC_PROG_LIBTOOL is expanded from...
aclocal.m4:2915: AC_PROG_LIBTOOL is expanded from...
configure.in:150: the top level
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from...
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from...
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, ...): suspicious cache-id, must contain _cv_ to be cached
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from...
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from...
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from...
building in /var/tmp/pear-build-root/xdebug-2.0.5
running: /tmp/pear/temp/xdebug/configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory... /usr/lib64/php5/extensions
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking whether to enable eXtended debugging support... yes, shared
checking for gettimeofday... yes
checking for cos in -lm... yes
checking for ld used by cc... /usr/x86_64-suse-linux/bin/ld
checking if the linker (/usr/x86_64-suse-linux/bin/ld) is GNU ld... yes
checking for /usr/x86_64-suse-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc static flag works... yes
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/x86_64-suse-linux/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
sh: make: command not found
ERROR: `make' failed


あれ、makeもはいってなかった・・・


makeもインストールして、再実行!
Build process completed successfully
Installing '/usr/lib64/php5/extensions/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.0.5
configuration option "php_ini" is not set to php.ini location
You should add "extension=xdebug.so" to php.ini


最後だけ抜粋ですがokのようです。
# service apache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done



phpinfoで確認してok

pear.php.net is using a unsupported protocal - This should never happen.

最近Macサーバに移行してから、プログラム類や開発関係のデータもちょっとずつ
移行させているのですが、「あ、xdebug入れてない」と思って、導入開始しました。

たしか、peclかなんかのコマンドで行けるんじゃなかったっけ?
と思って、pearコマンドでインストール開始。

でも、xdebugとは別に以下のエラーが出てしまいました。

pear.php.net is using a unsupported protocal - This should never happen.

これはインストール以前の問題ですね。

プロトコルアンサポート・・・

とりあえずチャンネルを更新しようとおもって、以下のコマンド実行
# pear update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date


あれ、こんなんだっけ?

再度、xdebugインストール実行
# pear install xdebug
pear.php.net is using a unsupported protocal - This should never happen.
install failed



だめだ・・・



それでエラーコードを検索していたら、pearのblogで原因判明!
http://blog.pear.php.net/2009/08/28/fixing-unsupported-protocol/
5.2.10と5.2.11が対象って書いてあるけど、5.3.0も対象ね。


以下、pearのblogより抜粋で実行
# cd `pear config-get php_dir`
# mv .channels .channels-broken
# pear update-channels

どうにもチャンネルデータが壊れているので、消して(もしくは移動して)再取得すればいいみたい。

3行目の「pear update-channels」でチャンネルデータ再取得でok

うちは、タイムゾーンの設定不備で以下のエラーも出ちゃったけど、チャンネル更新はok
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in PEAR/Registry.php on line 930
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /usr/share/php5/PEAR/PEAR/Registry.php on line 930

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in PEAR/Registry.php on line 930
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /usr/share/php5/PEAR/PEAR/Registry.php on line 930

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in PEAR/Registry.php on line 930
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Tokyo' for 'JST/9.0/no DST' instead in /usr/share/php5/PEAR/PEAR/Registry.php on line 930
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded

succeededってでてるのでok


今度こそxdebugインストール!
# pear install xdebug
No releases available for package "pear.php.net/xdebug" - package pecl/xdebug can be installed with "pecl install xdebug"
install failed

peclでやれと・・・

2009年12月11日金曜日

svn: Can't open fileエラー

svnサーバにコミットしたところ以下のようなエラーが返ってきてしまった。

svn: Can't open file '/var/svn/hogehoge/db/txn-current-lock': Permission denied
svn: MKACTIVITY of '/repos/hogehoge/!svn/act/069d9079-2501-0010-a783-df4e102faed0': 500 Internal Server Error (http://hogehoge.com)


というようなエラーが出てしまった・・・

Permission deniedということから、パーミッション設定がよくないらしい・・・


確認してみると、オーナーがrootになってました。

apache2のmod_davでsvnを利用している以上、apache2が操作できる権限にしておかなきゃね。

2009年12月7日月曜日

scpでファイル転送

svnのサーバを移動しないといけないので、scpコマンドの覚書です。

# scp [転送元アドレス] [転送先アドレス]

# 今回はファイルをリモートホストに転送します。
# scp svn_dump_test root@192.168.1.x:/var/svn/
The authenticity of host '192.168.1.xx (192.168.1.xx)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes # 初めての接続なので・・・
Warning: Permanently added '192.168.1.xx' (RSA) to the list of known hosts.
Password: *********

subversion設定の覚書

いつも忘れちゃうので、覚書です。

# ディレクトリ作成
# mkdir /var/svn
# mkdir /var/svn/test


# ファイルシステムで作成
# svnadmin --fs-type fsfs create /var/svn/test


今回はサーバ移動なので、以下の作業もします

# サーバAでダンプ
# svnadmin dump /var/svn/test > svn_dump_test


# サーバBでリストア
# mkdir /var/svn
# mkdir /var/svn/test
# svnadmin --fs-type fsfs create /var/svn/test
# svnadmin load /var/svn/test < svn_dump_test

2009年12月6日日曜日

MACでDDNS設定をする

年末の里帰りに向けて、MACにDDNSの設定をしようと思う。

今まではIODATAのiobb.netサービスを利用してDDNSを実現していたのですが、
先日のブログ記事の通り、「MAC mini on X Server」と「AirMac Base Station」を購入したので、できればそっちを利用したい。

設定ができなければ、IODATAのサービスを利用するという逃げ道もありです。


まずDDNSサービスですが、これはVALU-DOMAINが使えるみたいです。

この形式でリクエストすればいいみたいです。
http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=ドメイン名&p=パスワード&h=ホスト名&i=IPアドレス

あと、IPアドレスの指定は設定しなければ、自動認識のようなので簡単です。


さっそくwgetでリクエストしたのですが、エラーが出てしまいます。
どうやら、macはwgetが無い模様・・・だけど、curlというのが有るみたいなので、これで試してみます。

# curl http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=ドメイン名&p=パスワード&h=ホスト名
# status=2


statusの2は不正な「ドメイン名とパスワード」のときのメッセージです。
おかしいと思って、ブラウザのURL欄で試してみるも、こちらはOK!
「status=0」が返ってきます。


ちょっとした気まぐれで、URLをシングルクォーテーションで囲んでみたら、これが大当たり!
# curl 'http://dyn.value-domain.com/cgi-bin/dyn.fcg?d=ドメイン名&p=パスワード&h=ホスト名'
status=0


これで、ドメイン更新はOKだね!

2009年11月29日日曜日

MAC snow leopard



mac serverをセットアップしたんだけど、管理ツールをmacbookに入れるにはsnow leopardにアップデートしてくださいってんで、買っちゃいましたー

2009年11月28日土曜日

散髪すっきり

髪の毛が大分増えてきたから、切ってきたよー

いつも行ってる北千住までー


今日はいつものお姉さんじゃなくて青年でした。

それにはちょっとガッカリだったけど、あそこの店は失敗がないってくらい髪の毛がスッキリしましたよ

2009年11月22日日曜日

MAC miniのX Server付き届いたよー


届きましたーいろいろ!

後はセットアップだねー

2009年11月21日土曜日

MAC miniのX Server付き買ったよー

アップルストアで MAC mini の X server 付きと、AirMacExtreme を買ったよー。

配送状況を見ると、今日中には家に着く感じ!
てか、もう届いちゃって、不在票が有るんじゃないかってくらい!

一回家に帰って、不在票の処理だけでもしたいね。


今回、アップルのサイトでいつ届くのかと、状況を見守っていたのですが、
僕の購入履歴がおかしい。



AirPortExtremeってなんだ?AirMacExtremeじゃないの?
なんだそれ?

買い間違った?




しらべてみたら、本来AirPortっていう製品を日本では「AirMacExtreme」として売っているんだって、、、


紛らわしっ!

2009年11月3日火曜日

電気ケトル買ったよ

これでコーヒーも飲めるし、インスタントダイエット食品も食べれるね

2009年10月10日土曜日

競馬

今日は初競馬をしてきました。

知り合いの会社で売り出してる競馬予測ソフトが
新宿のウインズで宣伝活動されているとのことなので、応援に行ってきたのです。

てか、競馬場ってあんなに込んでいるのですね。びっくりです。

競馬予測ソフトの宣伝とのことなので、「ちょっと教えて」ってなことで、
予測内容を教えていただきました。

予測は「京都11R」の枠連。
3-5
4-5
3-4
5-7

上から順番に当たる可能性が有るとのことです。

ですが、競馬自体がよくわからないので一律に1000円で4000円分購入。



で、ちょっと待っていると結果発表。




なんと「4-5」が690円のあたりでしたー!

100円で690円なので6900円です。

つまり、2900円の回収!


こんなにさくっと勝てるなら、買ってもいいかもね!

ここからリンクすると、知り合いにブログがばれちゃうので、リンクはしないけどね。