Category Archives: CentOS

[Python] fix error while loading shared libraries: libpython2.7.so.1.0

error log: /opt/rh/python27/root/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory check libpython2.7.so.1.0 exist? find . -name ‘libpython2.7.so.1.0’ if the file was exist: edit the ldconfig config echo “/opt/rh/python27/root/usr/lib64” > /etc/ld.so.conf.d/python27.conf ldconfig … Continue reading

Posted in CentOS, Python | Leave a comment

Add git branch name to bash prompt

edit ~/.bash_profile if [ -f $(xcode-select -p)/usr/share/git-core/git-completion.bash ]; then . $(xcode-select -p)/usr/share/git-core/git-completion.bash . $(xcode-select -p)/usr/share/git-core/git-prompt.sh fi #enables color in the terminal bash shell export CLICOLOR=1 #sets up the color scheme for list export LSCOLORS=ExFxCxDxBxegedabagacad #sets up the prompt color (currently … Continue reading

Posted in CentOS, Git, Linux, Mac, Ubuntu | Leave a comment

Apache SSL Enable

環境 CentOS 5.x i386 產生 key [root@Web test]# openssl genrsa -des3 -out site.key 2048 Generating RSA private key, 2048 bit long modulus …………+++ ………………+++ e is 65537 (0x10001) Enter pass phrase for site.key: Verifying – Enter pass phrase for site.key: … Continue reading

Posted in Apache, CentOS, SSL | Leave a comment

使用GMail SMTP寄信 – ssmtp (CentOS)

yum install ssmtp vim /etc/ssmtp/ssmtp.conf root=username@gmail.com mailhub=smtp.gmail.com:587 RewriteDomain= Hostname=username@gmail.com UseSTARTTLS=yes AuthUser=username@gmail.com AuthPass=password FromLineOverride=YES TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt alternatives –config mta 選擇 /usr/sbin/sendmail.ssmtp 檢查目前sendmail方式 sendmail -V sSMTP 2.61 (Not sendmail at all) 測試 echo “This is a test” | mail -s “Test” cowman.chiang@gmail.com Reference … Continue reading

Posted in CentOS | Leave a comment

使用GMail SMTP寄信 – command (CentOS)

近來發現diary log幾乎都收不到了 測試了一下, 發現連手動執行script都失敗 所以想一下就改用GMail SMTP應該比較保險 Reference: 在 Linux 上直接用 Gmail SMTP 寄信 yum install mailx vim ~/.mailrc account gmail { set smtp-use-starttls set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user=username@gmail.com set smtp-auth-password=password set from=”username@gmail.com” set ssl-verify=ignore set nss-config-dir=/root/.pki/nssdb set nss-config-dir=/etc/pki/nssdb } … Continue reading

Posted in CentOS | Leave a comment

CentOS 快速安裝 Nginx with RTMP module

跟 之前裝在Ubuntu的那一篇 一樣 都是沒有設定stat的部分, 需要在另外修改 大致上跟Ubuntu的方式都相同 只是要注意的為 init script 可不可正常進行 測試的範例中是修改 nginx.conf 將 pid 那一行給取消註腳 pid logs/nginx.pid; #!/bin/sh yum groupinstall ‘Development Tools’ -y yum install pcre pcre-devel openssl-devel libxslt-devel -y cd /tmp wget http://nginx.org/download/nginx-1.7.3.tar.gz wget https://github.com/arut/nginx-rtmp-module/archive/master.zip tar -zxvf nginx-1.7.3.tar.gz yum … Continue reading

Posted in CentOS, Nginx, RTMP | Leave a comment

Resize Virtual Disk – VMware ESXi 4.1 & CentOS 5.5 x86

使用vSphere Client登入調整硬體的設定,將硬碟空間增大 (由20G -> 80G) 將VM Guest重開機 以ssh登入VM Guest 輸入fdisk -l取得目前磁碟資訊 [root@localhost ~]# fdisk -l Disk /dev/sda: 85.8 GB, 85899345920 bytes 255 heads, 63 sectors/track, 10443 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start … Continue reading

Posted in CentOS, VMware | Leave a comment