nrfjprog -f NRF52 --memrd 0x100000a4 --n 8
0x100000A4: ACAFE032 7AC54CAF

这里的mac地址是 0xCCAFACAFE032. 其中4C变成了CC,这是因为蓝牙协议规定静态mac地址的2 MSBit必须是11(Bluetooth Core v4.0, Vol 3, Part C, chapter 10.8.1) 如果想省事一点,也可以用adalink这个python脚本。直接获取芯片信息

adalink nrf52832 -p jlink --info
Hardware ID : 0x52832
Variant : 0x41414530
Package : QFxx - 48-pin QFN
Flash : 512 KB Flash
Device Addr : E0:A3:38:95:23:66
Device ID : BA74FBE3D9A8A03C
NFC Pins : NFC

如何升级老迈的Mac到macOS Catalina

不久前macOS Catalina 10.15正式版发布,想到还有一台吃灰许久的Mac mini 2011mid,这个老机器我已经替换了SSD硬盘,加了内存,日常浏览网页也不觉得吃力。再加上从前用这台机器做过业余私活赚过些许外快,也有些感情。也许可以升级到最新的macOS? 但是在App Store中直接安装macOS Catalina却得到了此机型已经不被支持的提示,大失所望。

macOS Catalina仅支持这些机型:
  • MacBook (Early 2015 or newer)
  • MacBook Air (Mid 2012 or newer)
  • MacBook Pro (Mid 2012 or newer)
  • Mac mini (Late 2012 or newer)
  • iMac (Late 2012 or newer)
  • iMac Pro (2017)
  • Mac Pro (Late 2013 or newer)
那么我的老机器是不是永远的停留在High Sierra呢?倒也不是无法可想。有个叫macOS Catalina Patcher的软件可以对安装包打个补丁,从而达到老树开新芽的目的。

开始升级Mac mini 2011mid到macOS Catalina

  • 下载macOS Catalina Patcher
  • 确认磁盘格式为APFS
  • 运行Patcher
  • 在下一屏,选择”Download a Copy”. 如果已经下载好了则可以选择”Browse a Copy..”
  • 下载需要等待一些时间,大概8G左右。下载完成后,可以选择制作启动盘或者直接升级,由于这台老机器并不常用,所以我毫无压力的选择了直接升级
  • 现在弹出提示,由于启用了SIP(System Integrity Protection),无法升级,需要重启到恢复模式(macOS Recovery)禁用SIP。
  • 选择重启电脑,并按住Command+R键不放,此时顺利进入恢复模式
  • 在恢复模式中的顶部菜单条选择Terminal,并输入 csrutil disable , 重启机器
  • 重启完成后再次打开Patcher -> “Browse a Copy”并选中上次已经下载的”Install macOS Catalina”安装包 -> 直接升级
  • 等待安装,期间会重启数次,升级完成。这个过程中与正常的升级体验并无二致
  • 体验macOS Catalina


  • 第一次初始化时卡住了较长时间,再次重启后此问题消失不见



Aria2 is a lightweight download software with Multi-Connection support. Besides HTTP(s) and FTP, it also supports BitTorrent and Metalink.



brew install aria2


  • 新增文件并编辑 /usr/local/opt/aria2/homebrew.mxcl.aria2.plist, 内容如下
<!--?xml version="1.0" encoding="UTF-8"?-->
<plist version="1.0">
  • 然后用homebrew启动这个service,默认端口是6800
brew services start aria2

About ESP8266 module

How to detect the flash size of ESP8266 module?

  • Install latest esptool from GitHub or with pip
  • Wire ESP8266 module with a programmer
  • Run command
esptool.py flash_id

You should get some information about the flash of ESP8266 module

esptool.py v2.6-beta1
Found 2 serial ports
Serial port /dev/cu.SLAB_USBtoUART
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 18:fe:34:9f:5a:0a
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4013
Detected flash size: 512KB
Hard resetting via RTS pin...
  • So the flash size is 512KB



cd /var/discourse
git pull
./launcher rebuild app


每次升级discourse版本,都会build一个新的docker image,下载discourse/base的image,那么进行清理很有必要。

launcher cleanup是discourse内建的一个清理程序,安全且有效

cd /var/discourse
/var/discourse# ./launcher cleanup 

The following command will
- Delete all docker images for old containers
- Delete all stopped and orphan containers

Are you sure (Y/n): Y
Starting Cleanup (bytes free 26462384)
Finished Cleanup (bytes free 37250136)


/var/discourse# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        50G   19G   28G  41% /

清理后,腾出来7G的空间,对于小容量的VPS来说,相当可观。这个主要是清理掉了一些无用的docker image

/var/discourse# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        50G   12G   36G  24% /



My hackintosh build

High Sierra 10.13.5


  • i3 8100
  • ASUS h110m-k d3 MATX board (Add micro code to BIOS, support i3 8100)
  • 8G x 2 DDR3 1600 RAM (For AMD only)
  • Micron 1100 256 GB Solid State Drive
  • Huntkey SUPER 400N 300 Watt SMPS
  • Fenvi FV-T919 BCM94360 WiFi/Bluetooth PCI-E card

The build use integrated graphics Intel UHD 630. The Fenvi FV-T919 card can be driven directly without any changes. I can use my old apple keyboard and trackpad perfectly.

Update BIOS for ASUS motherboard

ASUS h110m-k d3 can’t support i3 8100 directly. But I bought the motherboard from taobao and the seller changed the BIOS to ASRock motherboard already. The motherboard can work with i3 8100 directly but many options are missed for ASUS motherboard T_T

I re-flashed another BIOS file from here. Please note: the default CPU core voltage is too high for i3 8100 in the new BIOS. I change it to 1.040 volt.

I re-flashed a modified BIOS here. The BIOS supports 1.040 CPU volt default.


See the section “Recommended BIOS Settings” at tonymacx86

For iGPU i3 8100, add the bios option

  • Graphics Configuration → DVMT Pre-Allocated : 128MB

The Installation

I followed the Installation Guide at tonymacx86. I used UniBeast to create a bootable High Sierra install on a 16GB USB drive to both format the internal SSD and install macOS.

Options for UniBeast:

  • PCI Devices
    • USB Ownership
    • USB InjectAll

Problem: The USB keyboard and mouse can’t work at the installation screen. I copied the USBInjectAll.kext to /EFI/CLOVER/Kexts/Other and it works again.

Post installation for MultiBeast

  • UEFI Boot mode
  • Drivers > Audio > Realtek ALCxxx > ALC887/888b
  • Drivers > Misc > FakeSMC
  • Drivers > Network > Realtek > RealtekRTL8111 v2.2.2
  • Drivers > USB > Remove XHCI USB port limit
  • Drivers > USB > USBInjectAll
  • Graphics > Intel Graphics Fixup
  • SMBIOS: 17,1

For Intel UHD 630 graphics:

I copied drivers from RehabMan


  • AppleIntelKBLGraphicsFramebufferInjector_3e9x.kext
  • FakePCIID_Intel_HD_Graphics.kext
  • FakePCIID.kext
  • IntelGraphicsFixup.kext
  • Lilu.kext
  • Shiki.kext

Edit config.plist with Clover Configurator

  • Bootflag: shikigva=1
  • Devices/FakeID/IntelGFX: 0x3E928086
  • Graphics: Inject Intel – Empty ig-platform-id
  • SMBIOS: 17,1


  • Sleep: Can’t wake from sleep mode


Update From 10.13.6 To 10.14.0

  • Install latest Lilu.kext and WhatEverGreen.kext
  • Install Multibeast 11 (not available yet)
  • Remove:
    • FakePCIID_Intel_HD_Graphics.kext
    • AppleIntelKBLGraphicsFramebufferInjector_3e9x.kext
    • IntelGraphicsFixup.kext
    • Shiki.kext
    • Bootflag: shikigva=1
    • Devices/FakeID/IntelGFX: 0x3E928086
  • Install Mojave from App Store
  • Follow the link Mojave AppleHDA Audio to remove old realtekALC and install AppleALC

Update From 10.14 To 10.15

  • I added a RX560 for support multiple monitors
  • Install latest Lilu, WhatEverGreen and AppleALC
  • Disable the UHD 630 in BIOS
  • Install Catalina from App Store

DA14580 advertises to a specify channel

For BLE, Channels 37, 38, and 39 are used only for sending advertisement packets. DA14580 advertises at channel 37, 38 and 39 in the example project from Dialog. But sometimes we need it advertises to a specify channel.

Here are the channel define In the file co_bt.h

///Advertising channels enables
enum adv_channel_map
  ///Byte value for advertising channel map for channel 37 enable
  ADV_CHNL_37_EN = 0x01,
  ///Byte value for advertising channel map for channel 38 enable
  ///Byte value for advertising channel map for channel 39 enable
  ADV_CHNL_39_EN = 0x04,
  ///Byte value for advertising channel map for channel 37, 38 and 39 enable
  ADV_ALL_CHNLS_EN = 0x07,
  ///Enumeration end value for advertising channels enable value check

Here’s the code to let DA14580 advertises to channel 37



struct gapm_start_advertise_cmd *cmd;
cmd->channel_map = APP_ADV_CHMAP;

Simple script for J-Link RTT viewer

I debug NRF52 chip with JLink real time terminal. It’s pretty to use J-Link RTT viewer on my macOS. For example, I ran this command for open a RTT viewer window.

you@yourcomputer:~$JLinkExe -device nRF52 -speed 4000 -if SWD -autoconnect 1

SEGGER J-Link Commander V5.10u (Compiled Mar 17 2016 19:06:22)
DLL version V5.10u, compiled Mar 17 2016 19:06:19

Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 15 2016 18:03:17
Hardware version: V1.00
VTref = 3.300V

Type "connect" to establish a target connection, '?' for help

We can use JLinkRTTClient to check the RTT output. But sometimes JLinkRTTClient will not reconnect if the JLinkExe reopened. A simple script can do this job

while true; do nc localhost 19021; sleep 2; done;

I’ve written this line in my makefile.



这个操作似乎并不能用简单的git branch -m来解决。搜索发现也有不少人有类似需求,贴上解决方法。



git checkout seotweaks
git merge -s ours master
git checkout master
git merge seotweaks



git branch -m master old-master
git branch -m seotweaks master
git push -f origin master




CompileDTraceScript ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoa/RACSignalProvider.d
    cd /Users/Tony/Code/TestApp/Pods
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/Tony/.rvm/gems/ruby-1.9.3-p194/bin:/Users/Tony/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/Tony/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/Tony/.rvm/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/heroku/bin:/usr/local/git/bin:/usr/local/share/npm/bin:/Applications/MAMP/Library/bin:/Users/Tony/Applications/play:/Users/Tony/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/git/bin:/usr/local/sbin:/Users/Tony/.rvm/bin:/Users/Tony/.ec2/bin"
    /usr/sbin/dtrace -h -DOS_OBJECT_USE_OBJC=0 -fobjc-arc -DOS_OBJECT_USE_OBJC=0 -w -Xanalyzer -analyzer-disable-checker -s ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoa/RACSignalProvider.d -o /Users/Tony/Library/Developer/Xcode/DerivedData/TestApp-bfkcwbnhjkdedddkxicxplyvlnxq/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-ReactiveCocoa.build/DerivedSources/RACSignalProvider.h


Command /usr/sbin/dtrace failed with exit code 2


pod 'ReactiveCocoa', '~> 2.1', :inhibit_warnings => true