Tag Archives: macOS

How to Batch Delete PNG Screenshots in iPhoto

输入下列命令,替换其中的路径即可:

find /Volumes/Remote HD/Pictures/username/iPhoto Library/Masters/ -name '*.PNG' -type f

注意以上命令不会删除图片,只会将其显示,如需删除,需要在最后添加 -delete 选项,即:

find /Volumes/Remote HD/Pictures/username/iPhoto Library/Masters/ -name '*.PNG' -type f -delete

注意!此方法删除不可逆,图片不会进入垃圾桶,而是直接删除。另外此方法同样适用于「批量删除所有 MOV 视频」

Fix “The folder “Backups.backupdb” can’t be opened because you don’t have permission to see its contents.” Error

According to this site, you can simply use the following command:

sudo chmod -RN /path/to/your/backup/

But note that it may taks very long to remove all ACL attributes.

If the method mentioned above didn’t work, you may also try this one:

You could also invoke “Enter Time Machine” as root. That requires Finder to be started as root first, so only for those who understand the risks. In Terminal, for both Leopard and Snow Leopard:

sudo /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder

In Snow Leopard this does not (always?) open an initial Finder window. Do not click the Finder icon in the Dock (which might take you to your normal Finder), but use Command-Tab to go to Finder (which will be the new root-Finder). Here, hit Cmd-N for a new Finder window.

The new Finder looks like a normal Finder, but you’ll notice root next to the home folder icon in Finder’s sidebar. While the root-Finder is active, enter Time Machine (and once again validate that root is shown next to the home folder icon). This should allow you to browse, delete or restore what you need (but, for the original question: it won’t solve your access issues permanently).

(As usual, holding down Option while clicking the Time Machine icon will change “Enter Time Machine” into “Browse Other Time Machine Disks” if you need to examine a disk that is not associated to your current machine. You might not need to be running as root to do that though!)

When done, eject the Time Machine volume if applicable. Next, hit Ctrl-C in Terminal to stop the root-Finder. The usual Finder will still be running, but in Snow Leopard the indicator in the Dock may have gone. Run killal Finder if that bothers you. (And if you forgot to eject the Time Machine volume while you were still root and the disk doesn’t unmount properly at a later time, or if Time Machine won’t mount it correctly when running its hourly backup, then you may simply log off as an easy fix.)

(If anyone knows how to do this without first running a root-Finder then please tell us! Running sudo "/Applications/Time Machine.app/Contents/MacOS/Time Machine" does not give the expected result, and I assume that the Time Machine galaxy window is in fact part of Finder. For the sake of search engines: “run time machine as root”, “start time machine as root”.)

This method is tested and also works fine in Mountain Lion.

警惕 Mac App Store 上的 QQ for Mac 2.3.0 更新

此次 2.3.0 的更新有如下内容:

中文:

  1. 因为 apple 审核规则限制,我们取消了菜单栏的新建 qq 按钮,仅支持 command+n 快捷键新建 QQ.
  2. 新增文件盒子功能
  3. 新增请求与通知集成面板
  4. 传文件面板界面优化
  5. Retina 下截图支持尺寸选择
  6. 截图功能可独立使用
  7. 新增快速登录插件,支持快速登录腾讯服务
  8. 修复了提取消息卡顿的问题
  9. 修复了 Retina 下头像模糊的问题

「支持 command+n 快捷键新建 QQ」,是不是感觉很牛屄?「新增快速登录插件,支持快速登录腾讯服务」屌爆了有没有?第一次运行后,有如下提示:

当然是全部取消勾选,然后通过 CleanMyMac 2 的检测,我们发现有一个 QQ Login Item:

厉害的是系统中并没有这个:

通过查看 launchctl 的手册我们可以发现,一般开机运行有以下几处:

  • ~/Library/LaunchAgents Per-user agents provided by the user.
  • /Library/LaunchAgents Per-user agents provided by the administrator.
  • /Library/LaunchDaemons System wide daemons provided by the administrator.
  • /System/Library/LaunchAgents OS X Per-user agents.
  • /System/Library/LaunchDaemons OS X System wide daemons.

但在上述目录中完全找不到 QQ 的影子,我们也懒得一点点查了,总之很厉害有没有?

然后我们接着打开系统防火墙,发现了奇怪的东西:

QQPlatform.app 是什么?通过搜索 QQPlatform,我们发现这玩意好像并不是什么好东西,被 多个网站 定义为 Trojan.agent 和 Trojan-Downloader.agent 木马,具体那东西做了啥我们也懒得开 Charles 一点点抓了,总之把 conn 给 block 掉

另外值得一提的是之前提到的「新增快速登录插件,支持快速登录腾讯服务」,是需要去腾讯官网下载的,Sandbox 立功了:

经过以上分析,我们能得出以下结论:

  • 一定要开防火墙
  • OS X 上最好不要安装中国 app,随着 Mac 的越来越流行,国内的大老板们肯定会盯上这块肉
  • 有 Mac App Store 的版本不要用官网下载的版本
  • 如果必须要装,请不要在主力机上装,比如我们就装在 Mac mini with OS X Server 上,要用的时候通过 VNC 来使用

New Mac Checklist – mactips – Helpful configuration tips for OS X users

This checklist is mainly aimed at setting up a new Mac laptop, with OS X 10.8 (Mountain Lion) pre-installed. Some notes regarding modifications to this procedure for Mountain Lion desktops, or computers that have been upgraded to Mountain Lion from a previous version of OS X, are included. This procedure is what I do – you might find all, some, or none of it useful for your own particular requirements and preferences. The procedure for setting up an OS X 10.7 (Lion) computer is not substantially different.

via New Mac Checklist – mactips – Helpful configuration tips for OS X users.

Java SE 6 Locations

The location of the Java SE 6 runtime home has changed to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home. JDK bundles provided via the Developer package, developer previews, and 3rd party JVMs should be installed in /Library/Java/JavaVirtualMachines or ~/Library/Java/JavaVirtualMachines. Developer previews of Java can now be installed and uninstalled without affecting the system JVM(s).

Source