virtualbox ネットワークが切れる問題発生
virtualbox ネットワークが切れる問題発生
virtualbox をアンインストールし再度、インストールしたら、現象が収まった
おそらく、Dockerを入れた時に挙動がおかしくなったながりかもしれない
sylhpeedでPWを忘れてしまった場合
sylhpeedでPWを忘れてしまった場合
/home/user01/.sylpheed-2.0/accountrc
..............
password=XXXXX
..............
DVDに焼く方法(LINUX)
1) isoイメージを作成する
mkisofs -o image.iso -iso-level 2 -R -J -v
2) isoイメージをマウントしてみる(確認のため)
mount -t iso9660 -o loop image.iso /mnt/dvd
ls /mnt/dvd
umount /mnt/dvd
3)DVDに焼く
# growisofs -dvd-compat -Z /dev/scd0=image.iso
4)DVDをマウントしてみる(確認のため)
# mount -t iso9660 /dev/scd0 /mnt/dvd
( # mount -t iso9660 /dev/hda /mnt/dvd )
# umount /mnt/dvd
apache mod_rewriteの設定例
- URIの最後'/'がない場合は付け足す
- (1) URIの最後の'/'がない場合には付け足す
- RewriteRule ^foo$ foo/ [R]
- (2) 静的コンテンツのようにみせる
- RewriteRule ~/wiki/(\w)\.html /wiki.cgi?wiki_name=$1
- (3) ユーザIDでディレクトリを階層化
- # 例) /user/takiuchi => /home/t/a/k/takiuchi
- RewriteRule ~/user/((\w)(\w)(\w)\w*)(.*) /home/$2/$3/$4/$1$5
- (4) ユーザIDの先頭の文字でサーバを分ける
- RewriteRule ~/user/((\w)\w*)(.*) http://$2.serveice.com/user/$1$3 [R,L]
-
- ユーザIDの先頭の文字列でサーバを分ける
- /user/baz/face.png
- /user/((b)az)(/face.png)
- http://b.foo.bar.com/user/baz/face.png
-
addslashesによるエスケープ処理は禁止
PEAR::DBであればDB::quote()という関数を利用
<?php class db_access { function set_dsn($dsn) { $this->dsn = $dsn; } var $dsn = null; var $_result = array(); var $conid = null; function do_connect() { require_once("DB.php"); $this->conid = DB::connect($this->dsn); if ( DB::isError($this->conid) ) { die ($this->conid->getMessage()); } } var $debuginfo; function do_getall($sql) { $result = $this->conid->getAll($sql,DB_FETCHMODE_ASSOC); //DB_FETCHMODE_ASSOC,DB_FETCHMODE_ORDERED if (DB::isError($result)) { $this->debuginfo = $result->getDebugInfo($result); $this->_result = null; return false; } else { $this->_result = $result; return true; } } function do_query($sql) { $result = $this->conid->query($sql); if (DB::isError( $result )) { $this->debuginfo = $result->getDebugInfo($result); $this->_result = null; return false; } else { $this->_result = $result; return true; } } function disconnect() { $this->conid->disconnect(); } function get_result() { return $this->_result; } function get_quote($str) { return $this->conid->quote($str); } } // 事前準備 // 手動で、 // createdb hoge // psql hoge // CREATE TABLE hoge (hoge text,insert_time timestamp); $db = new db_access; $db->set_dsn("pgsql://postgres:@localhost/hoge"); $db->do_connect(); //-------------------------------------------------------------- // select 文の練習 $str = $db->get_quote("1'2'3"); $query = "select {$str};"; print $query; print "\n"; if($db->do_getall($query)) { $data = $db->get_result(); print_r($data); } else { print $db->debuginfo; } //-------------------------------------------------------------- //省略版(失敗時のrollbackはphpまかせ)insert方法 // addslashesによるエスケープ処理は止めましょう // http://blog.ohgaki.net/index.php/yohgaki/2006/02/13/addslashesa_la_a_a_ua_sa_pa_fa_a_bc_a_ma // addslashesは使っちゃダメ => DB.phpのquoteにて対応 // http://www.phppro.jp/qa/68?sort=asc $hoge = $db->get_quote("1'2'3".time()); // quote処理と''(シングルクォート)を付与 $db->do_query("begin;"); $query = "insert into hoge(hoge,insert_time)values($hoge,now());"; print $query; print "\n"; $db->do_query($query); $db->do_query("commit;"); //-------------------------------------------------------------- $query = "select * from hoge where hoge = $hoge ;"; print $query; print "\n"; if($db->do_getall($query)) { $data = $db->get_result(); print_r($data); } else { print $db->debuginfo; } //-------------------------------------------------------------- // 厳密バージョン if($db->do_query("begin;")) { if($db->do_query("insert into hoge(insert_time)values(now());")) { if($db->do_query("commit;")) { print "登録完了\n"; } else { print $db->debuginfo; print "登録失敗1(commit失敗)\n"; } } else { print "登録失敗2(insert 失敗)\n"; print $db->debuginfo; $db->do_query("role back;"); } } else { print $db->debuginfo; print "登録失敗3(begin失敗)\n"; } $db->disconnect(); ?>
http://www.phppro.jp/qa/68?sort=asc
http://blog.ohgaki.net/index.php/yohgaki/2006/02/13/addslashesa_la_a_a_ua_sa_pa_fa_a_bc_a_ma
vi タブ・スペース変換
タブ -> スペース 変換:set expandtab
:retabスペース -> タブ 変換
:set noexpandtab
:retab!8タブ
:set tabstop=8
Fedora 7 kernel-2.6.22.1-27.fc7 ではvmwareが起動しなくなった件
Fedora 7 kernel-2.6.22.1-27.fc7 ではvmwareが起動しなくなった件
=> any-anyの最新版(vmware-any-any-update112.tar.gz)をインストールすることで対応
環境
VMwarePlayer-2.0.0-45731
kernel-2.6.22.1-27.fc7
# vmware-config.pl
make[2]: *** [/tmp/vmware-config1/vmnet-only/userif.o] エラー 1
make[1]: *** [_module_/tmp/vmware-config1/vmnet-only] エラー 2
make[1]: ディレクトリ `/usr/src/kernels/2.6.22.1-27.fc7-i686' から出ます
make: *** [vmnet.ko] エラー 2
make: ディレクトリ `/tmp/vmware-config1/vmnet-only' から出ます
Unable to build the vmnet module.For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".Execution aborted.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
any-anyの最新版をインストールすることで対応
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# wget http://platan.vc.cvut.cz/ftp/pub/vmware/vmware-any-any-update112.tar.gz
# tar xfvz vmware-any-any-update112.tar.gz
# cd vmware-any-any-update112
# ./runme.pl