顯示具有 MAC 標籤的文章。 顯示所有文章
顯示具有 MAC 標籤的文章。 顯示所有文章

星期四, 10月 20, 2011

Homebrew Update Error

出現以下訊息,應該是git有點問題。
From http://github.com/mxcl/homebrew
* branch master -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
share/man/man1/brew.1
Library/Homebrew/formula_installer.rb
Library/Formula/xpdf.rb
Library/Formula/wine.rb
Library/Formula/webalizer.rb
Library/Formula/tofrodos.rb
Library/Formula/ssldump.rb
Library/Formula/squirrel.rb
Library/Formula/sphinx.rb
Library/Formula/sleepnow.rb
Library/Formula/skipfish.rb
Library/Formula/schroedinger.rb
Library/Formula/rebar.rb
Library/Formula/rabbitmq.rb
Library/Formula/qdbm.rb
Library/Formula/pure.rb
Library/Formula/pkg-config.rb
Library/Formula/parallel.rb
Library/Formula/openvpn.rb
Library/Formula/mcl.rb
Library/Formula/lilypond.rb
Library/Formula/libvirt.rb
Library/Formula/libsamplerate.rb
Library/Formula/libao.rb
Library/Formula/ledit.rb
Library/Formula/jack.rb
Library/Formula/gst-plugins-good.rb
Library/Formula/geeqie.rb
Library/Formula/freealut.rb
Library/Formula/fontforge.rb
Library/Formula/ddclient.rb
Library/Formula/ddate.rb
Library/Formula/d-bus.rb
Library/Formula/cscope.rb
Library/Formula/cppdom.rb
Library/Formula/celt.rb
Library/Formula/cd-discid.rb
Library/Formula/cairomm.rb
Library/Formula/bsdiff.rb
Library/Contributions/manpages/brew.1.md
Library/Contributions/examples/brew-audit.rb
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
Library/Formula/zookeeper.rb
Library/Formula/zdelta.rb
Library/Formula/vip.rb
Library/Formula/vcodex.rb
Library/Formula/sshfs-fuse.rb
Library/Formula/nickle.rb
Library/Formula/isc-dhcp.rb
Library/Formula/gst-plugins-ugly.rb
Library/Formula/gst-plugins-bad.rb
Library/Formula/go-gui.rb
Library/Formula/fluxus.rb
Library/Formula/exodriver.rb
Library/Formula/djvulibre.rb
Library/Formula/cdrdao.rb
Library/Formula/c10t.rb
Library/Formula/blahtexml.rb
Library/Formula/bigloo.rb
Library/Formula/aws-iam-tools.rb
Library/Formula/aget.rb
Library/Aliases/sshfs
Library/Aliases/liblabjackusb
Please move or remove them before you can merge.
Updating 959edff..6cf7c80
Aborting
Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master

Google一下後,成功解決,做個記錄。
$sudo chown -R `whoami` /usr/local
$cd /usr/local
$git add .
$git stash
$git reset --hard
$brew update

星期四, 6月 09, 2011

pkg_resources.DistributionNotFound: pip==0.8.2

今天pip突然怪怪的,出現下列訊息:
cacaegg:~ cacaegg$ pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in
from pkg_resources import load_entry_point
File "build/bdist.macosx-10.3-fat/egg/pkg_resources.py", line 2607, in
File "build/bdist.macosx-10.3-fat/egg/pkg_resources.py", line 565, in resolve
pkg_resources.DistributionNotFound: pip==0.8.2
所以就看一下:
cacaegg:~ cacaegg$ cat /usr/local/bin/pip
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==0.8.2','console_scripts','pip'
__requires__ = 'pip==0.8.3'
import sys
from pkg_resources import load_entry_point

sys.exit(
load_entry_point('pip==0.8.3', 'console_scripts', 'pip')()
)
都改成0.8.3就可以了。

星期二, 3月 15, 2011

Mac OS 安裝MySQL-Python

前幾天升級到Python2.6.6時候原本正常的MySQLdb突然出現如下訊息
$ python -c 'import MySQLdb'
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py", line 19, in
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/_mysql.so, 2): Symbol not found: _mysql_affected_rows
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/_mysql.so
Expected in: dynamic lookup

花了整晚時間東找patch西找版本,真是難搞...

最後想不到去把mysql重新安裝成universal就輕鬆解決了。

pip uninstall MySQL-python
brew uninstall mysql
brew install mysql --universal
pip install MySQL-python

參考

星期四, 9月 16, 2010

execl vs excvp

These two will search for prog on current PATH
execlp(prog, arg0, arg1, arg2, ...)
execvp(prog, argList)

簡單說
execvp可以傳argument list,而exclp卻需要把參數一個一個傳進去。

Mac terminal cursor hot key

Below test in the bash shell.

back to the begin of current command: ctrl + a
go to the end of current command: ctrl + e
back one word : esc + b
forward one word : esc + f

Format usb under mac os x in command line

This is the command:

$ diskutil eraseVolume MS-DOS COOKIES /Volumes/COOKIES

eraseVolume filesystem name device

會讓usb變成fat32的fs

星期五, 9月 10, 2010

Kismac -- Mac OS X 上的無線探測工具

除了Wireshark以外,MAC上還有這套頗好用的工具。

雖然此工具和Kismet沒有關係,但此工具提供不少不錯的功能:

1. 簡單明瞭的GUI
2. 支援GPS
3. Crack of some protocol
在選單下,收集足夠的packet以後就可以進行crack WEP, LEAP。
4. de-authentication attack
5. 可以在MAC下進行rfmon mode (不用和任何AP associate即可sniffing traffic)

星期二, 7月 20, 2010

MAC 下的三種套件管理

目前比較多人使用的分別為homebrew, fink, macport

來記錄一下。

homebrew:
個人覺得最好的,因為會盡量使用系統中的程式,而非像其他兩種都各自用自己的,
減少了許多重複安裝的麻煩。

fink:
通常安裝好後的位置都放在/sw中,如果之後要移除直接把/sw刪除就好了。

macport:
安裝好的會在/opt/local裡面。

想要的軟體通常這三個裡面就會有收集了!