Enable mongodb network access

2014-12-16 Linux, 寫程式 No comments

To access mongodb from another host other than localhost, edit /etc/mongodb.conf and modify the line bind_ip = 0.0.0.0

OS: Ubuntu 14.04 LTS
MongoDB: 2.6.3

CoreOS Installation

2014-11-24 Linux, Virtualization No comments

The installation of a CoreOS 444.5.0 Linux VM on VMware ESXi 5.5 is described as following.
Network Environment:
I have a LAN with DHCP service enabled. The network configuration of the LAN is 192.168.4.0/24.
I have a PC running Scientific Linux version 7, whose hostname is YUN and IP address is 192.168.4.52.
Before Installation:
Download CoreOS ISO image from http://stable.release.core-os.net/amd64-usr/current/. The filename of the ISO image is coreos_production_iso_image.iso.
Create a VM on a VMware ESXi 5.5 server. The guest operating system type of the VM is Other 2.6.x Linux (64-bit).
Create SSH RSA keys on YUN as follows:
$ ssh-keygen -t rsa
The private key will be written into ~/.ssh/id_rsa and the public key will be written into ~/.ssh/id_rsa.pub.
Copy the public key and create a configuration file named cloud-config as follows:

#cloud-config
hostname: coreos1
ssh_authorized_keys:
    - ssh-rsa AAAAB3NzaC1yc2E...skip... username@yun


Installation Steps:
1. Connect the VM’s CDROM to the ISO image coreos_production_iso_image.iso and force the VM boot from its CDROM.
2. After boot, switch to root by sudo su -
3. Copy the file cloud-config from YUN by scp username@192.168.4.52:cloud-config .
4. Begin installation by coreos-install -d /dev/sda -C stable -c cloud-config
After installation:
Login to coreos1 from YUN by ssh -A core@ip.to.coreos1

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,則一為之即可。
( 繼續閱讀… )