$ sed '/[Tt]est/d'
$ sed '/.\/Education\//d'
อีกมากมายหาดูได้จาก Unix Shell Programming.
บันทึกต่างๆนานาเหมือนจะมีสาระ
XTraordinaryGuyのメモ
| Configure Command | '/SourceCache/apache_mod_php/apache_mod_php-18.4/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql=/usr' '--with-mysql-sock=/var/mysql/mysql.sock' |
| Server API | Apache |
| Virtual Directory Support | disabled |
| Configuration File (php.ini) Path | /private/etc/php.ini |
| PHP API | 20020918 |
| PHP Extension | 20020429 |
| Zend Extension | 20050606 |
| Debug Build | no |
| Zend Memory Manager | enabled |
| Thread Safety | disabled |
| Registered PHP Streams | php, http, ftp, compress.zlib |
หลังจากลง tomcat ใหม่เป็น 5.5 แล้วก็ลองใส่ jLibrary ดู ทำตามนี้ตรงๆ :
To install the jLibrary WAR application you should follow the next steps:
Jackrabbit {
org.apache.jackrabbit.core.security.SimpleLoginModule required anonymousId="anonymous";
}; -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config
Configure different storage locations.
On the jLibrary configuration file there are several locations in which you will have to define paths to directories in which content will be stored. For example, the he first section of the jLibrary configuration allows you to change the location on the file system where the jLibrary repositories system data will be created. You can see it here:
These are all the places in which the ${rep.home} variable appears and that you can easily replace by other locations:
Thanks very much for the quick responses - herewith a summary of what I learned:
The problem is not one of recursion limit, but one of (in)efficiency.
It is much more efficient to use find | xargs than find -exec {} \;
"find ... -exec command {} \;" runs the command once for each name.
If find identifies 10000 files, using -exec grep ... as an example,
find would fork off a child copy of itself, the copy would become a
grep working on a single file. Meanwhile the original parent find
would sleep waiting for its child (grep) to finish before searching
for the next file that meets the find criteria. That means 10000
executions of grep and pauses of find.
"xargs command" reads names on its standard input, and feeds them in
bunches to command, so that command is run fewer times (only once, in
most cases). So, if we use find | xargs grep ..., the find is able to
work "non-stop" filling the pipe with found file names. xargs
collects groups of about 20 - 50 names and does a single grep for the
collection. Find doesn't pause and you only do about 200 greps, not
10000. There isn't a forked process for every single file.
The weaknesses of xargs are (1) it can be confused by "funny"
filenames (which is why Gnu has find -print0 |xargs -0, or you can
pipe through sed to add backslashes everywhere), and (2) it can feed
zero arguments to command which might then
just sit there waiting (this is why Gnu xargs has -r which means:
don't run command if stdin is empty).
These days, you can use "find ... -exec command {} +" which groups
arguments together. However, I found that this did not give
satisfactory grep results when invoked as:
find /usr/include -type f -exec grep NFS_VERSION {} \+ -print (or
without the escaped +)
The following examples show the time difference (and slightly more
useful output of xargs):
$ time find /usr/include -type f -exec grep NFS_VERSION {} \; -print
#define NFS_VERSION ((rpcvers_t)2)
/usr/include/nfs/nfs.h
#define NFS_VERSION 2
/usr/include/rpcsvc/nfs_prot.h
version NFS_VERSION {
/usr/include/rpcsvc/nfs_prot.x
real 0m9.883s
user 0m3.340s
sys 0m5.900s
$ time find /usr/include -type f|xargs grep NFS_VERSION
/usr/include/nfs/nfs.h:#define NFS_VERSION ((rpcvers_t)2)
/usr/include/rpcsvc/nfs_prot.h:#define NFS_VERSION 2
/usr/include/rpcsvc/nfs_prot.x: version NFS_VERSION {
real 0m0.677s
user 0m0.380s
sys 0m0.310s
Thanks,
Steve Nelson ./configure --prefix=$HOME/sys/opt/samba --with-acl-support --with-quotas --with-included-popt --localstatedir=$HOME/sys/var/lib/samba --with-piddir=$HOME/sys/var/run --with-logfilebase=$HOME/sys/var/log/samba --with-privatedir=$HOME/etc/samba/private --with-configdir=$HOME/etc/sambaคอมไพล์ไม่ผ่าน สุดท้ายต้องใช้ package pkgadd -d samba...pkg.bz
--with-ldap=no --with-ads=no
The option create mask specifies and sets the necessary permissions according to the mapping from DOS modes to UNIX permissions. With this option set to 0644, all file copying or creating from a Windows system to the Unix system will have a permission of 0644 by default.
The option directory mask specifies and set the octal modes, which are used when converting DOS modes to UNIX modes when creating UNIX directories. With this option set to 0755, all directory copying or creating from a Windows system to the Unix system will have a permission of 0755 by default.
$ sudo /sw/bin/fink install readline
./configure --prefix=$HOME/sys/usr/local/pgsql --with-includes=/sw/include --with-libraries=/sw/lib --enable-multibyte --enable-unicode --enable-locale --with-java --with-openssl --with-pam --with-bonjourจากนั้นก็อาจจะ make check เพื่อความชัวร์ แต่ไม่จำเป็น install ได้เลยโดย make install
PostgreSQL ships with fairly lax access rules. If you’ll be using your
database in a production environment, or on any kind of shared server,
you should add at least a basic level of security. User authentication
rules are defined in the file/usr/local/pgsql/data/pg_hba.conf. As explained in the PostgreSQL documentation,
you can edit this file to password-protect user accounts, change
authentication methods for local and remote connections, and enable or
disable user access to various parts of the system.
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all postgres 127.0.0.1 255.255.255.255 md5
host samegroup all 127.0.0.1 255.255.255.255 md5
local all postgres md5
local samegroup all md5
After editing the file, I need to create a password for the “postgres” superuser, and restart the database server so the changes will take effect:
postgres@mail:~> psql test
test=# alter user postgres with password 'your_password';
test=# \q
For 8.0+, in postgresql.conf uncomment the line starting:
listen_addresses = 'localhost'
Then tighten up security a bit by editing pg_hba.conf and adding this line:
# Jakarta Tomcat 4.x/5.x or equivalent, such as Jetty or Caucho Resin.
Note that DSpace will need to run as the same user as Tomcat, so you might want to install and run Tomcat as a user called 'dspace'. สำหรับกรณีนี้เราไม่
You need to ensure that Tomcat has a) enough memory to run DSpace and b) uses UTF-8 as its default file encoding for international character support. So ensure in your startup scripts (etc) that the following environment variable is set:
JAVA_OPTS="-Xmx512M -Xms64M -Dfile.encoding=UTF-8"You also need to alter Tomcat's default configuration to support searching and browsing of multi-byte UTF-8 correctly. You need to add a configuration option to the element in [tomcat]/conf/server.xml:
e.g. if you're using the default Tomcat config, it should read:
Jetty and Resin are configured for correct handling of UTF-8 by default.
First, a Word on Directories and Path Names
DSpace uses three separate directory trees. Although you don't need to know all the details of them in order to install DSpace, you do need to know they exist and also know how they're referred to in this document:
[dspace-source][dspace][tomcat]/webapps/dspace (with [tomcat] being wherever you installed Tomcat--also known as $CATALINA_HOME). This directory is generated by the web server when it unpacks dspace.war, and should never be edited.Download the latest DSpace source code release and unpack it:
gunzip -c dspace-source-1.x.tar.gz | tar -xf -
Copy the PostgreSQL JDBC driver (.jar file) into [dspace-source]/lib. Download it directly from the PostgreSQL JDBC site. Make sure you get the driver for the version of PostgreSQL you're running and for JDBC2. เราลองใช้ JDBC3 ถ้าไม่เวิร์คเราจะกลับมาใช้ 2
Create a dspace database, owned by the dspace PostgreSQL user:
createuser -U postgres -d -A -P dspace ; createdb -U postgres -O dspace -E UNICODE dspace
เราเปลี่ยนคำสั่ง createdb โดยให้ postgres ซึ่งเป็น DB admin ครีเอท เพราะไม่สามารถให้ dspace DB user create ได้โดยตรง
As the dspace UNIX user, compile and install DSpace:
cd [dspace-source] ; ant fresh_install
/dspace/bin/dsrun net.handle.server.SimpleSetup /dspace/handle-server. Follow the instructions, answering relatively simple questions. Another option might be to run /dspace/bin/make-handle-config after configuring dspace.cfg, but we did not do this. /dspace/handle-server/sitebndl.zip to hdladmin@cnri.reston.va.us. They will quickly create your global identifier and email you with the appropriate information. /dspace/handle-server/config.dct). Just as the DSpace instructions say, เพิ่ม "storage_type" = "CUSTOM" และก็ "storage_class" = "org.dspace.handle.HandlePlugin" ลงไปในส่วนของ server_config. config.dct, update any lines that say something like YOUR_NAMING_AUTHORITY with the appropriate number as sent to you in the email from the Handle admin people. For instance, here at UTK we have a line that reads "server_admins" = ( "300:0.NA/1785" ). We made this change in three places, under server_admins, backup_admins, and replication_admins. /dspace/config/dspace.cfg, changing handle.prefix to whatever number you were assigned (in our case, the line reads handle.prefix = 1785), and changing if necessary handle.dir to point to the right place, usually /dspace/handle-server. == ไม่จำเป็นต้องติดตั้งใหม่ทั้งหมด ==
ปัญหา!!!!
สตาร์ทอัพ DSpace ไม่ได้เพราะเหมือนกับว่า หลังรันคำสั่งแล้วมันจะให้ใส่ passphrase ซึ่งไม่สามารถใส่ได้
ทางแก้: ลองใหม่โดยไม่ encrypt key ด้วย passphrase ก็จะสามารถสตาร์ทได้
| JA | TH |
|---|---|
| 文法 | ไวยากรณ์ |
| 文 | ประโยค |
| 句 | วลี |
| 節 | อนุประโยค |
| 単語 | คำศัพท์ |
| 修飾(しゅうしょく) | การขยายคำ (modify) |
| 名詞 | คำนาม |
| 動詞 | คำกริยา |
| 助詞 | คำบุพบท |
| 副詞 | คำวิเศษณ์ |
| 接続詞 | คำสันธาน |
| 数詞 | คำบอกจำนวน |
| 助数詞 | คำลักษณะนาม |
| 疑問詞 | คำแสดงคำถาม |
| 主語 | ประธาน(หัวเรื่อง) |
| 述語 | ส่วนขยาย |
| 目的語 | กรรม |
| 主題 | หัวข้อเรื่องหลัก |
| 肯定(こうてい) | บอกเล่า |
| 否定 | ปฏิเสธ |
| 完了 | สมบูรณ์ |
| 未完了 | ไม่สมบูรณ์ |
| 過去 | อดีต |
| 非過去 | ไม่อดีต |
# /Library/Apache2/bin/apachectl {start,stop,graceful}ลง preference pane เพิ่ม ได้ที่ /Library/PreferencePanes หรือ $HOME/Library/PreferencePanes เวลาจะ uninstall ก็อย่าลืมเอาออกด้วย
/Library/Apache2
/Library/StartupItems/Apache2
/Library/Receipts/Apache2.pkg
# sudo niutil -destroy . /users/mysql- ลบ MySQL.prefPane ออกจาก /Library/PreferencePanes หรือ $HOME/Library/PreferencePanes
`/Library/StartupItems/MySQLCOM'. (Before MySQL 4.1.2, the location was- secure the default accounts หลังจากติดตั้ง MySQL เสร็จใหม่ๆ installer ของ Mac มันจะ initialize database ให้อยู่แล้ว (mysql_install_db) แต่ grant tables ที่มัน init มาให้จะไม่มี password ดังนั้นเราต้องเซต password ด้วยเพื่อความปลอดภัย
`/Library/StartupItems/MySQL)
start MySQL server ด้วย คำสั่ง #sudo ./mysqld_safe [-u mysql] (ใน [...] optional)shell> mysql -u root
mysql> DELETE FROM mysql.user WHERE User='';
mysql> FLUSH PRIVILEGES;shell> mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new_pasword');
mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('new_password');User=''; นั้นเป็น single quote 2 อัน ไม่ใช่ double quote.mysql> SELECT Host, User FROM mysql.user;ดูรายละเอียดจาก หน้านี้ http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html- copy database ที่ dump ออกมาจากตัวเก่าไปยัง version ใหม่
ปล. มี CocoaMySQL ที่เคยลงไว้ มันเป็น client เอาไว้ connect ไปจัดการกับ MySQL server แต่ CocoaMySQL ใช้กับ version 4.0.21 ได้ แต่ไม่สามารถใช้กับ version 5 ได้เพราะว่า password
encryption มันต่างกัน ต้องไปใช้ CocoaMySQL version beta0.7 ถึงเวิร์ค
shell> cat /some/where/dumped_db.mysql | mysql -u root -p db_nameWhen running MySQL and PHP on the same Mac OS X 10.4 server, you may find that PHP cannot connect to MySQL. When PHP is communicating with a MySQL server on the same host, it uses a socket file to communicate, and looks for it at /tmp/mysql.sock. On Mac OS X Server 10.4, MySQL creates this socket file at /var/mysql/mysql.sock.
To resolve this issue, you can either change the location where MySQL creates its socket file, or modify the location where PHP looks for the file. Please note that the first option is less secure than the second. Before delving in, you should also review new information relevant to PHP and MySQL on Mac OS X Server 10.4.4 and later.
To change the location where MySQL creates its socket file, do this:
To change the location where PHP looks for the socket file, follow these steps:
; Default socket name for local MySQL connects. If empty, uses
the built-in
; MySQL defaults.
mysql.default_socket = /var/mysql/mysql.sock
An example command on how to dump the database on a Debian GNU/Linux machine using mysqldump:
mysqldump --user=USERNAME --password=PASSWORD --single-transaction --all-databases > BACKUPFILE.sql
dump database named "wikidb"
mysqldump -u root -B wikidb > wikidb.sql
restore database named "wikidb"
mysql -u root -B wikidb <>
Create user ใหม่ขึ้นมาบน MySQL database อันใหม่ที่เรา import เข้ามาแล้ว โดยใช้คำสั่ง GRANT
คำสั่ง GRANT จะ encrypt password ให้ดังนั้นไม่จำเป็นต้องเรียกใช้ PASSWORD('password')
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON wikidb.*
-> TO 'wikiuser'@'localhost'
-> IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.05 sec)
bossanova:~/tmp/php-5.1.2 jojo$ ./configure '--prefix=/usr/local/php5.1.2' '--with-apxs2=/Library/Apache2/bin/apxs' '--with-ldap' '--with-kerberos' '--enable-cli' '--with-zlib' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-sockets' '--with-iodbc' '--with-cure' '--with-config-file-path=/usr/local/php5.1.2/etc' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql-sock=/var/mysql/mysql.sock'
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20020429/mmcache.so"
mmcache.shm_size="16"
mmcache.cache_dir="/tmp/mmcache"
mmcache.enable="1"
mmcache.optimizer="1"
mmcache.check_mtime="1"
mmcache.debug="0"
mmcache.filter=""
mmcache.shm_max="0"
mmcache.shm_ttl="0"
mmcache.shm_prune_period="0"
mmcache.shm_only="0"
mmcache.compress="1"
$ brandelf -t Linux Simplify.linux