Author: Error-Prone

  • How to Move Plex Media Cache to External Hard Drive

    $ cp -pr ~/Library/Application\ Support/Plex\ Media\ Server/Media /Volumes/Backups\ HD/Temporary\ Files/Plex\ Media\ Cache 
    
    $ ln -s /Volumes/Backups\ HD/Temporary\ Files/Plex\ Media\ Cache/Media ~/Library/Application\ Support/Plex\ Media\ Server/Media
    

    Platform: OS X

  • How to Upgrade MaxMind Location Database for Mint Pepper Location+

    I just got the answer from the author’s email reply, thank you, Till:

    $ wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
    $ gunzip GeoLiteCity.dat.gz
    $ mv GeoLiteCity.dat database.dat
    

    Or you can just use this script to convert a CSV to DAT format

  • Export Website RSA Private Key for Apache Server Certificate from OS X Server

    If you’re using OS X Server and MAMP Pro at the same time, and you’d like to export OS X site certificates to use them for MAMP Pro sites, you can do the following:

    • Locate certificate (Category -> Certificates)
    • control + click -> Export… -> Certificate.p12

    Next, I need to split the PKCS12 archive, to get the old private key out:

    $ openssl pkcs12 -in site.p12 -nocerts -out site.key
    

    Remove passphrase from the key (otherwise you have to enter it lots when you restart services.)

    $ openssl rsa -in site.key -out site.unprotected.key
    

    Read more: Renewing a SSL Certificate on OSX Server

  • Fix RubyGems Postinstall Error

    gem pristine --all --only-executables
    
  • How to Generate SSL Certificate Chain for Nginx

    I’m using Comodo Certificate, you will get these files from their email:

    • Root CA Certificate – AddTrustExternalCARoot.crt
    • Intermediate CA Certificate – UTNAddTrustSGCCA.crt
    • Intermediate CA Certificate – ComodoUTNSGCCA.crt
    • Intermediate CA Certificate – EssentialSSLCA_2.crt
    • Your EssentialSSL Certificate – www_example_com.crt

    Correct order:

    1. Your EssentialSSL Certificate – www_example_com.crt
    2. Intermediate CA Certificate – EssentialSSLCA_2.crt
    3. Intermediate CA Certificate – ComodoUTNSGCCA.crt
    4. Intermediate CA Certificate – UTNAddTrustSGCCA.crt
    5. Root CA Certificate – AddTrustExternalCARoot.crt

    You can create a chained certificate required by Nginx:

    cat www_example_com.crt EssentialSSLCA_2.crt ComodoUTNSGCCA.crt UTNAddTrustSGCCA.crt AddTrustExternalCARoot.crt > example.com.chained.crt

    In fact, you can only need the first three certificates: most systems have their root CA.

    cat www_example_com.crt EssentialSSLCA_2.crt ComodoUTNSGCCA.crt  > example.com.chained.crt

    Update Mar 21, 2015:

    Comodo updated their certificates filename, so the correct order now is:

    1. Your EssentialSSL Certificate – www_example_com.crt
    2. Intermediate CA Certificate – COMODORSADomainValidationSecureServerCA.crt
    3. Intermediate CA Certificate – COMODORSAAddTrustCA.crt
    4. Root CA Certificate – AddTrustExternalCARoot.crt
    cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt > example.com.chained.crt
  • How to Cleanup Systems w/o CleanMyMac (a.k.a. OS X Cleanup Guide)

    Here’re some folders you should check if you want to cleanup your Mac, all the following folders are also frequently scanned by CleanMyMac. Check and remember these then you won’t need CleanMyMac anymore.

    Cache Files

    All cache files can be deleted, but there’s no need to remove them too often, Homebrew uses the system cache folder to cache libraries.

    /Library/Caches/
    ~/Library/Caches/
    

    Logs

    All logs can be deleted safely.

    /Library/Logs/
    ~/Library/Logs/
    

    Internet Plugins

    Some of them are default from OS X. Check the bundle .plist to see if they’re shipped by default. In most cases, your user plugins folder shouldn’t be existed, most of them in this folder can be safely removed. AdobeAAMDetect.plugin is stored in system plugins forder.

    /Library/Internet Plug-Ins/
    ~/Library/Internet Plug-Ins/
    

    Launch Agents

    All files in these folders are safe to delete. I have com.adobe.AAM.Updater-1.0.plist and com.adobe.AdobeCreativeCloud.plist stored in the system launch agents folder, they can be safely deleted.

    /Library/LaunchAgents/
    ~/Library/LaunchAgents/
    

    Launch Daemons

    Some apps stored their daemons app here, such as Clean My Mac and Textmate. They’re safe to delete. There’s no user launch daemons folder by default.

    /Library/LaunchDaemons
    

    Privileged Helper Tools

    Some apps uses privileged helpers to gain more access across different users from your Mac. For example I have com.macpaw.CleanMyMac2.Agent and com.macromates.auth_server in the following folder.

    /Library/PrivilegedHelperTools
    

    QuickLook Plugins

    There’re two default plugins related to iBooks Author and iWork in system QuickLook folder, my user QuickLook folder is empty.

    /Library/QuickLook/
    ~/Library/QuickLook/
    

    Spotlight Plugins

    There’re iBooks Author and iWork plugins, too, plus a Microsoft Office Spotlight plugin shipped with OS X (10.9). My user Spotlight folder is empty.

    /Library/Spotlight/
    ~/Library/Spotlight/
    
  • Hama (HTTP Anidb Metadata Agent) and Plex Media Server

    最近發現一個比 AniDB agent 還好用的 Plex agent:Hama (HTTP Anidb Metadata Agent),效果非常不錯,支持 AniDB 和 TVDB 抓取 banner 、 background 、 theme song,可以更好的識別日文文件夾的結構,更新後再也不用在 Plex 里看羅馬音了

  • Protected: Untitled

    This content is password protected. To view it please enter your password below:

  • Hello world!

    Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

  • How to Configure Multiple DNS Redirections (PlexConnect-like Service) for Apple TV

    目標

    • Apple TV 通過修改 DNS,可以觀看 享看
    • 同時也可以通過本地架設 Plex+PlexConnect 來觀看 Plex

    難點

    • 「享看」官方的 DNS 和 PlexConnect 都默認劫持 Apple TV 中的 Trailers 頻道,同時使用會造成衝突
    • OS X Server 在 Mavericks 中對 HTTP 的 80 端口享有絕對控制權,而 PlexConnect 需要獨佔 80 端口

    實現方法

    • 在 OS X Server 上安裝 Plex 、 PlexConnect 和 Dnsmasq
    • 通過在 OS X Server 上創建新介面,設置額外 IP,避免 PlexConnect 80 端口衝突
    • 本地架設 Dnsmasq,同時劫持 Apple TV 上兩個不同頻道來實現「享看」和 PlexConnect 共存

    配料表

    • 裝有 OS X 的電腦一部
    • Apple TV 一部
    • Plex 一只
    • PlexConnect 一只
    • Dnsmasq 一只

    網絡基本結構設置

    • 10.0.1.3:OS X Server,DHCP with manual address(或通過 MAC 地址綁定亦可,主要是需要保持主 IP 固定)
    • 10.0.1.4:OS X Server,額外 IP(PlexConnect),DHCP with manual address

    為 OS X Server 設置額外 IP

    由於 OS X 上已經安裝過 Server app,為了避免與系統的 80 端口衝突,我們必須將 PlexConnect 的 80 端口指向額外的 IP 。首先我們 duplicate 現有的網絡(或者直接創建新介面),Wi-Fi 、以太均可,為了區分,可以將此服務命名為「PlexConnect」,IP 獲取方法為 DHCP with manual address,地址為 10.0.1.4(具體情況請根據自己的路由分配狀況自行修改),然後將 DNS 設置為 10.0.1.3,即 Dnsmasq 所在的主 IP,Dnsmasq 的相關設置我們會在接下來講,其他設置保持默認

    Dnsmasq 安裝與配置

    推薦的方法是通過 Homebrew 安裝:

    brew install dnsmasq
    

    哦?想自己編譯源代碼安裝?那請跳過此步驟

    然後我們需要 vi /usr/local/etc/dnsmasq.conf 來修改 Dnsmasq 的配置,Dnsmasq 的默認配置是無法作為 DNS server 使用的,以下是必備的配置:

    https://gist.github.com/9fea03b8e6349ab3c805

    • port=53:DNS 默認端口,這裡我們需要禁用 Server app 里的 DNS
    • domain-needed:不轉發 plain name
    • bogus-priv:不轉發本地的 nslookup 請求
    • server=8.8.8.8server=8.8.4.4:使用 Google 的 DNS 作為主、從 DNS,當然也可以選擇 ISP 提供的
    • local=/localnet/:讓本地域名走 /etc/hosts 或者 DHCP
    • address=/trailers.apple.com/180.153.225.136:享看 DNS,劫持 Apple TV 中的 Trailers,具體的 IP 地址請去享看官網參考
    • address=/secure.marketwatch.com/10.0.1.4:PlexConnect DNS,劫持的是 WSJ,指向的是本地的 PlexConnect instance
    • listen-address:限制 Dnsmasq listen 指定地址,當然也可以按 interface 來限制

    以上就是本教程的技巧所在,運用 Dnsmasq 對不同域名進行劫持,來實現「享看」和 PlexConnect 的共存,通過下面的方法可以測試是否設置正確:

    dig trailers.apple.com @10.0.1.3
    dig secure.marketwatch.com @10.0.1.3
    

    執行下面命令可以啓動、停止 Dnsmasq

    sudo launchctl stop homebrew.mxcl.dnsmasq
    sudo launchctl start homebrew.mxcl.dnsmasq
    

    PlexConnect 的安裝與配置

    PlexConnect 官方提供有 詳細的教程,具體請參考官方的方法。在這裡我只對配置文件做詳細描述:

    配置方面,為了避免與 Server app 的 httpd 衝突,我們要將 PlexConnect 的 server 綁定到之前設置的 10.0.1.4 上,另外我們也自己搭建了 Dnsmasq,需要把 PlexConnect 自帶的 DNS 服務禁用,於是我們的 PlexConnect 配置如下:

    https://gist.github.com/cb1e7dee359fe3d9b8a1

    以下是必備的設置:

    • enable_plexconnect_autodetect = False:因為我們有多 IP,避免造成混亂,我們把 Plex server 的 auto detect 禁用掉
    • ip_pms = 10.0.1.3:既然禁用了,我就需要指定 Plex 的 IP
    • port_pms = 32400:相應的端口,我是用的默認端口
    • ip_plexconnect = 10.0.1.4:指定 PlexConnect 的 IP 地址,這裡用我們創建的新 IP
    • enable_dnsserver = False:這裡禁用自帶 DNS
    • ip_dnsmaster = 10.0.1.3:使用我們自己的 Dnsmasq
    • hosttointercept = secure.marketwatch.com:設置要劫持的域名,這裡要與 Dnsmasq 中的設置保持一致

    測試

    當以上都設置好後,確認 Dnsmasq 、 PlexConnect 均已運行,在瀏覽器中打開 http://10.0.1.3/,應該可以返回 httpd 的網站;打開 http://10.0.1.4/ 則是返回「Error response」,一個 code 403 的頁面,這時就是配置正確了

    Apple TV 證書設置

    測試都沒甚麼問題後,可以開始搞 Apple TV 的證書了,Apple TV 從某一版本更新後,所有的連接都走 HTTPS 了,這時候我們如果直接劫持就不會奏效,於是我們需要使用自己的證書並上傳到 Apple TV,讓 Apple TV 認為我們的劫持的內容才是真正的網站內容

    設置方法比較簡單,可以通過 USB 線與 Apple TV 連接傳輸,也可以通過直接在 Apple TV 中直接添加,具體方法請參考 PlexConnect 文檔,需要注意的是,因為我們劫持了兩個頻道,所以兩個頻道的證書都需要進行 hack 並通過 profile 上傳到 Apple TV 中

    證書設置好了,接下來就可以在 Apple TV 上進行測試了,將 Apple TV 的 DNS 改為 10.0.1.3,然後回到主屏分別進入 Trailers 和 WSJ 測試即可

    更多設置

    • 你可以設置讓 Dnsmasq 開機時自動加載,設置方法可以參考 brew info dnsmasq
    • 你也可以設置讓 PlexConnect 開機是自動加載,設置方法請參考 官方文檔
    • 如果你也有使用 Server app 自帶的 DNS,可以有多種方案,一是全轉移到 Dnsmasq(推薦);或者保持 nameddnsmasq 共存,但這時需要設置 named 只監聽 10.0.1.3;再或者全部轉移到自帶 DNS 服務,如果是後兩者,這篇文章 可能會幫到你
    • 如果你 Server app 中的 httpd 沒跑任何服務,也可以通過 配置反向代理 來將系統的 web 服務轉向 PlexConnect 的內容
  • iOS: How to Un-trust a Computer

    You can simply delete all files under /var/db/lockdown

    Source: iTunes: How to reset the Lockdown folder

  • FlexGet + Transmission + Plex AniDB Agent on macOS

    目標

    • 自動下載新番種子
    • 種子自動加入 Transmission 下載隊列
    • 新番文件自動重命名到 Plex 兼容格式
    • 通過 Plex AniDB agent 自動獲取新番相關信息

    總結:基於 FlexGet 和 Transmission 的全自動追番方案

    實現方法

    • 通過 FlexGet 讀取 RSS,自動下載種子文件,通過正則自動剔除無效字符
    • 通過 FlexGet 的 transmissionrpc 插件自動將種子傳送到 Transmission
    • Transmission 下載完成後觸發腳本,自動將種子重命名為 Plex 可識別格式
    • 通過 Plex 的第三方插件 Hama.bundle 自動獲取新番相關訊息

    配料表

    • 裝有 macOS 的電腦一部
    • Plex
    • Transmission
    • FlexGet

    配置 FlexGet(2021 版)

    最新版本配置採用 FlexGet 內置的 manipulate 方法,對 RSS 直接修改為符合 Plex 查詢標準的文件名,避免了使用 Transmission 調用外掛腳本的方案,下面的正則可根據實際場景進行修改:

      bangumi:
        template: torrent
        manipulate:
          - title:
              # remove underscores
              replace:
                regexp: '_'
                format: ''
          - title:
              replace:
                regexp: '★'
                format: ''
          - title:
              extract: '^[\[【].*?[\]】](.*)'
          - title:
              replace:
                regexp: '【'
                format: '['
          - title:
              replace:
                regexp: '】'
                format: ']'
          - title:
              replace:
                regexp: '】'
                format: ']'
          - title:
              replace:
                regexp: '(?:\[|【)(简体|簡體|繁体|繁體|简日双语|繁日雙語|GB|BIG5|MP4)(?:\]|】)'
                format: ''
          - title:
              replace:
                regexp: '(?:\[|【|第)(\d\d)(?:\]|】|話|话)'
                # format: 's01e\1'
                format: '\1'
          - title:
              # replace `][` to ` ` (space)
              replace:
                regexp: '\]\['
                format: ' '
          - title:
              # remove leftover brackets
              replace:
                regexp: '[\[\]【】]'
                format: ' '
          - title:
              replace:
                regexp: '(?:.*字幕 (?: 组|組))'
                format: ''
          - title:
              replace:
                regexp: '\[(?:.+? 月新? 番)'
                format: ''
        set:
          path: /Volumes/Gizur/Downloads/Anime/{{ series_name }}
          content_filename: '{{ series_name }} - {{ series_id|pad(2) }}'
          magnetization_timeout: 45
        series:
          - スーパーカブ:
              alternate_name: 本田小狼與我 Super Cub
          - ダイナ莊びより:
              alternate_name: 恐龍日和
          - 回復術士のやり直し 〜即死魔法とスキルコピーの超越ヒール〜:

    配置 FlexGet(2013 版,無需再看)

    FlexGet 的安裝方法和自動運行請參考參考 官方文檔,寫的很詳細

    配置文件如下,要點在於 presets.global.transmission.path,為了能讓 Plex 識別和方便管理,每一個動畫 要分別放在相應命名的目錄。其中 {{task}} 對應的就是 tasks 下的新番標題:

    presets:
      global:
        accept_all: true
        transmission:
          host: localhost
          port: 9091
          addpaused: No
          ratio: 0.01
          removewhendone: Yes
          path: "/Volumes/Backups HD/Anime/{{task}}/"
    tasks:
      WHITE ALBUM2:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E7%99%BD%E8%89%B2%E7%9B%B8%E7%B0%BF+2+MP4+720p.xml
      アウトブレイク・カンパニー:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E8%90%8C%E8%90%8C%E4%BE%B5%E7%95%A5%E8%80%85+MP4+720p.xml
      ガリレイドンナ:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E4%BC%BD%E5%88%A9%E7%95%A5%E5%B0%91%E5%A5%B3+%E7%AE%80%E4%BD%93+MP4+720p.xml
      キルラキル:
        rss: http://bt.ktxp.com/rss-search-%E6%A5%B5%E5%BD%B1%E5%AD%97%E5%B9%95%E7%A4%BE+Kill+La+Kill+BIG5+MP4+720p.xml
      京騒戯画:
        rss: http://bt.ktxp.com/rss-search-WOLF+%E4%BA%AC%E9%AA%9A%E6%88%8F%E7%94%BB+GB+720P+MP4.xml
      凪のあすから:
        rss: http://bt.ktxp.com/rss-search-%E5%8B%95%E6%BC%AB%E5%9C%8B+%E4%BE%86%E8%87%AA%E9%A2%A8%E5%B9%B3%E6%B5%AA%E9%9D%9C%E7%9A%84%E6%98%8E%E5%A4%A9+720P+%E7%B9%81%E9%AB%94+MP4.xml
      境界の彼方:
        rss: http://bt.ktxp.com/rss-search-%E6%BE%84%E7%A9%BA%E5%AD%A6%E5%9B%AD+%E5%A2%83%E7%95%8C%E7%9A%84%E5%BD%BC%E6%96%B9+%E7%AE%80%E4%BD%93+MP4+720p.xml
      夜桜四重奏 ~ハナノウタ~:
        rss: http://bt.ktxp.com/rss-search-%E6%A5%B5%E5%BD%B1%E5%AD%97%E5%B9%95%E7%A4%BE+%E5%A4%9C%E6%AB%BB%E5%9B%9B%E9%87%8D%E5%A5%

    配置 Transmission

    如果使用了 2021 版的方案,請略過本段

    Transmission 本身不需要進行過多配置,為了避免下載隊列越來越多,記得勾選下載完成後從隊列刪除這個選項。下面是其對應的 post-process 腳本:

    #!/bin/sh
    
    # Search all subdirectories
    # Use rename -n for dry-run
    cd /Volumes/Backups\ HD/Anime
    find . -name '*.mp4' -print0 | xargs -0 /usr/local/bin/rename -f 's/\[(.*)\]\[(.*)\]\[(\d{2})\].*$/$2 - $3\.mp4/'

    上述腳本會通過正則將 [Fansub][Title][Episode]*.mp4 這樣的格式替換為 Plex 可識別的 Title - Episode.mp4 格式,例如 [WOLF&HYSUB][Kyousougiga][00][GB][720P][MP4].mp4 就會被替換為 Kyousougiga - 00.mp4

    配置 Plex w/ Hama Agent

    注意!,已棄用 AniDB agent,改為 Hama Agent 。詳情請訪問最新文章:Hama (HTTP Anidb Metadata Agent) and Plex Media Server – 2014-04-09

    訪問 Plex 論壇 下載 AniDB agent 并安裝,通過 Plex 的 web 界面進行管理即可

    完成配置後可通過下列指令進行 dry run 測試:

    flexget -c ~/.flexget/config.yml --test execute

    以下是效果圖:

  • How to use Superdrive on any Macbook Pro

    Adds mbasd=1 (MacBook Aire Super Drive) to /Library/Preferences/SystemConfiguration/com.apple.Boot.plist as a kernal flag:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Kernel Flags</key>
        <string>mbasd=1</string>
    </dict>
    </plist>
    

    Or, use the following command in Termimal:

    sudo nvram boot-args="mbasd=1"
    

    Note that nvram may be reset for some core system update (you can also manually reset nvram), so I prefer the .plist method.

  • DD-WRT PPTP VPN Client Settings

    I have two routers, one is ASUS RT-AC66U, it’s used for all my devices, it uses default firmware shipped from ASUS, the other is ASUS RT-N16, it uses DD-WRT and configured with VPN client to pass all traffic to my VPN servers to bypass website blocking from China, I use this router for my PlayStation and other devices that don’t have native VPN support.

    First you need to enable PPTP client on DD-WRT router:

    • Remote Subnet Mask: 255.255.255.0
    • MPPE Encryption: mppe required,no40,no56,stateless
    • Username: Your VPN username
    • Password: Your VPN password

    Then you need to enable Startup commands:

    #!/bin/sh
    sleep 120
    PPTPSERVER=$(/usr/sbin/nvram get pptpd_client_srvip)
    PPTPGWY=$(/usr/sbin/nvram get wan_gateway)
    /sbin/route add -host $PPTPSERVER gw $PPTPGWY dev vlan2
    /sbin/route del default
    /sbin/route add default dev ppp0
    iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
    

    According to this article, the script I’m using above will terminate all Internet traffic until a VPN connection can be re-established if the VPN connection is lost, if you’d like your router to continue to route traffic using your ISP’s connection when losing connection, you can use the following script:

    #!/bin/sh
    sleep 120
    PPTPSERVER=$(/usr/sbin/nvram get pptpd_client_srvip)
    PPTPGWY=$(/usr/sbin/nvram get wan_gateway)
    /sbin/route add -host $PPTPSERVER gw $PPTPGWY dev vlan2
    /sbin/route del default
    /sbin/route add default gw $PPTPGWY metric 100
    /sbin/route add default dev ppp0
    iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
    

    Set static IP for my secondary router according to my primary router, note that you need to set your DNS to some other providers outside China Great Fire Wall.

    Some other steps you can do:

    • Enable remote access to your router,then you can access your router at http://10.0.0.100:8080/ when you’re using your main router network connection.
    • Enable SSH for easier (maybe harder) maintenance in the future.
    • Enable SNMP for easier (maybe harder) maintenance in the future.
    • Backup your current router settings.
    • Change Wi-Fi TX Power
    • Change NTP timezone
    • Enable JFFS2 support

    Some useful command:

    • route – Show current router rules
    • ps | grep pptp – Show VPN process

    References:

  • 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.

  • How to Use cURL to Submit WordPress Comments

    curl --data curl --data "author=Steve Jobs&[email protected]&url=http://www.apple.com&comment=Great Post&comment_post_ID=2801" http://domain.tld/wp-comments-post.php
    
  • China Telecom: Huawei HG8245 ONT Super Admin Password

    local-machine$ telnet 192.168.1.1
    Trying 192.168.1.1...
    Connected to 192.168.1.1.
    Escape character is '^]'.
    
    Welcome Visiting Huawei Home Gateway
    Copyright by Huawei Technologies Co., Ltd.
    
    Login:root
    Password:*****
    WAP>shell
    
    BusyBox v1.4.1 (2011-07-29 10:25:20 HKT) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    WAP(Dopra Linux) # cat /mnt/jffs2/hw_ctree.xml | grep telecomadmin | awk '{print $4}' | awk -F "=" '{print $2}' | sed 's/"//g'
    nE7jA%5m
    WAP(Dopra Linux) # 
    
  • Letters of Note: I am a lousy copywriter

    I am a lousy copywriter, but I am a good editor. So I go to work editing my own draft. After four or five editings, it looks good enough to show to the client. If the client changes the copy, I get angry—because I took a lot of trouble writing it, and what I wrote I wrote on purpose.

    via Letters of Note: I am a lousy copywriter.

  • You are not Steve Jobs — Editors’ Picks — Medium

    A young CEO storms through his start-up, a tiny Godzilla, crushing the feelings of his staff like so many Japanese paper maché buildings. He rubs his forehead in meetings and loudly ponders why no one is as smart as he is. No ideas are to be considered for the product unless he initiated them. He is trying his damnedest to be just like his recently departed hero — Mr. Steve Jobs.

    via You are not Steve Jobs — Editors' Picks — Medium.

  • Configuring & Using Profile Manager 2 in OS X Mountain Lion Server | Krypted.com

    Profile Manager first appeared in OS X Lion Server as the Apple-provided tool for managing Apple devices, including Mobile Device Management (MDM) for iOS based devices as well as Profile management for OS X based computers, including MacBooks, MacBook Airs, Mac Minis, Mac Pros and iMacs running Mac OS X 10.7 and up. In OS X Mountain Lion, Apple has added a number of new features to Profile Manager, most notably the ability to push certain types of apps to mobile devices.

    via Configuring & Using Profile Manager 2 in OS X Mountain Lion Server | Krypted.com.

  • 警惕 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

  • compiler errors – Cannot compile ruby 1.9.3 – Stack Overflow

    With Xcode 4.6 I was also getting this problem. I installed the command line tools which made gcc available in /usr/bin/gcc.

    I managed to get it to work using:

    rvm install 1.9.3 --with-gcc=gcc

    NB. I dont have homebrew installed.

    via compiler errors – Cannot compile ruby 1.9.3 – Stack Overflow.

  • Things You Need To Do Before You Reinstall Adobe Photoshop

    • Brushes
    • Actions
    • Textures
    • Gradients
    • Keyboard Shortcuts
    • Color Scheme
    • Plug-Ins (/Applications/Adobe Photoshop CS6/Plug-ins)
    • Scripts (/Applications/Adobe Photoshop CS6/Presets/Scripts)
  • Connecting to MAMP sites from other local network clients | Raygun

    The solution is to create a local proxy server on the machine that has MAMP installed, and then configure the client to use that proxy to browse the web. The client configuration only takes a few seconds, and is easy to disable once you’re done.

    via Connecting to MAMP sites from other local network clients | Raygun.

  • Adobe Plugins for OS X Safari Explains

    • AdobeAAMDetect – The plug-in allows you to select a product on the Creative Cloud website and have the information passed on to the Adobe Application Manager. #
    • AdobeExManDetect – A plugin to detect whether the Adobe Extension Manager is installed on this machine. #
  • Installing the Old AirPort Utility (Version 5.6) on Mountain Lion | frank.is

    As it turns out, the AirPort Utility application is totally compatible with Mountain Lion even though its installer isn’t. Using it is a not-so-simple process of extracting it from the package.

    via Installing the Old AirPort Utility (Version 5.6) on Mountain Lion | frank.is.

  • Fix svn: warning: ‘wp-content/plugins/akismet’ is not a working copy

    rm %WP_ROOT/wp-content/plugins/akismet/
    cd %WP_ROOT/
    svn up
    
  • Install weinre Server on OS X for Adobe Edge Inspect (a.k.a. Adobe Shadow)

    Use npm to download and install weinre:

    npm install -g weinre

    Launch weinre:

    weinre --boundHost -all-

    Change weinre server for Adobe Edge Inspect:

  • Adobe Community: Application manager stuck in another language

    If the user interface is in the incorrect language here is how to fix it on the Mac, in this case setting the user interface languge to English :

    1. Open the Mac OS X System Preferences and in the Personal strip at thetop click on Language & Text.
    2. On the Language tab click on the ‘Edit ListŠ’ button and uncheck all languages other than English.
    3. Download the Adobe Application Manager from here and reinstall it.

    The user interface should now be in English.

    You can confirm the Install language by clicking on your Name in the top left. In the drop-down menu choose Preferences. See that the language field is set to ‘English (North America)’. If not you can change it. The scroll bar on the right is small but you can use the up and down arrow keys to navigate too.

    via Adobe Community: Application manager stuck in another language.

  • About | Infinite-Realities

    Infinite Realities® is the 3D scanning service provided by Lee Perry-Smith, the leading 3D modelling and Scanning specialist based in Suffolk, UK.

    Infinite Realities® Director Lee Perry-Smith is an award-winning artist with a lifelong passion for capturing and imaging the human form. Completely self-taught, he began drawing at a young age, and received his first paid commission at 12. He has over fifteen years’ experience in computer graphics and has worked in-house for a number of leading Computer Games Developers and Visual Effects Studios, focusing on the creation of realistic human models. He founded Infinite Realities® in 2007.

    via About | Infinite-Realities.

  • Update Speedtest.net Mini Automatically to Avoid Expiring

    自动更新 Speedtest.net Mini 测速文件防止测速文件过期

    https://gist.github.com/abb6e26d968accef9aa2

  • Add / Update Assets Images to Remote WordPress Repository Outside Local git-svn Repository

    # Check out remote repo after updating from git repo
    svn co http://plugins.svn.wordpress.org/plugin-name
    
    # Enter plugin folder
    cd plugin-name
    
    # Add new assets
    svn add assets/*
    
    # Commit to remote repo
    svn ci -m 'Add assets image'
    
  • 当在 OS X 上编译部署 Ruby 时出现 “You have to install development tools first.” 错误时的解决方案

    一般出现这个问题时在 Lion 、 Mt. Lion 往上的系统中,因为自从某个版本之后 Xcode 将 gcc 由 gcc-4.2 改为 llvm-gcc-4.2 所致。所以解决方法也很简单:

    cd /usr/bin/
    sudo ln -s llvm-gcc-4.2 gcc-4.2
    
  • Textmate 2.0.0-alpha.9317 Adds Support For Removing Trailing Spaces in Document / Selection

    更新摘要:

    2012-09-29 (r9317)
    New semantic class: callback.document.will-save. This can be used to have a command called prior to saving a document, the command could e.g. strip trailing whitespace or ensure the document has a LF character on last line. Two minor issues is that selection is currently lost after running a “did save” command (when it replaces entire document) and caret is scrolled into the visible area.

    相关 bundle 设置: