Tag Archives: OS X

Signing Git Commits without Entering Password Using `gpg-agent` and `pinentry-mac` on OS X

Install required packages via Homebrew:

$ brew install gpg gpg-agent pinentry-mac

Edit and add the following lines in ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/local/bin/pinentry-mac

Edit and enable use-agent in ~/.gnupg/gpg.conf:

use-agent

Then add the following line to your shell profile:

eval $(gpg-agent --daemon --sh)

ProxyChains-NG and OS X El Capitan System Integrity Protection System Integrity Protection

Apple introduces System Integrity Protection (SIP) as a security feature for OS X El Capitan (10.11), which prevent ProxyChains-NG working as before, you have to disable SIP to make it work:

  1. Reboot your Mac into Recovery Mode by pressing command-R
  2. Open Terminal and type csrutil enable --without debug:
$ csrutil enable --without debug
$ csrutil: requesting an unsupported configuration. This is likely to break in the future and leave your machine in an unknown state.
$ Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect.

Just ignore the warnings and then restart your Mac.

How to Update “Bypass proxy settings for these Hosts & Domains” Programmatically in OS X

You can get all proxy bypass domains using:

$ networksetup -getproxybypassdomains "Wi-Fi"

The Wi-Fi should be your current interface, you can also update it using:

$ networksetup -setproxybypassdomains "Wi-Fi" \
*.local \
0.0.0.0/8 \
1.0.0.0/9 \
1.160.0.0/11 \
1.192.0.0/11 \

See man networksetup for more information

Uninstalling letsencrypt – Let’s Encrypt Community Support

If you have the environment variable XDG_DATA_HOME set, the installation is located at $XDG_DATA_HOME/letsencrypt. Otherwise, it is located at ~/.local/share/letsencrypt. You can simply delete this directory. You can also delete configuration, work, and log directories which by default are stored at /etc/letsencrypt, /var/lib/letsencrypt, and /var/log/letsencrypt respectively. The directory where you cloned our git repo can also be deleted.

Let’s Encrypt also installs some OS dependencies and how you remove these would be very OS specific. To see what dependencies were installed, take a look at the files in the bootstrap folder at the root of our git repo (link). Take a look at the shell script for your OS to see what packages are required. You can uninstall these packages through the normal means of your OS, but make sure they aren’t required by any other programs on your system.

Source: Uninstalling letsencrypt – Let’s Encrypt Community Support

三星 850 Pro、OS X El Capitan、SSD Trim 備忘

最近重灌了 El Capitan,在找「三星 850 Pro 是否可以用 trimforce 開啟 Trim 支援」時發現了下面的信息:

我就看了下我的硬體:

Samsung SSD 850 PRO 512GB:

  Capacity: 512.11 GB (512,110,190,592 bytes)
  Model:    Samsung SSD 850 PRO 512GB               
  Revision: EXM01B6Q
  Serial Number:    S1SXNSAF806527E     
  Native Command Queuing:   Yes
  Queue Depth:  32
  Removable Media:  No
  Detachable Drive: No
  BSD Name: disk0
  Medium Type:  Solid State
  TRIM Support: No
  Bay Name: Lower
  Partition Map Type:   GPT (GUID Partition Table)
  S.M.A.R.T. status:    Verified

😀

Export Compact SVG with Sketch

Bohemian Coding – Preferences.

Used to tell Sketch to export compact SVG files. We add some metadata to exported SVG files, to make it easier to re-import them in Sketch. However, if you are sure you won’t import them, you can disable the saving of metadata by running this into your Terminal.app:

$ defaults write com.bohemiancoding.sketch3 exportCompactSVG -bool yes

When this is set to YES, Sketch will not use the name of the layer for the id field of the layer in SVG export:

$ defaults write com.bohemiancoding.sketch3 svgExportSkipAssignIdToLayerName -bool yes

Microsoft 真是完了

先說事情緣由吧

因為工作原因,需要一台 Windows 的機器,之前一直在 OS X 上用 Parallels Desktop 的 Windows 虛擬機,VM 是從 modern.ie 取得的,過期之後去 Microsoft 官網買了 Windows 8.1 的許可,然後一直開心地用著

後來發現 PD 的虛擬機性能已經無法滿足我了,打算將淘汰下來的 MacBook Pro 用 Boot Camp 直接裝 Windows 來用,於是就發現了 Microsoft 的驚天大秘密!

首先我去 Microsoft 官網找 Windows 鏡像下載,登入了帳號,找了幾百個小時竟然根本無法找到!後來搜了好幾個月才發現竟然要在一個 microsoftstore.com 的網站下載!下載之後準備在 Boot Camp 中燒鏡像時才發現,Boot Camp 竟然只支援 64 位元!

這時我開始回想⋯⋯不對啊,從官網下載來的加載程式根本就沒有選擇位元的選項!又經過了數月的搜索,終於發現了 Windows 的天大的秘密!

那就是如果你是在 32 位元系統上下載鏡像,那麼你只能下載 32 位元的鏡像!同理 64 位元系統上只能下載 64 位元的鏡像!1

這時我突然想起我從 modern.ie 那邊的 VM 是 32-bit 的⋯⋯

Holy motherfucking shit!

微軟真的完了⋯⋯

這都 2015 年了⋯⋯

下面附上解決辦法:

  1. 根據腳註推薦,請去下載相應 torrent 的文件,然後去 MSDN 那邊驗證 SHA1,比如我需要的是「Windows 8.1 with Update (multiple editions) (x64) – DVD (English)」:
$ openssl sha1 /Users/hep/Downloads/en_windows_8.1_with_update_x64_dvd_6051480.iso 
SHA1(/Users/hep/Downloads/en_windows_8.1_with_update_x64_dvd_6051480.iso)= a8b5df0b0816280ae18017bc4b119c77b6c6eb79

最後說一句,堅決支持 OS X 用戶使用盜版 Windows!