Recently in macosx Category

homebrew使用socks-proxy

| 2 Comments | No TrackBacks

国庆给MacMini加装了块SSD, 直接重装了系统,用Mac Homebrew安装各种GNU工具ing

托GFVV的福, 不但login.live.com和yahoo.com的SSL被MITM了, 连homebrew去sf.net和github.com下载源码都会被干扰SSL握手

迫不得已用proxy...

homebrew使用curl,  所以直接给curl加proxy就行了

curl --socks5-hostname 127.0.0.1:1080 ip.cn查看结果是linode日本了...

在~/.curlrc中设置 socks5 = "127.0.0.1:1080"就搞定了

参考链接:

Homebrew should not ignore curlrc

Use curl behind SOCKS5 proxy

MountainLion  (MacOS X 10.8.5)下拷贝了linux下的vim和vimrc, 启动vim报错

Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 565, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 547, in main
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 523, in get_config_var
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 419, in get_config_vars
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 298, in _init_posix
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)

这貌似是mountainlion的问题, 执行一下两行即可:

$ sudo mkdir -p /usr/include/python2.7
$ sudo ln -s /System/Library/Frameworks/Python.framework/Versions/Current/include/python2.7/pyconfig.h /usr/include/python2.7/pyconfig.h

参考: https://gist.github.com/3186381

MacOSX下清空dns缓存

| No Comments | No TrackBacks

MacOSX下清空DNS缓存: dscacheutil -flushcache

10.5之前貌似是lookupd, 但是10.5之后用dscacheutil替换了lookupd