2017/12/04

VMware - Resize HDD by LVM on Ubuntu 14.04

1. Set your VM OS HDD 20GB to 40GB
2. Boot your VM and use SSH login
3. Follow the command as below:
  
    sudo su
    parted
    mkpart primary 20GB 40GB
    print
    quit
    reboot
  
    sudo su
    lvm
    pvcreate /dev/sda3
    pvs
    quit
  
    pvscan
    vgextend ubuntu1404-vg /dev/sda3
  
    pvscan
    ls /dev/ubuntu1404-vg
    df -h
  
    lvextend -L +20G /dev/ubuntu1404-vg/root
    resize2fs /dev/ubuntu1404-vg/root
    df -h

2017/11/17

How to disable Windows Remote Desktop Copy/Paste Function

1. Press Win+R key to open Run window.
2. Type gpedit.msc then press Enter.
3. Expand  Computer Configuration→Administrative Templates→Windows Components→Remote Desktop Services→Remote Desktop Session Hosts→Device and Resource Redirection
4. Enable "Do not allow clipboard redirection" rule.

Reference screen capture as below:





2017/11/08

How to Install Nagios 4 on CentOS 6.x

[Install Package]
yum update
yum install  -y nano openssl-devel git
yum install -y httpd php
yum install -y gcc glibc glibc-common
yum install -y gd gd-devel

[Create User and Group]
useradd nagios
passwd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

2017/11/04

Nagios 4 - Monitor Server and Remote Client Configuration

Install NRPE v3 to Remote Client

cd /tmp
wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.1.tar.gz
tar xzf nrpe.tar.gz
cd /tmp/nrpe-nrpe-3.2.1/
./configure --enable-command-args
make all
make install
make install-config
echo >> /etc/services
echo '# Nagios services' >> /etc/services
echo 'nrpe    5666/tcp' >> /etc/services
make install-init
nano /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,192.168.xx.xx

service nrpe start
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1

2017/08/18

How to restore your Macbook from Netwrok TimeMachine

1.Reboot your macbook
2.Press Command+R into Recovery Mode
3.Connect to WiFi.
4.Open Terminal in Utilities menu
5.Type cd /Volumes
6.Type mkdir TMBackup for create folder
7.Type cd TMBackup
8.Type pwd for see your path /Volumes/TMBackup
9.Type mount -t afp afp://username:password@ServerIP/ShareName /Volumes/TMBackup
10.Type ls -l for find your backup file
11.Type hdid /Volumes/TMBackup/xxxSparseBundle
12.Go back Restore From Time Machine Backup
13.Now you can see your TimeMachine backup and select it to restore macbook.

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/

Install LFTP on Ubuntu Server 16.04

無法查看此摘要。請 按這裡查看文章。

2017/03/11

Install GitLab 8 on Ubuntu Server 16.04

sudo apt-get update
sudo apt-get install curl openssh-server ca-certificates postfix
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce
sudo gitlab-ctl reconfigure
sudo gitlab-ctl pg-upgrade

Open GitLab by web browser
http://localhost:8080
username is root
password is 5iveL!f

2017/03/10

How to get iOS logs from Mac and Windows

Mac OS X

1.Launch iTunes.
2.Finder > Go > Go to Folder
3.Type  ~/Library/Logs/CrashReporter/MobileDevice/  then press Go button
4.Now you can find all of logs from your device.

Windows

1.Download iOSLongInfo
2.Extract it
3.Open it by Windows File Explorer
4.Top Menu > Files > Open Command Prompt > Open Command Prompt as Administrator

Capture console logs:
sdsiosloginfo.exe -d > C:iOS.log

Capture Carsh logs:
sdsioscrashlog.exe -e -k C:\iOScrashLogs

Pull disk_usage:
sdsdeviceinfo.exe -q com.apple.disk_usage -x > C:\iOS_Disk_Usage.xml

Pull Device Stats:
sdsdeviceinfo.exe -x > C:\iOS_Device_Stats.xml

2017/03/09

Install Jenkins 2.49 on Ubuntu 14.04 Server

1.Update your system
sudo su
apt-get update

2.Install Nginx
apt-get install nginx -y
service nginx status

3.Install JDK
apt-get install openjdk-7-jdk -y
java -version

4.Install Jenkins
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
apt-get update
apt-get install jenkins -y
service jenkins status
nano /etc/default/jenkins (check or modify it)
service jenkins start

5.Open Jenkins by web browser
http://localhost:8080

6.Get Administrator Password
nano /var/lib/jenkins/secrets/initialAdminPassword

Install GitLab 6 on Ubuntu 14.04 Server

1.Update your system
sudo apt-get update
sudo apt-get upgrade -y

2.Create a git user for GitLab
sudo adduser --disabled-login --gecos 'GitLab' git

3.Install the required packages
sudo apt-get install build-essential cmake zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate

4.Install Git
sudo apt-get install git -y

5.Install Postfix mail server
sudo apt-get install postfix -y

2017/01/13

87%軟工 – Scrum之亂



莫名其妙進入軟體業兩三年後,三不五時聽到Scrum這名詞在耳邊繚繞,到底是在供尛呢?
但最近發現一件很有趣的現象,就是現在的開發團隊或是新創公司都在要求對Scrum認知,連自己公司的部門也是討論的沸(ㄅㄨˊ)()(ㄙㄨㄛˇ)(ㄩㄣˊ)。然後就這樣又過了半年多,讓我擠出了一點小小感想。

1.    盡信Scrum不如無Scrum?
還記得高職的基 (ㄅㄟˋ) (ㄉㄤˋ)(ㄍㄤ)(ㄏㄠˇ)老師說了句名言,「盡信書不如無書,盡信老師不如無老師」,這雖然是在開玩笑,但前半句話並非如此。在工作/職場中觀察下來,太多人糾結在Scrum這名詞或方法上面打轉,沒有真正思考自己的團隊是否已經能夠擁抱這樣的改變。並非質疑改變的不好,而是在這之前的基礎你打穩了沒!

2.    團隊(Real Team)
在軟體專案/產品開發中,管理者請盡可能去了解團隊中每一位成員的想法,取得與開發者的共識,彼此建立足夠的信任感。這件事非常重要,剛開始是非常辛苦且花時間的,但絕對是值得投資的一件事情。誠懇的溝通與銅鋰鋅很重要XD!

3.    人才(兵種)
在遇到的開發者中,有些人是屬於只要把計畫安排好的事情交辦給他,就會如期完成;有些人則是創意十足,適合創造與設計。所以請把對的事交給對的人去做絕對事半功倍!否則會變成,孔明當武將,張飛當智__的局面。

4.    理論(現實)
不論是哪一種理論,千萬不要死記死背。每個團隊有每個團隊的風格,每位成員有每位成員的特質,不會因為拿A公司成功的案例來B公司實施就會變成良藥,盲目的照本宣科只會害人害己。

5.    你準備好Scrum了嗎?
對我來說,要達成執行Scrum的條件是,每一位成員都能夠清楚的知道自己所扮演的角色,負責的工作項目,以及團隊目標。所以你今天Scrum了嗎?