execute async call sequentially

fix number of calls Today, i need to figure out a way to execute a bunch of http call sequentially. The problem first looks simple if we have known number of calls so that we can easily put them in callback one by one or chain the promise. number of calls varies However if what…

base64 in shell

Used to go to some site when in need of en/de-code from/to base64. Turns out we can do that from the shell directly. Encode echo -n ‘My TextTo Encode’ | base64 The -n is to prevent the new line of the echo from being included in the result(by default echo outputs a trailing newline). Decode echo ‘My…

MacOS bluetooth headset audio issue

Recently my bluetooth headset starts to act up when listening to music from MacOS. I initially thought it has died. Turns out it is an OS problem. Basically if i use it as both input and output device, the sound quality is awful. So one solution is go to the sound setting and manually select input…

macos system launch config

MacOS Config options MacOS boot service is mainly configured via three ways: 1.  the system preferences -> Users & Groups -> Login items 2. /System/Library/StartupItems and /Library/StartupItems/ 3. launchd system initialization process configuration. The first two are relatively simple, we will focus mainly on the third more complex launchd configuration optimization. launchd is a key…