2017/07/30

How to compile PHP extension on Ubuntu 14.04

Install PHP 5.6
sudo su
apt-get install python-software-properties
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php5.6 -y
php -v

Download package and compile it
wget  http://pecl.php.net/get/xdebug-2.5.5.tgz
tar -zxf xdebug-2.5.5.tgz
cd xdebug-2.5.5
phpize
./configure -with-php-config=/usr/bin/php-config5.6
make && make install

It will show the info as below
Installing shared extensions:     /usr/lib/php/20131226/
cd /usr/lib/php/20131226/
ls -l
You can find your xdebug.so for php extension

2017/06/30

How to install XRDP on Ubuntu 14.04

sudo su
apt-get update
apt-get install xrdp -y
apt-get install xfce4 -y
echo xfce4-session >~/.xsession
nano /etc/xrdp/startwm.sh
-------------------------------------------------------
#!/bin/sh

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

startxfce4
-------------------------------------------------------
service xrdp restart
hostname -I

Optional Config
iptables -A INPUT -p tcp --dport 3389 -m state --state NEW -j ACCEPT
ufw allow 3389/tcp

2017/05/02

修復穩死(Windows10#10586)的網路芳鄰問題

run cmd.exe as administrator
type two commands as below:
sc.exe config lanmanworkstation depend=bowser/mrxsmb10/nsi
sc.exe config mrxsmb20 start=disabled
reboot your computer.

2017/03/24

Restream Chat Embed via CSS

.message-sender{
color:rgba(0,0,0,0);
font-size: 30px;
}

.message-time{
color:rgba(0,0,0,0);
font-size: 30px;
}

.message-text{
background-color:rgba(0,0,0,0);
color:rgba(0,0,0,1);
font-family:"Microsoft JhengHei";
font-size: 36px;
font-weight: 600;
line-height: 1.00em;
padding-left: 0.5em;
}

.message-item{
background-color:rgba(0, 0, 0, 0);
}

2017/03/15

Run Web UI Automation Test By Selenium on Ubuntu Desktop 14.04

Download Selenium 2.53.1 and extrat it.

Download Firefox Geckodriver v0.15.0 and extrat it.
Set Firefox Webdriver Path
export PATH=$PATH:/home/firefox-driver/geckodriver

Download Google Chrome Browser Install Package
Open Terminal
Type "dpkg -i google-chrome-stable_current_amd64.deb" to install.
nano opt/google/chrome/google-chrome
Modify exec -a "$0" "$HERE/chrome" "$@" to exec -a "$0" "$HERE/chrome" "$@" --user-data-dir --no-sandbox
save and exit
Download Google Chromedriver 2.28 and extrat it.

2017/03/12

Install Tomcat 7 on Ubuntu Server 16.04

apt-get update
apt-get install openjdk-8-jdk -y
useradd -s /bin/false -g tomcat -d /opt/tomcat-7.0.75
curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-7/v7.0.75/bin/apache-tomcat-7.0.75.tar.gz
mkdir /opt/tomcat-7.0.75
tar xzvf apache-tomcat-7.0.75.tar.gz -C /opt/tomcat-7.0.75 --strip-components=1
cd /opt/tomcat-7.0.75
chgrp -R tomcat /opt/tomcat-7.0.75
chmod -R g+r conf
chmod g+x conf
chown -R tomcat webapps/ work/ temp/ logs/