Laman

New

a

Tampilkan postingan dengan label mac. Tampilkan semua postingan
Tampilkan postingan dengan label mac. Tampilkan semua postingan

Jumat

install gevent on mac os

This post is for Mac users in China who wants to fuck the gfw.
The goagent has been rewritten based on gevent. Though it still supported to run without gevent, it's recommended to install gevent.
It's pretty easy to install gevent on mac os with brew and pip tools.
  1. brew install libevent
  2. sudo pip install gevent greenlet

Senin

repair mac login failure due to invalid home directory

My macbook failed to start and gave me "the password you entered is invalid" on login. It happened after my user directory is changed.
By default, mac system saves a user's personal data in /Users/user_name directory. In order to make the system easier to maintain and keep my personal data separated from system data. I created two partitions during installation. One partition is used for system installation, and the second partition is used as my home directory.
To do this, after the mac has been successfully, I copied all data from original /Users/user_name directory to /Volumes/user/user_name directory. Then I remove /Users/user_name directory, and created a soft symbol link /Users/user_name pointing to /Volumes/user/user_name. Everything work perfectly.
The problem occurred after I considered the /Volumes/user directory a poor name and changed it to a better one, /Volumes/idiot. After I restarted the machine and found I can't log into the system. Mac simply complained about my password wasn't correct, though I'm pretty sure it's correct.
The reason is I forgot to change /Users/user_name symbol link to correct place. I guess mac stores my credential in my home directory. So if this directory isn't accessible, all my login attempts failed.
To repair this, I tried mounting the mac hard disk on a ubuntu box and changing the symbol link. But due to the file system (HFS, Hierarchical File System) is journaled, it's read-only on ubuntu.
I finally found another mac machine and changed the symbol link correctly. In case I may encounter this problem again, I used "sudo diskutil disableJournal /Volumes/user" command to turn off jorunaling on the file system so that it'll be writable under ubuntu. The cost is the mac may take much longer time to scan file system if not shutting down properly. It deserves, at least I can log into the system.

References:
Repair / Fix Mac HFS+ partition using Ubuntu CD
How to Move the Home Folder in OS X – and Why

Sabtu

install ipython and readline on mac

ipython is a powerful interactive shell for python. With it, we can tak advantage of python programming language in our daily works.
One of ipython's power is its tab-completion feature that needs readline to work. On mac system, it lacks this library due to license issue. There is a proprietary version of readline in mac, but it doesn't work with ipython.
To install them on mac system, we can simply use easy_install utility, like this:
sudo easy_install ipython readline