Author: Samuel Ye

  • add route and dns for VPN connection in Mac

    VPN now becomes a ubiquitous way for climbing over GFW in China. However, once the Mac is connected with VPN and sends traffic thru it , VPN’s dns and route setting will take priority over the default network settings, which sometimes is quite inconvenient for fast accessing local sites and using other dedicated network like ipv6.…

  • Fix TimeMachine on Buffalo LS-CHLv1

    Since Lion, the TimeMachine support on the Buffalo LinkStation LS-CHL v1.0 was broken because the new Netatalk protocol is now used in Lion TimeMachine backup process which is not compatible with the old NAS firmware’s atalk version. With such a long time passing, Buffalo only updates a few products’ firmware (including LS-CHL v2.0) to support…

  • sunpinyin compile problem in Lion 10.7

    Just encounter some build problem in 10.7 with latest sunpinyin git: 1)when compiling xib there’s a warning says TableViewColumns identifier expects NSString in 10.7, it could be fixed by manually set the TableViewColumn’s identifier to a string in Interface Builder. And note: manually set the english version xib, the zh_CN version will be auto generated…

  • Fix QSB Freeze with Lion

    Google Quick Search Box will freeze in OS X Lion and alloc huge memory if you input long words in search box. Only forcing to kill the QSB process could free up the memory, which makes QSB almost unusable in Lion. After a few trials and thoughts, I found that the issue seems related to…

  • Lion Upgrade Issues

    Missing ~/Library folder in Finder: Use “chflags nohidden ~/Library” in terminal to show it back QSB huge memory alloc bug for more than 4 words input: NO FIX yet, disable spotlight plugin to work around XCode 4.1 launch crash: install standalone iTunes 10.4 after install XCode 4.1 3 finger swipe crash chrome/terminal/…: remove AirKeysInputManager.bundle from…

  • fix adium spotlight log search

    For Adium 1.4.2, the chat transcript log doesn’t appear in spotlight search result even though the word is exactly in the chat logs. Yeah, it’s no big deal, but a bit annoyance, especially when Adium’s own transcript search won’t return good results. After some research, a few tryouts were taken: Using mdimport to force spotlight…

  • QSB 2.0.3789 services plugin

    It’s quite sad that QSB (Google Quick Search Box) doesn’t update anymore, according to this thread, it goes to maintain mode. QSB is quite intuitive and allows mutlibyte/unicode text input that Quick Silver lacks, and if you have the services plugin to utilize OSX’s services, you can almost do anything with QSB in Mac like with…

  • Rar archive in mac finder with automator

    用Mac的一个重要麻烦就是zip archive经常在windows下乱码,由于mac采用unicode编码,中文文件名zip压缩文件之后,在采用ansi编码格式的windows上就是乱码,往往无法解压还原。用stuffit,finder自带的压缩,都避免不了这个问题。 但rar文件就没有乱码问题,用betterzip之类的就可以归档rar文件,但大多需要打开betterzip程序,再选择文件等,多了好几个步骤,如何能在finder里选择目标文件直接生成rar文件?当然可以,用mac著名的automator! 在automator里,选择Service服务类型,选择接受文件和目录,然后拖进执行shell脚本,选择输入自变量,然后在脚本内容里输入: #!/bin/bash for f in “$@” do pp=`dirname “$f”` ff=`basename “$f”` cd “$pp” /usr/local/bin/rar a -m5 -ep1 -o+ Archive.rar “$ff” done 保存为建立rar的工作流服务,这样在finder选择多个文件或目录后,右键选择服务里直接可以把目标文件生成rar归档文件了。

  • wildcard dns for ipv6

    ipv6目前是比较方便易用的绕墙的方法,但往往hosts文件里塞满了一大堆静态v6地址,而且不支持通配符,很难维护。 推荐使用dnsmasq,在loopback interface上绑定监听一个dns服务,既支持本地通配符的匹配解析,也可连接上游upstream dns服务器,提高dns解析速度,同时也完美支持ipv6的域名解析。 mac可通过macports: sudo port install dnsmasq, sudo port load/unload dnsmasq

  • upgrade mbp ssd into optical bay

    买了个intel x25m 160G ssd升级一下macbook pro笔记本,没想到花了三四天。 首先想要修改一下ssd参数,但mac上不支持hdparm,光驱又不认盘,想通过usb启动,但结论是:基本不可能在mbp上从usb启动linux的。装了refit,能认出linux usb启动盘,但boot不了。不用refit,直接用grub-efi,option启动可以看到grub菜单,但同样boot错误。试了很多live方案,ubuntu, gparted, 甚至dos的hdat2没一个成功。最终放弃。在朋友的机器上接上ssd,用gparted启动,hdparm修改ssd的max size,因为intel号称减少size可以提升ssd硬盘性能和寿命,即over-provisioning,可结果mac上认出来的硬盘还是原来标称大小。 另外还需要确认买的硬盘盒托架能装进光驱那个位置,淘宝上买的托架,结果发货发错了,下端没有2个拧螺丝的脚,而是一个类似ibm笔记本材质的斜面,等花了好大力气拆下光驱结果没能装上托架,只好重新恢复原状,再联系重发货。其中,拆光驱一开始还比较麻烦,其实camera线不用拆下来,只要把边缘那个锁扣螺丝拧松,把固定线的胶水剥离,然后把SATA接口卡拨开,3个螺丝拧掉,左右动动,就可以拆下superdrive光驱。 好不容易正确的托架来了,发现原来的硬盘边缘的固定位置的螺丝拧不下来。这还有个复杂的背景:需要把ssd装在原先hdd硬盘的位置,而hdd则应放入托架里。这样snow leopard才可以正常休眠hibernate,否则会醒不过来,因为系统不会去第二个硬盘口唤醒,当然普通sleep是保存在内存中没此问题,但是总归不爽。于是,专门去市场买了梅花螺丝刀,才算ssd/hdd互换成功。 然后通过usb雪豹安装盘(可以option启动),重装系统,因为time machine备份太大超过ssd容量,恢复不了,只有通过Migration Assistant来做。由于空间限制问题,所以音乐/电影/文档都没有migrate。不过mac这个迁移的确很好用,基本所有的设置都原样恢复,非常给力。当然映射文件目录,权限设置等等又花了好几个小时,才算基本无缝切换到ssd。 目前ssd是系统盘,启动/应用为主,hdd则作为文件存储,邮件、音乐、电影、虚拟机都在这个上。系统启动基本10秒中,应用启动基本1-2秒,总算没有白花那么多时间。 update: 迁移后,facetime可以启动,但登录不了。帐号和密码都没问题,就老是报一个“服务器在处理注册过程中发生错误,稍后再试”的错误,查了大半天,发觉在keychain里把一个GUID名字的证书和下面的client push certificate给删了就好了,估计和迁移后的身份或权限不一致有关,删除后会自动重建,所以也不用备份。 update2: 出于保护ssd寿命,把swap file切换到原来硬盘上,可以参考superuser的这个帖子,另外还可以参考这个把swap文件大小改大点。貌似虚拟机vmware fusion 3.1以上运行时间长了会持续占用内存,很多人都降回3.0版,正在犹豫中。 update3: 10.6.7雪豹可以支持Trim了!访问http://forums.macrumors.com/showthread.php?t=1125400,下载enabler,运行一下再重启即可,系统信息显示支持Trim了。看上贴里评论性能的确有一定提升,估计是真的支持了。