macOS - RLovelett/dotfiles GitHub Wiki
-
sudo
without password - GPG
- ZSH
- Antigen
- Fonts
- iTerm2
## Allow rlovelett to run ALL commands without a password
$ echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo EDITOR='tee -a' visudo
$ brew install gnupg pinentry-mac
$ vi ~/.gnupg/gpg-agent.conf
pinentry-program /usr/local/bin/pinentry-mac
enable-ssh-support
cat << EOF > $HOME/Library/LaunchAgents/sh.brew.gnupg.gpg-agent.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- man launchd -->
<!-- Set the name of the Launchd task -->
<key>Label</key>
<string>sh.brew.gnupg.gpg-agent</string>
<!-- Set a command to run and its arguments -->
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/gpgconf</string>
<string>--launch</string>
<string>gpg-agent</string>
</array>
<!-- Tells the task to run once the XML is loaded -->
<key>RunAtLoad</key>
<true />
<!-- <key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SecureSocketWithKey</key>
<string>SSH_AUTH_SOCK</string>
</dict>
</dict>
<key>EnableTransactions</key>
<true/> -->
</dict>
</plist>
EOF
launchctl load -F $HOME/Library/LaunchAgents/sh.brew.gnupg.gpg-agent.plist
launchctl list | grep gpg-agent
cat << EOF > $HOME/Library/LaunchAgents/sh.brew.gnupg.link-ssh-auth-socket.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- man launchd -->
<!-- Set the name of the Launchd task -->
<key>Label</key>
<string>sh.brew.gnupg.link-ssh-auth-sock</string>
<!-- Set a command to run and its arguments -->
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>/bin/ln -sf $HOME/.gnupg/S.gpg-agent.ssh $SSH_AUTH_SOCK</string>
</array>
<!-- Tells the task to run once the XML is loaded -->
<key>RunAtLoad</key>
<true />
</dict>
</plist>
EOF
launchctl load -F $HOME/Library/LaunchAgents/sh.brew.gnupg.link-ssh-auth-socket.plist
launchctl list | grep link-ssh-auth-sock
$ chsh -s /bin/zsh
$ cd $HOME
$ git clone https://github.com/zsh-users/antigen.git .antigen
$ git clone --depth 1 --branch master https://github.com/powerline/fonts.git $HOME/Source/powerline
$ $HOME/Source/powerline/install.sh
$ git clone --depth 1 --branch release https://github.com/adobe-fonts/source-sans-pro.git $HOME/Source/source-sans-pro
$ cp $HOME/Source/source-sans-pro/TTF/*.ttf $HOME/Library/Fonts
$ git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git $HOME/Source/source-code-pro
$ cp $HOME/Source/source-code-pro/TTF/*.ttf $HOME/Library/Fonts
Alternative
brew tap homebrew/cask-fonts
brew cask install font-meslo-lg-nerd-font
brew cask install font-sauce-code-pro-nerd-font
As of iTerm2 3.3 (and later). Look in Preferences (⌘+,
) → General (tab) → Preferences (sub-tab). At the bottom of the panel, there is a setting Load preferences from a custom folder or URL:
.
https://stackoverflow.com/a/23356086/247730
Speed Up SSH by Reusing Connections
Host 192.168.*
ForwardAgent yes
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
mkdir -p $HOME/.ssh/sockets
chmod 0750 $HOME/.ssh/sockets