2011年8月13日 星期六

SST衛星資料下載位置

sst_l3_cut6.m衛星資料下載位置為:

ftp://oceans.gsfc.nasa.gov/MODIS衛星代號/Mapped/時間/解析度/SST/

MODIS Terra 8 Day 4km:
ftp://oceans.gsfc.nasa.gov/MODIST/Mapped/8Day/4/SST/


Chl-a衛星資料下載位置

chlo_l3_cut6.m 衛星資料下載位置為:

ftp://oceans.gsfc.nasa.gov/MODIS衛星代號/Mapped/時間/解析度/CHLO/

MODIS Aqua 8 Day 4km:
ftp://oceans.gsfc.nasa.gov/MODISA/Mapped/8Day/4/CHLO/

MODIS Terra 8 Day 4km:
ftp://oceans.gsfc.nasa.gov/MODIST/Mapped/8Day/4/CHLO/

2010年9月5日 星期日

Nothing is everything: 用csup更新port tree

Nothing is everything: 用csup更新port tree: "SUPHOST= cvsup.tw.freebsd.org
SUP_UPDATE= yes
SUP= /usr/bin/csup
SUPFLAGS= -g -L 2

SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile"

2009年3月3日 星期二

Drupal 6.X Multi-Site Howto

步驟如下:

Multi-site on Linux

Last modified: January 3, 2009 - 22:09

Software installed:

  • Drupal 6
  • Apache 1.3
  • Red Hat 6.1 (Although other distributions will work)
  • PHP5
  • PostgreSQL 7.4

The process:

  1. Install the Drupal core download from Drupal.org.
  2. Install default Drupal site. I created mine with a "dummyUSER" user and "dummyDB" database with Drupal code in apache/htdocs/drupal
  3. Once you have this working then create a new dir "example1.com" directly under "sites" dir.
    mkdir sites/example1.com
    cp -R sites/default/* sites/example1.com/
  4. Create a new database "example1DB" and new user "example1USER" in database.
  5. Edit the sites/example1.com/settings.php and change the following:
    • $db_url = 'pgsql://dummyUSER:dummyPSSWDl@localhost/dummyDB';
      to $db_url = 'pgsql://example1USER:example1PSSWDl@localhost/example1DB';
    • # $base_url = 'http://www.example.com';
      to $base_url = 'http://www.example1.com'; (Remove the '#' [comment])
  6. cp apache/htdocs/drupal/install.php to apache/htdocs/drupal/sites/example1.com/
  7. Point your browser to www.example1.com. Drupal will show you lot of errors.
  8. Once it shows you errors you are all good. Just point your browser to www.example1.com/install.php and it will present you the installation screen. Install from there on.
  9. Repeat the above process for www.example2.com

Note
If it says the site is offline then your database information in settings.php is not correct. If it says site not found then your base url in settings.php is not correct.

2008年7月21日 星期一

MySQL安裝使用手冊

來源:http://www.hmes.kh.edu.tw/~jang/mysql.html

MySQL安裝使用手冊

一、概述:

  MySQL為一個多使用者、多執行緒及多站台的快速反應資料庫系統,系統主要著眼於快速與多使用者,最大的好處是用於教育用途,免費使用。
  它具有多種版本,從Unix到Windows 98(或NT)都有,很適合於一般教育界來使用開發一些資庫料的整合應用,把它當成後端資料庫系統,一個不錯的選擇。

二、資源:

三、安裝:

  1. �以 root 身份登入 Redhat 系統。

  2. 到「檔案來源」的其中一站下載上述五個檔案。

  3. 依序以 rpm -ivh 命令將所下載下來的檔案安裝入Redhat作業系統中。
  4. [root@test /root]# rpm -ivh MySQL-3.22.27-2c.i386.rpm
    [root@test /root]# rpm -ivh MySQL-client-3.22.27-2c.i386.rpm
    [root@test /root]# rpm -ivh MySQL-devel-3.22.27-2c.i386.rpm
  5. 若您需要重新Compiler,則只要安裝 MySQL-3.22.27-2c.src.rpm 套件即可。

  6. 以 root 身份登入 Redhat 系統後,進入MySQL資料庫系統。
  7. [root@test /root]# mysql mysql
     
  8. 若安裝成功您可看到下列畫面,並看到mysql的提示號!
  9. Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 212 to server version: 3.22.27

    Type 'help' for help.

    mysql>

     
  10. 更改MySQL系統之管理者密碼(新密碼的地方,換成您要設定的密碼)
  11. mysql> UPDATE user SET password=password('新密碼') where user='root';
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 2 Changed: 0 Warnings: 0
     
  12. 刪除空帳號,以維護系統安全
  13. mysql> DELETE FROM user WHERE User = '';
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 2 Changed: 0 Warnings: 0
    (最後是兩個單引號)
  14. 即時更新上述修正之資料
  15. mysql> FLUSH PRIVILEGES;
    Query OK, 0 rows affected (0.00 sec)
     
  16. 離開MySQL資料庫系統
  17. mysql> exit
    Bye
    [root@test root]#
     
  18. 測試一下剛剛更新的密碼是否正常:

  19. [root@test root]# mysql mysql -uroot -p新密碼
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 29 to server version: 3.22.27

    Type 'help' for help.

    mysql> exit
    Bye
    [root@test root]#

    說明:(1)mysql mysql為連結MySQL資料庫,資料庫名稱為mysql。
       (2)-uroot:-u宣告使用者,root為使用者名稱。
       (3)-p新密碼:-p宣告密碼,後面接root新設的密碼。
  20. 以後進入使用MySQL資料庫系統,須以下列格式進入:
  21. [root@test root]# mysql 資料庫名稱 -u使用者名稱 -p密碼
    說明:[-u使用者名稱]-u和使用者名稱間不可有空格。
       [-p密碼]-p和密碼間不可有空格。

四、mysqladmin公用程式的使用:

  1. 新增資料庫:
  2. [root@test root]# mysqladmin -uroot -p密碼 create 資料庫名稱
    說明:用法與mysql一樣,-u緊接MySQL管理者帳號(通常為root),-p緊接管理者密碼(通常為root之密碼)
       資料庫名稱為您要新增的DataBase的名稱。
  3. 刪除資料庫:
  4. [root@test root]# mysqladmin -uroot -p密碼 drop 資料庫名稱
    說明:用法與上述新增資料庫方式一樣。
  5. 關閉MySQL服務:
  6. [root@test root]# mysqladmin -uroot -p密碼 shutdown

五、基本用法:

  1. 增加新的MySQL使用者:(方法一)

  2. (1)開啟mysql資料庫
    [root@test root]# mysql mysql -uroot -p密碼
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 29 to server version: 3.22.27

    Type 'help' for help.

    mysql>

     
    (2)增加一個新帳號,並設定權限
    mysql> insert into user values ('host','user',password('密碼'),'y','y','y','y','y','y','y','y','y','y','y','y','y','y');
    說明:host->填入您要連線的主機名稱(完整名稱hostname+domainname),若位於本機則填localhost。
       user-->您要設定的帳號
       密碼-->您要設定的密碼
       之後14個y代表著14個不同的權限,依序為
      1.Select_priv 2.Insert_priv 3.Update_priv 4.Delete_priv 5.Index_priv
      6.Alter_priv 7.Create_priv 8.Drop_priv 9.Grant_priv 10.References_priv
      11.Reload_priv 12.Shutdown_priv 13.Process_priv 14.File_priv
       若您不開放權限,則在該項目下填n即可。
     
  3. 增加新的MySQL使用者:(方法二)(較安全)

  4. 格式:
    mysql> GRANT 權限 ON 資料庫(或資料表TABLE) TO user@host IDENTIFIED BY '密碼';
    說明:權限授與共分三種:
    • 對資料庫(DateBase)有十五種權限:
    • ALL PRIVILEGES ALTER CREATE DELETE DROP
      FILE INDEX INSERT PROCESS REFERENCES
      RELOAD SELECT SHUTDOWN UPDATE USAGE
       
    • 對資料表(Table)則只有八種權限:
    • SELECT INSERT UPDATE DELETE CREATE
      DROP INDEX ALTER

       
    • 對資料欄(column)則只有三種權限:
    • SELECT INSERT UPDATE
     user@host表 示法:表示來自host主機的user使用者。user為您欲連線MySQL的帳號,host則必須填上你連線來源的主機完整名稱 (hostname.domianname);例如:我想要設定的帳號為coco,而且是從mail.hmes.kh.edu.tw這台主機連上來使用 的,所以就寫成coco@mail.hmes.kh.edu.tw。若使用萬用字元,則必須加上括號,例如: ('test%'@'%.hinet.net')==>表示從.hinet.net網域連上來的test開頭的帳號。

     GRANT的特性:在MySQL資料庫,若找到相對應的entry則只作UPDATE,找不到才會CREATE一個新的帳號及權限。

     權限設定建議:除了管理者外,其他user儘量避免設定全部權限全開。一般而言,只開SELECT、INSERT、UPDATE三項權限;進階的user則加開DELETE、CREAT、DROP、INDEX四項權限;其餘權限,能不開,則不開,以確保整個MySQL的安全性。

    (1)新增帳號,並給予全部權限

    mysql> GRANG ALL PRIVILEGES ON *.* TO user@host IDENTIFIED BY '密碼';
    說明:將全部權限都設給從host連線上來的user這個人,並給定密碼為密碼

    (2)新增帳號,並指定某資料庫與特定權限給該帳號

    mysql> GRANG SELECT,INSERT,UPDATE ON 資料庫名.* TO user@host IDENTIFIED BY '密碼';
    說明:開放某資料庫給從host連線上來的user這個人,並給定密碼為密碼

  5. 刪除使用者帳號與權限:

  6. 格式:
    mysql> REVOKE 權限 ON 資料庫(或資料表TABLE) TO user@host IDENTIFIED BY '密碼';
    說明:命令與用法均與GRANT一樣,特性也一樣,但不做DELETE的動作,只是將權限關閉,真的要刪除時,須用到DELETE命令。
  7. 對MySQL直接下命令作任何動作,離開MySQL系統時,必須先做即時更新(FLUSH)再離開吧!
  8. mysql> FLUSH PRIVILEGES;
     
  9. 在作業系統中,檢查權限之命令:
  10. [root@test root]# mysqlaccess host user 資料庫名 -U root -P 密碼
    說明:host->填入您要檢查的來源主機名稱(完整名稱hostname+domainname),若位於本機則填localhost。
       user-->您要檢查的帳號
       資料庫名-->填入您要檢查的資料庫名稱
       -U root-->-u後面填入MySQL管理者的帳號(通常設root)
       -P 密碼-->-p後面填入MySQL管理者的密碼
    例如:我要檢查來自mail.hmes.kh.edu.tw這台機器的root帳號,對資料庫fm的權限為何?
       則在系統下輸入
      [root@test root]# mysqlaccess mail.hmes.kh.edu.tw fm focalmail -U root -P nnyyjj
      結果為
      mysqlaccess Version 2.03, 27 Feb 1997
      By RUG-AIV, by Yves Carlier (Yves.Carlier@rug.ac.be)
      This software comes with ABSOLUTELY NO WARRANTY.
      +++USING FULL WHERE CLAUSE+++
      +++USING FULL WHERE CLAUSE+++
      +++USING FULL WHERE CLAUSE+++

      Access-rights
      for USER 'fm', from HOST 'mail.hmes.kh.edu.tw', to DB 'focalmail'
      +-----------------+---+ +-----------------+---+
      | Select_priv | Y | | Shutdown_priv | Y |
      | Insert_priv | Y | | Process_priv | Y |
      | Update_priv | Y | | File_priv | Y |
      | Delete_priv | Y | | Grant_priv | Y |
      | Create_priv | Y | | References_priv | Y |
      | Drop_priv | Y | | Index_priv | Y |
      | Reload_priv | Y | | Alter_priv | Y |
      +-----------------+---+ +-----------------+---+
      NOTE: A password is required for user `fm' :-(

      The following rules are used:
      db : 'No matching rule'
      host : 'Not processed: host-field is not empty in db-table.'
      user : '','fm','017186377a52afaf','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y''

      BUGs can be reported by email to Yves.Carlier@rug.ac.be
      [root@test /root]#

2008年7月20日 星期日

php5-extensions編譯套件

[X] BCMATH bc style precision math functions
[X] BZ2 bzip2 library support
[X] CTYPE ctype functions
[X] CURL CURL support
[X] DOM DOM support
[X] EXIF EXIF support
[X] FILTER input filter support
[X] FTP FTP support
[X] GD GD library support
[X] GETTEXT gettext library support
[X] HASH HASH Message Digest Framework
[X] ICONV iconv support
[X] JSON JavaScript Object Serialization support
[X] MBSTRING multibyte string support
[X] MYSQL MySQL database support
[X] PCRE Perl Compatible Regular Expression support
[X] PDO PHP Data Objects Interface (PDO)
[X] PDO_SQLITE PDO sqlite driver
[X] POSIX POSIX-like functions
[X] SESSION session support
[X] SIMPLEXML simplexml support
[X] SOCKETS sockets support
[X] SPL Standard PHP Library
[X] SQLITE sqlite support
[X] TOKENIZER tokenizer support
[X] XML XML support
[X] XMLREADER XMLReader support
[X] XMLWRITER XMLWriter support
[X] ZIP ZIP support
[X] ZLIB ZLIB support

MySQL編譯參數

make WITH_CHARSET=utf8 WITH_XCHARSET=all WITH_COLLATION=utf8_general_ci BUILD_OPTIMIZED=yes BUILD_STATIC=yes install clean