telnet mail.xxx.co.jp 25
EHLO xxx.co.jp
MAIL FROM:xxx@xxx.co.jp
RCPT TO:xxx@xxx.co.jp
DATA
Subject:TEST
From:xxx@xxx.co.jp
To:xxx@xxx.co.jp
TEST
.
quit
shell
$ while true
$ do date
$ echo -------------------------
$ netstat | grep %
$ sleep 60
$ done
CSV
//まるごと
COPY request_mst TO '/home/myid/postgres/DB.txt' DELIMITERS ',';
//SQLで
\pset format unaligned -- 出力形式を指定
\pset fieldsep ',' -- フィールドのセパレータにカンマ区切りを指定
\o psql_out.csv -- 出力ファイルを指定
ここに SQL を書く
\q
# perl -MCPAN -e shell
最初の起動時に質問が出てきます。これに答えながら、設定を行ないます。
Are you ready for manual configuration? [yes]
CPAN build and cache directory? [/root/.cpan]
Cache size for build directory (in MB)? [10]
Perform cache scanning (atstart or never)? [atstart]
Cache metadata (yes/no)? [yes]
Your terminal expects ISO-8859-1 (yes/no)? [yes]
Policy on building prerequisites (follow, ask or ignore)?
[ask]
基本的には、すべてデフォルトのままでOKです。
Enter を押せば、[ ] 内のデフォルトで設定されます。
Where is your gzip program? [/bin/gzip]
Where is your tar program? [/bin/tar]
Warning: unzip not found in PATH
Where is your unzip program? [] /bin/unzip
Where is your make program? [/usr/bin/make]
Warning: lynx not found in PATH
Where is your lynx program? [] /usr/local/bin/lynx
Where is your wget program? [/usr/bin/wget]
Where is your ncftpget program? [/usr/bin/ncftpget]
Where is your ftp program? [/usr/bin/ftp]
What is your favorite pager program? [/usr/bin/less]
What is your favorite shell? [/bin/bash]
各コマンドのパスを設定します。
たいてい標準で入っており、パスが自動で設定されますので、Enter でOKです。
もし「not found in PATH」と表示されたら、パスを入力します。
無くてもよいものもありますが、gzip、tar、make、lynx などは必須でしょう。
私の例では、Lynxが入っていませんでした。
(先にパスだけ設定して(緑の部分)、後でインストールしました。)
その他 unzip なども入っていないみたいですが、この辺は無視してかまいません。
※ Lynxのインストールについては、以下のサイトが参考になります。
Installation Lynx for UNIX
質問は、まだ続きます。
Parameters for the 'perl Makefile.PL' command? []
Parameters for the 'make' command? []
Parameters for the 'make install' command? [] UNINST=1
Timeout for inactivity during Makefile.PL? [0]
「UNINST=1」というオプションを付けました。同名のモジュールが既に存在して競合
する場合に、古いものを消す設定です。
Your ftp_proxy?
Your http_proxy?
Your no_proxy?
(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 2
(1) China
(2) Indonesia
(3) Israel
(4) Japan
(5) Malaysia
(6) Philippines
(7) Republic of Korea
(8) Russian Federation
(9) Saudi Arabia
(10) Singapore
(11) Taiwan
(12) Thailand
Select your country (or several nearby countries) [] 4
(1) ftp://ftp.ayamura.org/pub/CPAN/
(2) ftp://ftp.cpan.jp/CPAN/
(3) ftp://ftp.dti.ad.jp/pub/lang/CPAN/
(4) ftp://ftp.jaist.ac.jp/pub/lang/perl/CPAN/
(5) ftp://ftp.kddlabs.co.jp/CPAN/
(6) ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/
(7) ftp://ftp.u-aizu.ac.jp/pub/CPAN
Select as many URLs as you like,
put them on one line, separated by blanks [] 2
Enter another URL or RETURN to quit: []
New set of picks:
ftp://ftp.cpan.jp/CPAN/
エリアを選び、近くのCPANサーバーを選択します。
このサーバーから、モジュールを引っ張ってきます。
以上で設定は完了です。
----------------------------------------
# perl -MCPAN -e shell
cpan> install [モジュール名]
cpan> install Jcode
DB_File モジュール
cpan> install DB_File
DBI モジュール
cpan> install DBI
DBD::mysql モジュール
cpan> install DBD::mysql
DBD::mysql を入れる前に、DBI を入れてください。
cpan>q
install MIME:Entity
以下に、サニタイジングを行うコードを言語別に紹介しておく。ただし、これが唯一の書き方ではなく、ほかの方法で同様の機能が実施できるのであればそれでも構わない。
perl
$text =~ s/&/\&/g;
$text =~ s/</</g;
$text =~ s/>/>/g;
$text =~ s/"/"/g;
install
CentOS4.4
--------------------------
セキュリティでhttpdを信用できるサービスに。
chkconfig httpd on
chkconfig --list httpd
root
/var/www/html/
db
/var/lib/postgres,mysql
--------------------------
MySQL&phpMyAdmin
chkconfig mysqld on
wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.10.0.2-all-languages-utf-8-only.tar.gz
cp /var/www/html/~
# cd /var/www/html/phpMyAdmin/
# cp -p config.sample.inc.php config.inc.php
# chmod 664 /var/www/phpmyadmin/config.inc.php
# mkpasswd -l 46
cwicivIu4velcepjfisfcvircqwropshk>ddl2besgvAov
# vi config.inc.php
$cfg['blowfish_secret'] = 'cwicivIu4velcepjfisfcvircqwropshk>ddl2besgvAov';
--------------------------
PostgreSQL&phpPgAdmin
chkconfig postgresql on
# passwd postgres
# psql template1
$ alter user postgres with password 'postgres';
\q
$ createuser -AdPE root
vi /var/lib/pgsql/data/pg_hda.conf
local all all trust
host all all 127.0.0.1 255.255.255.0 trust
#host all all 192.168.0.1 255.255.255.255 trust
#host all all 0.0.0.0 0.0.0.0 password crypt
wget http://prdownloads.sourceforge.net/phppgadmin/phpPgAdmin-4.1.1.tar.gz
cp /var/www/html/~
vi /var/www/html/phpPgAdmin/conf/config.ini.php
$conf['extra_login_security'] = true;
>
$conf['extra_login_security'] = false;
------------------------------------------------------
php
wget http://jp.php.net/get/php-4.4.6.tar.gz/from/this/mirror
web_local
./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-apxs2=/usr/sbin/apxs2 --with-ndbm=/usr --with-db4=/usr --with-mcrypt=/usr --with-mhash=/usr --without-interbase --with-ming=/usr --with-swf=/usr --without-sybase --with-gdbm=/usr --without-fdftk --with-java=/opt/sun-jdk-1.4.2.10 --with-mcal=/usr --without-unixODBC --with-pgsql=/usr --with-snmp=/usr --enable-ucd-snmp-hack --with-xpm-dir=/usr/X11R6 --with-gmp --without-mssql --without-crack --without-pdflib --with-gd=/usr --enable-gd-native-ttf --with-png=/usr --with-png-dir=/usr --with-jpeg=/usr --with-jpeg-dir=/usr --enable-exif --with-tiff=/usr --with-tiff-dir=/usr --with-mysql=/usr --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-freetype-dir=/usr --with-ttf=/usr --with-t1lib=/usr --with-gettext --with-pspell=/usr --with-openssl=/usr --with-imap=/usr --with-ldap=/usr --with-dom=/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --without-kerberos --with-pam --enable-memory-limit --disable-ipv6 --without-yaz --disable-debug --with-curlwrappers --with-curl=/usr --enable-dbx --with-imap-ssl --with-zlib=/usr --with-zlib-dir=/usr --with-sablot=/usr --enable-xslt --with-xslt-sablot --with-xmlrpc --enable-wddx --with-xml --enable-mbstring=all --enable-mbregex --with-bz2=/usr --with-cdb --enable-pcntl --enable-bcmath --enable-calendar --enable-dbase --enable-filepro --enable-ftp --with-mime-magic=/usr/share/misc/file/magic.mime --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --with-iconv --enable-shmop --enable-dio --enable-yp --without-ncurses --without-readline --enable-inline-optimization --enable-track-vars --enable-trans-sid --enable-versioning --with-config-file-path=/etc/php/apache2-php4 --libdir=/usr/lib/php --without-pear --build=i686-pc-linux-gnu
default
./configure --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --enable-force-cgi-redirect --disable-debug --enable-pic --disable-rpath --enable-inline-optimization --with-bz2 --with-db4=/usr --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --with-gd=shared --enable-gd-native-ttf --without-gdbm --with-gettext --with-ncurses=shared --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-xml --with-expat-dir=/usr --with-dom=shared,/usr --with-dom-xslt=/usr --with-dom-exslt=/usr --with-xmlrpc=shared --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-bcmath --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-pear=/usr/share/pear --with-imap=shared --with-imap-ssl --with-kerberos --with-ldap=shared --with-mysql=shared,/usr --with-mcrypt=/usr --with-pgsql=shared --with-snmp=shared,/usr --with-snmp=shared --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --enable-mbstring=all --enable-mbstr-enc-trans --enable-mbregex --with-mime-magic=/usr/share/file/magic.mime --with-apxs2=/usr/sbin/apxs
--enable-mbstring=all
--with-mcrypt=/usr