2015年11月6日 星期五

顯示某個字元位前所有字

SELECT         SUBSTRING(PROD_NO, 1, CHARINDEX('4', PROD_NO)) AS Expr1
FROM             PRODUCT 

例如SELECT出二字串"123@gmail.com"及"456@gmail.com"
顯示出@之前的字串---變成"123"及"456"

參考來源:http://www.blueshop.com.tw/board/FUM20041006152735ZFS/BRD200301231022589AD.html

2015年10月28日 星期三

Zimbra

環境:
ISO 檔 -> CentOS-7-x86_64-Minimal-1503-01.iso
VM -> CPU:1CORE,RAM:4G,HD:200G,網卡:VMXNET 3

OS版本 -> CentOS Linux release 7.1.1503 (Core)
cat /etc/centos-release

打開啟用網路、設定IP(192.168.10.99)、hostname(zmail.gg168.com)
nmtui

安裝 perl
 yum install perl

安裝 VMwareTools mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/VMwareTools-9.10.0-2476743.tar.gz /tmp/
cd /tmp
tar -zxvpf VMwareTools-9.10.0-2476743.tar.gz
 cd vmware-tools-distrib/
./vmware-install.pl

刪除 VMwareTools 安裝檔、壓縮檔
 rm -rf vmware-tools-distrib VMwareTools-9.10.0-2476743.tar.gz

reboot 鳥哥最常用來重新開機的指令(或關機),可以配合寫入緩衝資料的 sync 指令動作
sync; sync; sync; reboot

檢查是否有執行
 /etc/init.d/vmware-tools status

yum install sudo sysstat libidn gmp libtool-ltdl compat-glib vixie-cron perl libstdc++.i686 nc unzip perl-core wget nmap sqlite -y

安裝 ifconfig
yum provides ifconfig
yum whatprovides ifconfig
yum install net-tools
# #安裝 traceroute
yum install  traceroute

vi /etc/hosts
只留這一行>>192.168.10.99 zmail.gg168.com zmail

chkconfig postfix off
service postfix stop
chkconfig sendmail off
service sendmail stop
vi /etc/sudoers
chkconfig iptables off
service iptables stop
chkconfig ip6tables off
service ip6tables stop

vi /etc/sysconfig/selinux
>>SELINUX=disabled

關防火牆 http://note.tc.edu.tw/932.html
service firewalld stop

下載安裝 zimbra
cd /tmp
wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
tar -zxvpf  zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz
./install.sh

安裝完成後選項
6-4) Admin Password                           UNSET>>Password for admin@zimbra.168gg.com (min 6 characters): [SBmeBXtA] password
1-6) TimeZone:                                Asia/Taipei >> 57

檢視狀態
zimbra@zimbra:/~$ zmcontrol status

檢視憑證
/opt/zimbra/bin/zmcertmgr  viewdeployedcrt all |grep notAfter

安裝參考網址:
http://www.unixmen.com/install-zimbra-collaboration-suite-8-6-0-centos-7/
http://blog.revivalx.com/2015/03/10/how-to-install-zimbra-collaboration-suite-8-6-0-on-centos-7/
https://itservices.stanford.edu/service/emailcalendar/desktop/outlook/gal

2015年8月25日 星期二

MacBook Air 安裝 Win 7 鍵盤 滑鼠沒反應


OS X 10.8.5
Boot Camp 5.0.4(473)

安裝方式參考網址:
http://supera198.blogspot.tw/2013/07/2013-macbook-air-bootcamp.html

若找不到 BootCamp\Drivers\Intel\Chipset\WIN7 驅動可到 Intel 下載:
https://downloadcenter.intel.com/product/65855/Intel-USB-3-0-eXtensible-Host-Controller-Driver

解壓縮後
找出以下 12 個必需的驅動檔案,放在 BootCamp\Drivers\Intel\Chipset\WIN7 和下列位置

$WinPEDriver$\IntelxHCISetup\Drivers\HCSwitch\Win7\x64\iusb3hcs.cat
$WinPEDriver$\IntelxHCISetup\Drivers\HCSwitch\Win7\x64\iusb3hcs.inf
$WinPEDriver$\IntelxHCISetup\Drivers\HCSwitch\Win7\x64\iusb3hcs.sys
$WinPEDriver$\IntelxHCISetup\Drivers\HCSwitch\Win7\x64\WdfCoInstaller01009.dll
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3hub.cat
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3hub.inf
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\IUsb3Hub.man
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3hub.sys
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3xhc.cat
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3xhc.inf
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3xhc.man
$WinPEDriver$\IntelxHCISetup\Drivers\xHCI\Win7\x64\iusb3xhc.sys

以上方式還不行的話,可參考把 USB 安裝碟,打包 USB3.0 驅動至 USB 裡
http://www.macx.cn/thread-2098963-1-1.html