Junyangz's docs
  • Introduction
  • Ops
    • Linux-tips
    • MySQL-5.7.20
    • Upgrading MySQL
    • Upgrade OpenSSH to 7.7p1 in CentOS 6
    • Linux PERSISTENT NAMING
    • Use Kafka with Flume - CRS2
    • Setup Chroot SFTP in CentOS
    • Setup software RAID-5 in CentOS
    • SSH-port-forwarding
    • Elasticsearch In Production
    • ELK-simple-tutorial
    • Ansible Playbooks for Apache Kafka in production
    • GitHub Actions depoly Hexo
    • Test HTTP3/QUIC docker
    • Docker tutorial
    • SFTP-auth-pubkey
    • Linux Process Substitution
  • Note
    • Interview
      • interview-prepare
      • 2020-campus-recruiting
    • Android Tips
    • MacOS tips
    • Secret knowledge
    • GPG-Note
    • ud185
    • ud185-2
    • Introducing Tensorflow Federated
    • Tensorflow Federated
    • Expert Python Programing
    • What happens when zh_CN
    • TILGC
    • VScode keyboard shortcuts
    • Abseil Python
    • Latex Note
    • Git Cheatsheet
    • Study Smarter Not Harder
    • Machine Learning Interviews
    • 深度学习中的优化
    • Beej's Guide to Network Programming Note
      • ch4
      • ch5
      • ch6
      • ch7
  • [Share]
    • What to do after what to do
    • Truman is everywhere
    • Way2outer
    • 未来十五年
  • Quote
Powered by GitBook
On this page
  • Restart mac network with specific interface
  • Preventing slee when close the lid
  • Sudo with Touch ID
  • Check listen port
  • Nmap or nc check
  • iTerm2 zmodem
  • Git user base on remote url
  • MacOS remove quarantine
  • Other assets

Was this helpful?

  1. Note

MacOS tips

PreviousAndroid TipsNextSecret knowledge

Last updated 2 years ago

Was this helpful?

Created on Sun, 06 Oct 11:32AM

Last changed on 2023-01-27 20:37:24

Restart mac network with specific interface

sudo ifconfig en7 down
sudo ifconfig en7 up

Preventing slee when close the lid

# 禁止自动睡眠
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# 恢复关盖睡眠
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0

Sudo with Touch ID

# /etc/pam.d/sudo
sudo gsed -i '1aauth	   sufficient 	  pam_tid.so' /etc/pam.d/sudo
sudo sed -i '' -e '1a\
auth       sufficient     pam_tid.so' /etc/pam.d/sudo #sudo touch id

Check listen port

sudo lsof -i -P | grep -i "listen"

Nmap or nc check

nc -zv [host-name/ip] [port(s)]

iTerm2 zmodem

zsh <(curl -sSL https://github.com/Junyangz/iterm2-zmodem/raw/master/iterm2-zmodem.sh)

Git user base on remote url

# ~/.gitconfig, need git version >= 2.36
[includeIf "hasconfig:remote.*.url:git@github.com*/**"]
# [includeIf "hasconfig:remote.*.url:https://github.com*/**"] # for https
	path = ~/.gitconfig-github

MacOS remove quarantine

xattr -d -r com.apple.quarantine /Applications/xxx.app # or xxx binary

Other assets

nosleep
https://github.com/hzlzh/Best-App
https://mubu.com/doc/oeP76-2GF
https://github.com/jaywcjlove/awesome-mac
https://lemon.qq.com/lab/
https://sspai.com/tag/Mac