2016年8月5日 星期五

CentOS 6 NetworkManager 停用

service NetworkManager stop
chkconfig NetworkManager off
chkconfig NetworkManager --list

2016年6月16日 星期四

Centos 7 VNC 設定

安裝VNC Server

yum install tigervnc-server


複製設定檔

cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service


修改 VNC Client 連結的帳號

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l USER -c "/usr/bin/vncserver %i"
PIDFile=/home/USER/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target


建立 VNC Server 密碼

su user
vncpasswd


設定開機自動啟用

systemctl start vncserver@:1.service
systemctl enable vncserver@:1.service


確認是否啟用VNC Server虛擬桌面

vncserver -list


啟用 VNC Server 錯誤

systemctl start vncserver@:1.service
Job for vncserver@:1.service failed because the control process exited with error code. See "systemctl status vncserver@:1.service" and "journalctl -xe" for details.

刪除 /tmp/.X11-unix/ 目錄
\rm -R /tmp/.X11-unix/


設定防火牆允許VNC Server服務

firewall-cmd --permanent --add-service="vnc-server" --zone="public"
firewall-cmd --reload


查看防火牆zone所開的服務

firewall-cmd --zone=public --list-all

2016年3月28日 星期一

CentOS 7 設定IP

關掉 NetworkManager
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
systemctl restart network

修改/etc/sysconfig/network-scripts/ifcfg-(connection)

TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eth1
UUID=77f81288-6408-45e4-a1d7-114b8ea7690d
DEVICE=eno1
ONBOOT=yes
IPADDR=192.168.1.66
PREFIX=24
GATEWAY=192.168.1.1

DNS1=8.8.8.8
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

ifdown eth1 = 關閉網路卡
ifup eth1   = 開啟網路卡

2016年3月15日 星期二

Linux ibus 中文輸入法安裝

新酷音輸入法
yum install ibus-chewing

行列輸入法
yum install ibus-array

日文輸入法
yum install ibus-anthy

韓文輸入法
yum install ibus-hangul

拼音輸入法
yum install ibus-pinyin 

倉頡輸入法
yum install ibus-table-cangjie
yum install ibus-table-chinese-cangjie

五筆輸入法
yum install ibus-table ibus-table-wubi

2016年1月10日 星期日

systemd 基本管理方式

#systemctl --help                           #查詢systemctl指令用法
#systemctl list-units                       #查詢目前所有啟動中的服務
#systemctl list-units -a                   #查詢目前所有已啟動及未啟動的服務
#systemctl enable xxx.service      #設定開機啟動xxx.service
#systemctl disable xxx.service      #設定開始不啟動xxx.service
#systemctl stop xxx.service          #立即停止xxx.service
#systemctl start xxx.service          #立即啟動xxx.service
#ssytemctl status xxx.service       #查詢xxx.serivce目前的狀態

#systemctl is-active xxx.service   #查詢服務是否正常啟動

Centos 7 Run Level修改

顯示可用的運作層級
systemctl list-units --type target

顯示目前系統預設層級
systemctl get-default

切換到Run Level 3 [文字模式]
 systemctl isolate multi-user.target

切換到Run Level 5 [圖形模式]
 systemctl isolate graphical.target

設定開機為Run Level 3  [文字模式]
systemctl set-default multi-user.target

設定開機為Run Level 5 [圖形模式]
 systemctl set-default graphical.target