HCM

Happy Coding Monkey

MacOS Tips

2020-05-31


Basic

Keyboard Shortcuts

command Usages Comments
⌘ + ↑ Go To the Parent Directory
alt + ← move left a space
alt + → move right a space
⌘ + ` | swith windows inside the application | NOTE: doesn’t work for windows running in full screen |

Bash

## use gnu readlink instead of readlink
greadlink -f ./1.txt
gfind . -name "XXX"

Tools

color picker

use Digital Color Meter in MacOS

Temperature

get temperature

sudo powermetrics --samplers smc |grep -i "CPU die temperature"

Intel Power Gadget

measure Power Watts, CPU temperature, CPU frequency.

GNU tools

brew install coreutils

Networking

brew install with proxy

ALL_PROXY=socks5://localhost:1080 brew install minetest

# or with password
ALL_PROXY=socks5://a:a@localhost:8765 brew install minetest

open multiple Wireshark instances

$ open -n /Applications/Wireshark.app

netstat -anp not working in MacOS, use lsof

tcpdump

$ sudo tcpdump -i all host 127.0.0.1 and port 1080 -w cap1.pcap
$ open cap1.pcap

max connection in MacOS

$ sudo sysctl -a |grep somaxconn
kern.ipc.somaxconn: 128

$ sudo sysctl -w kern.ipc.somaxconn=4096
kern.ipc.somaxconn: 128 -> 4096

https://content.nanobox.io/fixing-too-many-open-files-in-macos/

Emacs

Open ~/Documents/ folder permission error. Using ns-open-file-using-panel open it once, then error is gone.

Windows

make a Windows 10 boot-able USB stick in MacOS

  1. Format the USB stick For me, UEFI Mode is used in BIOS.

It’s working when USB stick is formatted with FAT32+MBR(Master Boot Record) option.

If I use exFAT32+GPT(GUID Partition Map) option, the USB stick can not boot.

  1. Mount ISO file and USB stick, and copy all files in ISO to USB.

ref: How to Make a Windows 10 USB Using Your Mac - Build a Bootable ISO From Your Mac’s Terminal

Microsoft Remote Desktop

RDP client on Mac OS.