To upgrade all my Python packages installed by pip

2014-11-19 寫程式 No comments

# pip install -U `pip list -o | \
grep -v -i warning | grep -v -i "Could not find" | grep -v -i "use --allow-external" | \
cut -f1 -d' ' | tr "\n|\r" " "`

See http://stackoverflow.com/questions/2720014/upgrading-all-packages-with-pip

Scientific Linux 7 grub2-mkconfig

2014-10-21 Linux No comments

Scientific Linux 7 終於釋出了,趕緊拿來試裝在筆電上。筆電上原本有 Ubunto 14.04,和 Windows 8.1 做成 Dual Boot。
以 SL7 取代 Ubuntu 14.04,安裝過程還算順利。但是安裝完畢重新開機時,發現 Grub 的開機選單裡面沒有 Windows 8.1!
( 繼續閱讀… )

CentOS 7 firewall

2014-10-14 Linux No comments

CentOS 7 uses firewalld instead of iptables.
To open service ports and allow external connections, edit /etc/firewalld/zones/public.xml
( 繼續閱讀… )

How to get rid of GPT

2014-10-14 Linux No comments

A disk with GPT partition table can not be used to install Linux.
To get rid of GPT, we must use GNU parted
# parted /dev/sda
# mktable msdos
# quit

Install CentOS 7 Using Software RAID

2014-10-14 Linux No comments

CentOS 7 installation uses a partition tool far too stupid.
There is no way to setup software raid in the CentOS 7 installer.
To install CentOS 7 with software raid, I have to create software raid manually in advance.
First, press Ctrl+Alt+2 to switch to a console.
Then fdisk /dev/sda and fdisk /dev/sdb to setup partitions.
Note that partitions for software raid should be of type fd not of type 83.
( 繼續閱讀… )

MEAN: MongoDB, Express.js, AngularJS and Node.js

2014-09-19 寫程式 No comments

A good tutorial at https://thinkster.io/angulartutorial/mean-stack-tutorial/

SysVinit to Systemd Cheatsheet

2014-08-27 Linux No comments

SysVinit to Systemd Cheatsheet

Multi-Boot System Time Conflict

2014-07-27 Linux No comments

同一部電腦安裝 Windows 和 Linux 做成多重開機,常常發現在 Linux 環境中時間是正確的,但是重新開機進入 Windows 之後,時間就不對了,在台北會發現時間差了 8 小時。
這裡 找到了解答,分成兩個方向,其一是改 Windows,另外一個解是改 Linux,則一為之即可。
( 繼續閱讀… )

How to enable Atheros AR242x / AR542x Wireless Network Adapter on CentOS 7

2014-07-15 Linux No comments

The Linux kernel version 3.10 used by CentOS 7 does not come with a driver for Atheros AR242x / AR542x Wireless Network Adapter. When my Lenovo X200 laptop boots into CentOS 7, the WiFi light turns off. Though the WiFi light was blinking as it boots into Windows 8.

Issue a lshw command to check the hardware:
# lshw -C network

It shows
*-network UNCLAIMED
description: Ethernet controller
product: AR242x / AR542x Wireless Network Adapter (PCI-Express)
vendor: Qualcomm Atheros
physical id: 0
bus info: pci@0000:03:00.0
version: 01
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list
configuration: latency=0
resources: memory:f2500000-f250ffff

Which means no proper driver for the Atheros wireless network adapter is loaded.

Issue a modprobe command to load kernel module driver ath5k,
# modprobe -v ath5k

It shows
modprobe: FATAL: Module ath5k not found.
( 繼續閱讀… )

Martin Fowler 對 NoSQL 資料庫的分類

2014-07-14 研究 No comments

Martin Fowler 對 NoSQL 資料庫的分類:
Key-Value Pair: Memcached, Coherence, Redis
Tabular: BigTable, HBase, Accumulo
Document-oriented: MongoDB, CouchDB, Cloudant