Recent Comments

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

2012年9月2日 星期日

CentOS 設定使用者自動登入

 vim /etc/gdm/custom.conf [daemon] AutomaticLoginEnable=true AutomaticLogin=abc ...

2012年8月15日 星期三

找出重疊的元件

.cpp //--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit2.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm2 *Form2; //--------------------------------------------------------------------------- __fastcall TForm2::TForm2(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm2::___TEST(TObject *Sender, TMouseButton...

2012年8月6日 星期一

移動滑鼠執行事件

  SetCursorPos(30,30); mouse_event(MOUSEEVENTF_LEFTDOWN,30,30,NULL,NULL); mouse_event(MOUSEEVENTF_LEFTUP,30,30,NULL,NULL); mouse_event(MOUSEEVENTF_LEFTDOWN,30,30,NULL,NULL); mouse_event(MOUSEEVENTF_LEFTUP,30,30,NULL,NUL...

2012年7月1日 星期日

shell script 數字補0

數字1、2、3、 補0 => 01、02、03 xx=`echo $num|awk'{printf "%02d", $1}'` echo $...

2012年6月28日 星期四

CentOS6用yum安裝webmin

vim /etc/yum.repos.d/webmin.repo 加入下面的內容 [Webmin]name=Webmin Distribution Neutral baseurl=http://download.webmin.com/download/yum enabled=1 rpm --import http://www.webmin.com/jcameron-key.asc yum install webmin yum install gcc openssl openssl-devel http://localhost:10000 帳號密碼為系統管理者r...

2012年6月7日 星期四

the log_filename parameter must equal

當執行pgadmin III的工具->伺服器狀態時會出現the log_filename parameter must equal…… 主要是設定檔的LOG FILE格式和PGADMIN III的格式不符所造成的 修改postgresql.conf vim /var/lib/pgsql/9.1/data/postgresql.conf 修改下面log_filename的參數內容 log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' 安裝adminpack 使用locate adminpack找到檔案路徑 /usr/pgsql-9.1/share/extension/adminpack--1.0.sql 執行 su -l postgres psql -d n5_data < /usr/pgsql-9.1/share/extension/adminpack--1.0.sql 出現Use "CREATE EXTENSION adminpack" to load this file. 在9.1的安裝方式改了,改用下面的指令,直接到資料庫中執行指令產生 psql -d n5_data  CREATE EXTENSION...

2012年6月4日 星期一

解壓縮資料夾下的檔案

解壓縮Z ls *.tar.Z | xargs -n 1 gunzip -d 解開檔案 ls *.tar | xargs -n 1 tar -xvf&nb...

2012年5月18日 星期五

postgresql agent設定

以下執行方式是linux系統的設定方式 安裝pgagent 於centos linux yum install pgagent_91 在執行psql指令時要用postgres帳號做操作 登入帳號 su -l postgres 為資料庫安裝pgagent,這一步要注意,要確定將pgagent.sql安裝到正確的資料庫, 安裝pgagent到資料庫postgres psql < /usr/share/pgagent_91-3.0.1/pgagent.sql 安裝pgagent到資料庫n5_data psql -d n5_data < /usr/share/pgagent_91-3.0.1/pgagent.sql pgagent.sql執行內容,會在該資料庫中建立所需要的資料表,建好後用PgAdminIII中的catalogs->pgAgent->Tables中看到 -bash-4.1$ psql -d n5_data < /usr/share/pgagent_91-3.0.1/pgagent.sql Password: BEGIN CREATE SCHEMA COMMENT NOTICE:...

2012年5月4日 星期五

postgresql install pgagent工作排程

yum install pgagent_91 su -l postgres psql < /usr/share/pgagent_91-3.0.1/pgagent.sql 在PgAdminIII下就會出現Job的功...

postgresql 備份和還原

備份 pg_dump dbname | gzip > filename.gz 還原前先建立 tablespace 資料庫使用者 資料庫 還原 gunzip -c filename.gz | psql dbn...

vsftpd 防火牆設定

vim /etc/sysconfig/iptables-con 將 IPTABLES_MODULES="" 改成 IPTABLES_MODULES="ip_nat_ftp ip_conntrack_ftp" vim /etc/sysconfig/iptables 加入 -A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 20 -j ACCEPT 重新啟動iptables service iptables restart selinux setsebool -P ftp_home_dir=...

2012年5月3日 星期四

centos 關 ping

vim /etc/sysctl.conf 加入一行 net.ipv4.icmp_echo_ignore_all = 1 1:關 0:開 設定好後 sysctl -...

install phpPgAdmin

yum install httpd php 設定 vim /etc/httpd/conf/httpd.conf DirectoryIndex後面加入index.php 安裝phpPgAdmin yum安裝yum install phpPgAdmin 會將相關的apache php等套件一同安裝 使用yum安裝完後在/var/www/html並沒有發現phpPgAdmin的資料夾 主要分成兩個部分 主程式:/usr/share/phpPgAdmin 設定檔:/etc/phpPgAdmin/config.inc.php 網址:127.0.0.1/phpPgAdmin就可以連到,系統會自動設好 手動下載安裝:下載網站:http://phppgadmin.sourceforge.net/doku.php?id=download 下載完後解開到/var/www/html下即可 設定檔:phpPgAdmin/conf/config.inc.php 網址:127.0.0.1/phpPgAdmin就可以連到 設定config.inc.php vim /etc/phpPgAdmin/config.inc.php $conf['servers'][0]['host']...

2012年5月2日 星期三

Server instrumentation not install

安裝完postgresql後,用PgAdminIII連線會出現Server instrumentation not install的視窗 解決方法: yum install postgresql91-contrib su - postgres psql < /usr/pgsql-9.1/share/extension/adminpack--1.0.sql 再用PgAdminIII重新連線一次,點選在 Server instrumentation not install的視窗下方的『Fix it!...

2012年4月30日 星期一

CentOS6 Mount NTFS

安裝好rpmforge-release後,再安裝fuse-ntfs-3g即可 yum install fuse-ntfs...

2012年4月17日 星期二

釋放linux下沒有使用的記憶體

sync echo 1 > /proc/sys/vm/drop_cache...

2012年4月16日 星期一

phpPgAdmin You don't have permission to access /phpPgAdmin on this server.

安裝完phpPgAdmin後 192.168.1.XXX/phpPgAdmin會出現You don't have permission to access /phpPgAdmin on this server. 但在127.0.0.1/phpPgAdmin或localhost/phpPgAdmin都可以連上 解決方式: 設定vim /etc/httpd/conf.d/phpPgAdmin.conf 刪除Allow from 127.0.0.1 增加allow from all 重啟httpd ================================== Alias /phpPgAdmin /usr/share/phpPgAdmin     Order deny,allow     Deny from all #    Allow from 127.0.0.1     allow from all     Allow from ::1     # Allow from .example.com...

2012年4月4日 星期三

CENTOS6 安裝 rpmforge-release

32位元 http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm 64位元 http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm rpm -Uvh http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm centos...

CENTOS6 安裝EPEL

32位元 http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm 64位元 http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm 導入key rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 安裝 yum-priorities yum install yum-priorit...