Oct 25, 2013

Solving MacPorts problems on OS X Mavericks

Date: Oct 25, 2013 10:00 am PST

Problem:
After upgrade my OS X to Mavericks as well as my XCode to XCode 5, there are several command line tool kits that do not work so well, including MacPorts. That is a pretty terrible situations and I really don't want to rely myself on "App Store" or any kinds of installation packges. MacPorts itself seems also noticed of the problem and posted a solution on its website. Looks like there were at least 35 tickets about this issue before I noticed of it. However, while building the source code, there were more problems came out and I believe I should post how I solve the problems along the way.

Errors in sequence:

  1. configure macports source code error: need glib
  2. configure glib error: need gettext
  3. installed gettext, but glib doesn't recognize


Here is the correct order of how you should do it:

1. Install xcode command line tool kit, seems like in XCode5, it got rid of my installed command line tool kit
sudo xcode-select --install
2. Install gettext from source code:
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz
tar xf gettext-0.18.3.1.tar.gz
cd gettext-0.18.3.1
./configure
make
sudo make install
3. Install glib from source code:
wget http://ftp.gnome.org/pub/gnome/sources/glib/2.39/glib-2.39.0.tar.xz
tar xf glib-2.39.0.tar.xz
cd glib-2.39.0
./configure
make
sudo make install
4. Install MacPorts (I followed the official instructions):
wget https://distfiles.macports.org/MacPorts/MacPorts-2.2.0.tar.bz2
tar xf MacPorts-2.2.0.tar.bz2
cd MacPorts-2.2.0/
./configure
make
sudo make install 

After you installed the MacPorts, you should run the following commands to update your installed softwares:
sudo port selfupdate
sudo port upgrade outdated
Follow these steps, you should be able to use your MacPorts again in Mac OS X Mavericks!

Oct 7, 2013

[CentOS] SSH authorization file fail and solution.

I encountered a situation where after I've set up the rsa key on my server (.ssh/authorized_keys), the server still keep asking for password.

So I did a little search on Google and here is a perfect answer:
http://askubuntu.com/questions/110814/server-keeps-asking-for-password-after-ive-copied-my-ssh-public-key-to-authoriz

Solution:

  1. look at /var/log/secure (CentOS) for detail log and reasons.
  2. change .ssh/authorized_keys's permission to 600 (owner read/write only)