PHP強迫輸出

Source: http://php.net/manual/en/function.ob-flush.php

some problems with ob_flush() and flush() could be resolved by defining content type header :
header( ‘Content-type: text/html; charset=utf-8’ );

so working code looks like this:

';
for( $i = 0 ; $i < 10 ; $i++ )
{
    echo $i . '
'; flush(); ob_flush(); sleep(1); } echo 'End ...
'; ?>
Posted in PHP | Leave a comment

vsphere client 語系調整

God…….繁中的文字都看不懂啦……..
只是把簡體中文直接轉成繁體中文……

還好他有提供了多語系環境可供使用
修改VMware vSphere Client捷徑參數在”C:Program Files (x86)VMwareInfrastructureVirtual Infrastructure ClientLauncherVpxClient.exe” -locale zh_US 即可啟動該語系環境。

語系和對應參數

vxclient -locale en_US 英語

vpxclient -locale zh_CN 簡體中文

vpxclient -locale ja 日語

vpxclient -locale de 德語

Posted in VMware | Leave a comment

VMware esxi 5.5 install will fail after first reboot

主機板: ASUS z97-c
當安裝完後reboot會跳回bios畫面, 但實際上是已經安裝了
問了一下Google….
ESXi boots after install but Drops to BIOS next reboot
No bootable device” after successful ESXi 5 installation on Intel DG35EC desktop motherboard

要作的事情有下列幾項
1. 關閉UFEI, 只選用傳統的Legacy模式
2. 安裝時在第一個選單按下”Shift + O”
3. 在文字後方加入 ” formatwithmbr” 進行後續安裝

Posted in VMware | Leave a comment

Centos 看版本資訊

 

[root@p2p02 ~]# yum install redhat-lsb -y 

[root@p2p02 ~]# lsb_release -a  
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.5 (Final)
Release:    6.5
Codename:   Final

Posted in Linux | Leave a comment

MySQL 初始化設定

[root@localhost ~]# mysql_secure_installation





NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] n
 ... skipping.

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] n
 ... skipping.

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] n
 ... skipping.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] n
 ... skipping.

Cleaning up...



All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!
Posted in Linux, MySQL | Leave a comment

Ubuntu 設定時區

dpkg-reconfigure tzdata 
Posted in Ubuntu | Leave a comment

Openvpn logrotate.d 設定

編輯/etc/logrotate.d/openvpn

vim /etc/logrotate.d/openvpn

/var/log/openvpn/openvpn.log {
daily  #每日歸為一個log檔
rotate 99999999 #可以保存9999999個檔案
compress #壓縮檔案
dateext  #以日期重新命名
postrotate  
  /etc/init.d/openvpn reload
endscript
}
Posted in Linux, OpenVPN | Leave a comment

安裝Kamailio SIP Server

安裝環境: Ubuntu 12.04 x64

  1. 系統更新
apt-get update
apt-get upgrade
  1. 安裝mysql-server及必要套件
apt-get install mysql-server
apt-get install make flex bison libmysqlclient-dev
  1. 下載安裝檔案並產生設定檔
cd /tmp
mkdir sip
cd sip
wget http://www.kamailio.org/pub/kamailio/latest/src/kamailio-4.1.3_src.tar.gz
tar -zxvf kamailio-4.1.3_src.tar.gz
cd kamailio-4.1.3
make cfg
  1. 加入mysql支援
vim modules.lst 
=> include_modules= db_mysql
  1. 編譯、安裝
make all
make install
  1. 設定使用mysql
vim /usr/local/etc/kamailio/kamctlrc
# DBENGINE=MYSQL => DBENGINE=MYSQL
  1. 設定
kamdbctl create
cp pkg/kamailio/deb/debian/kamailio.init /etc/init.d/kamailio
chmod 755 /etc/init.d/kamailio
  1. 編輯執行檔
vim /etc/init.d/kamailio
DAEMON=/usr/sbin/kamailio => DAEMON=/usr/local/sbin/kamailio
CFGFILE=/etc/kamailio/kamailio.cfg => CFGFILE=/usr/local/etc/kamailio/kamailio.cfg
USER=kamailio => USER=root
GROUP=kamailio => GROUP=root
  1. 設定
cp pkg/kamailio/deb/debian/kamailio.default /etc/default/kamailio
  1. 設定
vim /etc/default/kamailio
# RUN_KAMAILIO=yes => RUN_KAMAILIO=yes
  1. 啟動方式

/etc/init.d/kamailio {start , stop , status}

  1. 創建使用者
kamctl add  

13.修改使用者密碼

passwd  
  1. 刪除使用者
rm 
  1. 預設password kamailiorw
Posted in Kamailio, Ubuntu | Leave a comment

Avconv install

mkdir avconv-source
cd ~/avconv-source
sudo apt-get install build-essential checkinstall
sudo apt-get build-dep yasm
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz && tar -xf yasm-1.2.0.tar.gz && cd yasm-1.2.0 && ./configure
make
sudo checkinstall --pakdir "$HOME/Desktop" --pkgname yasm --pkgversion 1.2.0 --backup=no --default

cd ~/avconv-source
git clone git://git.videolan.org/x264.git x264
cd x264
sudo ./configure --enable-static
sudo make
sudo make install

cd ~/avconv-source
wget https://launchpad.net/ubuntu/+archive/primary/+files/libav_0.8.9.orig.tar.xz
tar -xvf libav_0.8.9.orig.tar.xz -C avconv
cd avconv
sudo ./configure
sudo ./configure --enable-gpl --enable-libx264
sudo make
sudo make install
Posted in Libav | Leave a comment

FFmpeg:Format Segment 第1段影片之後的Start time錯誤

在 -f segment -segment_time 60 後加上 -reset_timestamps 1
reset_timestamps 參數預設為 0,start 採用原本 streaming 的時間
設為 1,start 從 0 開始

Posted in FFMpeg | Leave a comment