手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表2024年09月的文章

转:Tiger: Disabling Spotlight

嗯,到现在为止,我也没有办法搜索我的电脑、mail、甚至 spotlight,真是纠结。
于是这篇disabing spotlight就成了我搜索中的目标。我想,既然能够disable spotlight,那肯定能够enable吧?
所以,上原文吧:http://www.theconsultant.net/2005/06/tiger-disabling-spotlight/

Spotlight introduces a fairely large performance hit on to the system, especially if the files you are working with are both large and have the Spotlight plugin, and thus can be indexed. Performance hit might be less noticable on the desktop system with fast drives, however on my laptop with 4200 rpm drive, and constantly dealing with megabytes of source code and compilations spotlight introduced less of a benefit and more of a hindrance.

So, without further ado, in order to disable spotlight, one has to edit /private/etc/hostconfig, find the line that reads SPOTLIGHT=-YES-, change it to SPOTLIGHT=-NO-, and rebooot.

This will prevent MetaData Service, / System / Library / Frameworks / CoreServices.framework / Versions / A / Frameworks / Metadata.framework / Versions / A / Support / mds from starting on boot time.

Note that this will not disable file change notifications in the kernel, as can be checked using Amit Singh’s fslogger. On the same page there is some more in depth information on the kernel notification service that Spotlight (and fslogger) subscribe to.

A perty GUI called Spotless was written by someone, but I am not sure I’d trust a GUI to parse and edit a text file.

If you want to get rid of the looking glass icon in the top right hand corner as well, you might want to either remove (perferably just move out of place) or chmod -R 0000 /System/Library/CoreServices/Search.bundle (Key file. Actual parts of Spotlight are: /Library/Spotlight /System/Library/Spotlight /System/Library/CoreServices/Search.bundle /System/Library/PreferencePanes/Spotlight.prefPane /System/Library/Services/Spotlight.service /System/Library/Contextual Menu Items/SpotlightCM.plugin /System/Library/StartupItems/Metadata plus /usr/bin/md*, although I’d argue that metadata tools in /usr/bin/md* are actually useful.)
Changing permissions means that if at some point you want to undo the changes, you can always repair permissions. In any case, little looking glass in the corner doesn’t bother me much.

Technically one can probably selectively start and stop Spotlight by killing or startng mds and mdimport, however a way Apple recommends is using mdutil -i off / to turn off indexing of the boot volume (ie existing databases would be preserved and accessible through spotlight).

If you ever want to blow away your Spotlight database, and force reindexing (assuming mds/mdimport run), you can do mdutil -i off /, mdutil -E / , mdutil -i on /

Note: Apprently killing spotlight interferes with find in Finder and in Mail.app. As I never use either (locate or find . -name “*foo*” -print on the command line is much more powerful, plus gives me an -exec stuff {} \; option), it doesn’t bother me, however ocdinsomniac has some nice additional information and a script that purports reverting Finder’s find to the Panther style behavior.

Tags: spotlight

纠结:mac居然不能使用搜索功能了

不知道从什么时候起,我的macosx系统居然不能搜索了。
Finder中无法找文件
邮件中无法搜索邮件(只能根据发件人的详细地址来筛选)
Spotlight中也无法搜索了。

真纠结啊,不知道是哪里的设置出了问题。NND,望知情者给条生路啊

Tags: macosx, 搜索

SecureCRT for MAC 破解

之前说过securecrt的破解,说是一直删除/Users/xxx/Library/......下面的lic文件就可以了。但自从换到了6.7.3之后,该功能就无效了。所以在网上找了一些破解。
嗯,QQ微博里素包子说他破解了。但我没看到,我找到了pcbeta的文章,就是这一篇啦 ,作者如是说:
2011.11.20 再次更新
下载之前版本补丁的重新下载试试。已经解决注册的问题。

2011.11.19更新
更新解决patch后无法注册的问题。
原版备份下载地址http://115.com/file/aq5ymxbb
由于ipatch bug,在打补丁前需要手动在终端执行以下命令:
sudo chmod -R 777 /Applications/SecureCRT.app/Contents/MacOS


注:patch后需要使用补丁中的注册信息进行注册。方法为点 enter licenseXXXX,在弹出的界面直接选 continue。到了报错界面,左下角会有一个 “Enter License Manually",点击进去后进行注册。

嗯,在之后,得输入以下的注册码:
使用如下的注册信息手工注册:
Name:suddy
Company:suddy
Serial:03-67-009054
Date:11-19-2011
LicenseKey:ACUYJV Q1V2QU 1YWRCN NBYCYK AAXBZT CMJS8Z KBFYR7 QXJE45
--------
具体页面还是看:http://mac.pcbeta.com/thread-79412-1-1.html
记住,这个patch还是需要和官方的版本是一样的,即,版本号是[Mac OS X 6.7.3(build 292)
--------
注意,用了这个patch后,你会发现,居然密码不能保存了,怎么办怎么办?
嗯,微博上看到素包子说:把keychain禁用就OK了。于是乎,就搞定了
如何禁用:
在全局设置(GLobal Options)->Terminal->Advanced-> 看到右侧的Mac Options了没?把Use Keychain前的勾去掉就OK了。good luck

Tags: securecrt

【科普贴】话说回车和换行

有意思的文章,大多数时候,我们都是知道\r,\n,\r\n,但为什么是这样的呢,居然找到了一篇科普贴。
来吧,看看为什么吧。
原文来自:【科普贴】话说回车和换行
看xml的时候发现这样的一段话:

XML 以 LF 存储换行

在 Windows 应用程序中,换行通常以一对字符来存储:回车符 (CR) 和换行符 (LF)。这对字符与打字机设置新行的动作有相似之处。在 Unix 应用程序中,新行以 LF 字符存储。而 Macintosh 应用程序使用 CR 来存储新行。

让我对这三个(win,unix,mac)苦逼的主产生了兴趣,为啥你们不一样呢,难道你们认识“回车”和“换行”的时间有先有后吗?为啥没统一或者说为啥产生了CR和LF这两个玩意?说说历史吧!

为什么会有两个貌似一样功能的东西?

潜台词:很多时候敲击enter就是换行了呀,还回啥个车,回车就是换行吗?

在计算机还没有出现之前,有一种叫做电传打字机(Teletype Model 33)的玩意,每秒钟可以打10个字符。但是它有一个问题,就是打完一行换行的时候,要用去0.2秒,正好可以打两个字符。要是在这0.2秒里面,又有新的字符传过来,那么这个字符将丢失。

于是,研制人员想了个办法解决这个问题,就是在每行后面加两个表示结束的字符。一个叫做"回车",告诉打字机把打印头定位在左边界;另一个叫做"换行",告诉打字机把纸向下移一行。

-http://www.ruanyifeng.com/blog/2006/04/post_213.html

 

为啥windows,unix,mac不统一呢?

可能是基于成本和效率的考虑,我认为都统一成一个“回车”就够了,可是当年正是这种想法导致了现在的问题,至于这三家互不相同,我也不知道,各有各的考虑吧,反正蛋疼的是用户,比起现在浏览器的兼容性问题,这算不上问题。

以下是他们表示“下一行”的方式:

    OS          表示                              C语言表示    16进制表示

    windows  回车+换行(CR/LF)        \r\n             0x0d0a

    UNIX       换行符(LF)                   \n               0x0a

    MAC        回车符(CR)                   \r               0x0d

 

看一下在一份xml文件里的情况吧,我没钱买苹果,所以下面不包括MAC OS,果粉别砍我!

抱怨之余,我们还能干啥呢?

至少你知道这是怎么回事了,至少在不同平台之间传送文件时别傻傻的骂别人没整理文件格式,至少...,这还不够吗?

-------------
在用PHP写文件的时候,一般我们都是用\n来解决断行。但这时候,如果用windows下的记事本打开这个文件,你会发现一堆黑框,并且处在一行里。
因此,看了上面的文章后,你会知道怎么办了。突然想到以前的str_replace(array("\r\n","\r","\n"),"<br />",$str), 这种烂代码。当然nl2br就解决这样的功能了。然后再转回来?哎。纠结啊。。

Tags: 回车, 换行, windows, linux, mac

PhpStorm 3.0 released!

一大早就收到这封邮件,灰常开心。
因为在2.x的时候用的就是它,而且,除了代码格式化外(数组这一块的格式化非常不友好),其它我都非常满意。当然也可能是我没有把netbeans的所有能力都发挥出来吧,先看邮件:
PhpStorm 3.0 is now available and introduces the Smart Duplicated Code Detector to help you quickly find similar blocks through your entire code base and securely get rid of them without losing the intended functionality.
Also a new integrated UML tool allows you to quickly get a bird’s-eye-view of your project structure, or even a semantic view of the changes in the recent VCS commits made by your colleagues.
Furthermore, to ensure that your code works fast and doesn’t cause any performance bottlenecks, the IDE now includes a profiler, a new PHPUnit test runner and JSTestDriver.

The new key functionality in PhpStorm 3.0 includes:
- Smart Duplicated Code Detector
- PHP UML roundtrip diagrams
- Profiling results browser for Xdebug and Zend Debugger engines
- PhpUnit 3.6 integration
- CoffeeScript support
- Significant improvements to FTP/SFTP Sync
- TFS support and revision graph for GIT
- Streamlined UI across all operating systems

HOHO,看到没,居然PHP UML roundtrip diagrams,但其实在EAP版的时候,我试过,其实并没有想象中的那么完善,将就着能用用而且。 ftp/sftp 同步还没有试过。。什么时候试用下

Tags: phpstorm, release