CentOS / Ubuntu / Fedora 開機啟用或關閉 X Server GUI 界面

新版 CentOS / Ubuntu / Fedora 使用了 Systemd 系統服務管理,如電腦的用途為伺服器,關閉 GUI 界面能節省系統資源,方法如下:開啟終端機,輸入以下指令再重新啟動電腦即可:

systemctl set-default mult-user.target

要重新啟用 GUI 界面,則輸入:

systemctl set-default graphical.target

Reference: https://fedoraproject.org/wiki/Systemd

Ubuntu 15.04 自動登入桌面設定方法

這個年頭 XFCE 桌面環境好像使用的人不多,但筆者的 Ubuntu 是安裝在 Raspberry Pi 2 上,雖說 CPU 時脈、1G RAM 比等都比第一代進步,但實際使用上如瀏覽網頁等仍然比較慢,利用 Raspberry Pi 作日常使用的桌面電腦幾乎不可能。廢話不多,新版 Ubuntu 使用 LightDM,設定方面跟 GDM 略有不同。

/etc/lightdm/lightdm.conf 新增一個純文字檔案,本人喜好 vim 命令列編輯器:

sudo vim /etc/lightdm/lightdm.conf

單按 i 鍵進入 insert (插入) 模式,貼上以下代碼,並更改登入名稱:

[SeatDefaults]
autologin-user=登入名稱

完成後按 ESC 鍵退出插入模式,輸入 :wq 及 ENTER 退出編輯器,然後重新啟動電腦即可自動登入。

How to install the latest Nginx 1.8.0 Stable on Ubuntu Raspberry Pi 2

I installed Ubuntu 15.04 on my Raspberry Pi 2 Model B using this image built by mrengles. I personally prefer Ubuntu over the default Raspbian Wheezy simply because their packages are more stable and up-to-date. However still, the ports.ubuntu.com repo has an older version of Nginx (1.6.2). To install the newest Nginx 1.8.0 stable, you will either have to build it from source or install a binary prebuilt by someone. After some googling, I found it here.

Add the ppa repository:

sudo add-apt-repository ppa:teward/nginx-stable-testing

You will see this message:

Staging PPA for nginx/stable PPA.

This contains all builds for the Stable PPA.  Good builds, bad builds, and old builds.  Please do not use this PPA unless you really know what you're doing.
 More info: https://launchpad.net/~teward/+archive/ubuntu/nginx-stable-testing
Press [ENTER] to continue or ctrl-c to cancel adding it

Follow the instruction and press [ENTER].

Go ahead and perform the normal apt-get update and apt-get install:

sudo apt-get update
sudo apt-get install nginx

You may edit the settings from /etc/nginx/nginx.conf and /etc/nginx/sites-available/default as required. Then start Nginx normally:

sudo service nginx start

Open your browser to see if that works.