Install VMware Tools on a Fedora 21 guest

2015-04-18 Linux No comments

Thanks to http://olivier.marinaolivier.com/2015/02/install-vmware-tools-on-fedora/ and http://docs.kali.org/general-use/install-vmware-tools-kali-guest

To make Fedora 21 a perfect workstation for me

2015-03-28 Linux, 寫程式 No comments

yum group install "Administration Tools" "Games and Entertainment" "Office/Productivity"
yum group install "Authoring and Publishing" "Design Suite" "Educational Software" "Engineering and Scientific"
yum group install "Fedora Eclipse" "Development Tools"
yum group install "C Development Tools and Libraries" "D Development Tools and Libraries"
yum install texlive-collection-xetex xfig vsftpd lftp filezilla gnome-tweak-tool openssl-devel

Install Google Chrome browser on Fedora 21 workstation

2015-03-28 Linux No comments

First, download Google Chrome browser from Google.
Secondly, install dependent packages:
yum install redhat-lsb libXScrnSaver
Finally, install the RPM package
rpm -Uvh google-chrome-stable_current_x86_64.rpm

Tweak GNOME on a Fedora 21 workstation

2015-03-28 Linux No comments

To tweak GNOME desktop on a Fedora 21 workstation, install gnome-tweak-tool:
yum install gnome-tweak-tool
With gnome-tweak-tool, we can change screen font size, enable applications menu, focus window with mouse pointer without a click.

Generate zh_TW Locale on a Ubuntu Server

2015-02-12 Linux No comments

First, edit /etc/default/locale to be
LANG="zh_TW.UTF-8"
Then install language pack:
# apt-get install language-pack-zh-hant
Finally, generate locale:
# locale-gen zh_TW.UTF-8

/etc/cron.{hourly,daily,weekly,monthly} 裡頭的 scripts 不能有副檔名

2015-02-09 Linux No comments

突然發現放在 Ubuntu 14.04 版 /etc/cron.daily/ 裡面的 script 居然沒有按時執行。
run-parts --test /etc/cron.daily 檢查,這些 script 也沒有被列出來,
結果在 https://justcheckingonall.wordpress.com/2009/06/28/cron-does-not-run-scripts/ 發現原來是因為 run-parts 不接受檔案名稱包含 . (句點) 的檔案。
所以必須把 01-home-backup.sh 改名稱變成 01-home-backup 才行。
奇怪的是這些定時執行的 script 是我從 RHEL 4 的時代用到現在的,先前使用 Ubuntu 也沒有出過這個問題,怎麼會突然出這個 Bug。
追查之下才發現是 Debian 做了這項改變,而且他們似乎不認為這是一個 Bug。
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=54421

mongodb 備份與復原

2015-02-05 寫程式 No comments

詳見 http://docs.mongodb.org/manual/reference/program/mongodump/
以 mongodump 匯出者,以 mongorestore 匯入
以 mongoexport 匯出者,以 mongoimport 匯入

查區域網路網路上用掉的 IP

2015-01-16 Linux No comments

nmap -sP 192.168.3.0/24

查看究竟是那一支程式佔用了通訊埠

2014-12-30 寫程式 No comments

遇到啟動程式失敗的狀況,原因是該程式使用的 TCP 通訊埠已經被占用。
此時應以下列指令查出占用通訊埠的程式究竟是誰:

LINUX:
# netstat -tupln

WINDOWS:
先找出 PID:
netstat -bano
再找出 Process
tasklist /fi "pid eq 1544"

Import a vmdk into ESXi inventory

2014-12-23 Virtualization No comments

First transfer the vmdk file to the ESXi server with scp or vSphere client.
Then SSH to the ESXi server and cd /vmfs/volumes/datastore1 and enter the directory where the vmdk file is stored.
Last step, clone the vmdk file by
vmkfstools -i source.vmdk -d thin replica_name
where the -i option means “clone" and the -d option specify output format. The argument “thin" means “thin-provisioned".
Two files will be generated: replica_name-flat.vmdk and replica_name.vmdk.

Reference: http://www.shadowandy.net/2011/05/toying-with-vmware-esxi-importing-existing-vmdk.htm