Updated: 2019-04-15 01:57:26 CST +08

Mac

Keyboard Shortcut

Key Repeat

Mac OS hold key down is show special char default, to change to repeat input char.

  • Enable Key Repeat

    defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
    
  • Disable Key Repeat

    defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true
    
  • Restart your computer

  • Adjust key repeat speed

    1. System Preferences
    2. Keyboard
    3. Key Repeat
    4. Delay Until Repeat

Chinese Input

  • McBopomofo: for Old Style Chinese Input like 「ㄅ半」

Path

  1. change dir to paths.d

    /etc/paths.d/
    
  2. add path file, name “go”

    #go
    /usr/local/go/bin
    
  3. save file, and restart terminal

System Limit

Kernel

  • View

    $sudo sysctl -a
    
  • Adjust

    $sudo sysctl -w kern.maxfiles=1048600
    $sudo sysctl -w kern.maxfilesperproc=1048576
    

Open Files Limit

  • Check ulimit

    ulimit -n
    

Session

  • Adjust ulimit

    ulimit -S -n 1048576
    

System Wide

  • Temporarily

    $sudo sysctl -w fs.file-max=1048576
    
  • Persist

    • Add fs.file-max=1048576 in /etc/sysctl.conf

User Level

  • Edit /etc/security/limits.conf

    <domain>    <type>  <item>  <value>
    dinolai     hard    nofile  4096
    dinolai     soft    nofile  1024