From c9c17ca4df1d938521f241fd72b8efaeed1e14cb Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 14:48:41 +0100 Subject: [PATCH 01/63] Create bootstrap.sh --- bootstrap.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100644 index 0000000..dc83bf9 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# generate a new, strong rsa ssh key +ssh-keygen -t rsa -b 4096 + +# wait for the user to add it to github +pbcopy < ~/.ssh/id_rsa.pub +echo "Now login to https://github.com/settings/keys and add the key that has already been copied to your clipboard." +echo "Press any key to continue. Ctrl-C to abort." +read + +# install Xcode Command Line Tools +# https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh +touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress; +PROD=$(softwareupdate -l | + grep "\*.*Command Line" | + head -n 1 | awk -F"*" '{print $2}' | + sed -e 's/^ *//' | + tr -d '\n') +softwareupdate -i "$PROD" -v + +# clone my dotfiles and make them +git clone git@github.com:Overbryd/dotfiles.git ~/dotfiles +make -C ~/dotfiles From ded6213a5504357677226436a91e195915a34654 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 14:50:30 +0100 Subject: [PATCH 02/63] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index fd19e30..8353872 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # Overbryd's dotfiles + +``` +curl https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh | sh +``` + . ├── .gitattributes # ├── .gitconfig # colorful git config, including aliases From b9b6c3a8f8c07519473269f6434a5085dd01a634 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 14:52:51 +0100 Subject: [PATCH 03/63] Update bootstrap.sh --- bootstrap.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index dc83bf9..d95028d 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # generate a new, strong rsa ssh key ssh-keygen -t rsa -b 4096 @@ -6,8 +6,7 @@ ssh-keygen -t rsa -b 4096 # wait for the user to add it to github pbcopy < ~/.ssh/id_rsa.pub echo "Now login to https://github.com/settings/keys and add the key that has already been copied to your clipboard." -echo "Press any key to continue. Ctrl-C to abort." -read +read -p "Press any key to continue. Ctrl-C to abort." # install Xcode Command Line Tools # https://github.com/timsutton/osx-vm-templates/blob/ce8df8a7468faa7c5312444ece1b977c1b2f77a4/scripts/xcode-cli-tools.sh From f332db72845f6c240c8181254880dca3a723c9f9 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 14:53:06 +0100 Subject: [PATCH 04/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8353872..ba57cae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Overbryd's dotfiles ``` -curl https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh | sh +curl https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh | bash ``` . From f263ac4936b57f9946580906fdc4303b85ddb894 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 18:25:33 +0100 Subject: [PATCH 05/63] Update README.md --- README.md | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ba57cae..021ea08 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,33 @@ # Overbryd's dotfiles -``` -curl https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh | bash -``` +## Bootstrap +On a new mac, open a Terminal and run: + + curl https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh | bash + +## Maintenance + +Enter the `~/dotfiles` directory, make changes and make it: + + cd ~/dotfiles + make + +The Makefile contains sections for installing \*nix command line utilities, macOS applications, macOS settings and maintaing specific configurations. + +## Contents . + ├── Makefile # This makefile controls all sections of this project +    ├── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac ├── .gitattributes # ├── .gitconfig # colorful git config, including aliases ├── .gitignore # general gitignore ├── .inputrc # great for navigating bash history - ├── .profile # simple bash setup + ├── .profile # the complete bash setup with comments ├── .slate # configuration for Slate, a Mac OSX window manager - ├── .tm_properties # configuration for TextMate, a great Code editor + ├── .tm_properties # configuration for TextMate ├── .vimrc # a great .vimrc with comments ├── decrypt.sh # decrypt sensitive files and put them in place - ├── defaults.sh # a collection of interesting Mac OSX defaults - └── encrypt.sh # simple wrapper to encrypt sensitive files for storage - -## Maintain and setup OSX defaults - -While working with your Mac you start customizing all the stuff. If you setup a new machine you can reproduce the setup using `defaults.sh`. -Any customization that you do via `defaults` should be appended to `defaults.sh`. - -```bash -~/.dotfiles/defaults.sh -``` + ├── encrypt.sh # simple wrapper to encrypt sensitive files for storage + ├── Makefile # this Makefile controls all sections of this project + └── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac From a7d10e4043d39d73e38749637ab5ead75ff7a3a6 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 18:37:01 +0100 Subject: [PATCH 06/63] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 021ea08..ce9863f 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Enter the `~/dotfiles` directory, make changes and make it: The Makefile contains sections for installing \*nix command line utilities, macOS applications, macOS settings and maintaing specific configurations. ## Contents + . ├── Makefile # This makefile controls all sections of this project    ├── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac @@ -30,4 +31,4 @@ The Makefile contains sections for installing \*nix command line utilities, macO ├── decrypt.sh # decrypt sensitive files and put them in place ├── encrypt.sh # simple wrapper to encrypt sensitive files for storage ├── Makefile # this Makefile controls all sections of this project - └── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac + └── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac From 81e321fc9bd91df98424d298f84969fcfb02797f Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 18:37:47 +0100 Subject: [PATCH 07/63] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce9863f..6953fc8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The Makefile contains sections for installing \*nix command line utilities, macO . ├── Makefile # This makefile controls all sections of this project -    ├── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac + ├── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac ├── .gitattributes # ├── .gitconfig # colorful git config, including aliases ├── .gitignore # general gitignore From a47f637611a37986e10702c7c3318192a8408f64 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 19:19:50 +0100 Subject: [PATCH 08/63] Update Readme.md add some credits --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 6953fc8..78acb4c 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,12 @@ The Makefile contains sections for installing \*nix command line utilities, macO ├── encrypt.sh # simple wrapper to encrypt sensitive files for storage ├── Makefile # this Makefile controls all sections of this project └── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac + +## Credits + +This seletion of dotfiles and system settings would not be possible with the great examples provided by: + +* https://github.com/paulirish/dotfiles +* https://github.com/why-jay/osx-init +* http://dotfiles.github.io +* https://www.stackoverflow.com/ :) From f0424b913c5c36a6f5d68080fc6f2e310c6ed6b3 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 19:24:24 +0100 Subject: [PATCH 09/63] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 78acb4c..145950e 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ The Makefile contains sections for installing \*nix command line utilities, macO This seletion of dotfiles and system settings would not be possible with the great examples provided by: +* https://github.com/mathiasbynens/dotfiles +* https://github.com/matijs/dotfiles * https://github.com/paulirish/dotfiles * https://github.com/why-jay/osx-init * http://dotfiles.github.io From a02f62d00f4e3e72c9e302f216bc2153828d3f67 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 19:26:19 +0100 Subject: [PATCH 10/63] add some missing software --- .hushlogin | 0 Makefile | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 .hushlogin diff --git a/.hushlogin b/.hushlogin new file mode 100644 index 0000000..e69de29 diff --git a/Makefile b/Makefile index 96b3edf..aa02e1a 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ all: \ bash \ vim \ tmux \ - dotfiles + dotfiles \ + defaults brew: \ /usr/local/bin/brew @@ -32,8 +33,6 @@ brew: \ brew install postgres # mysql brew install mysql - # elasticsearch - brew install elasticsearch # sed, stream editor, but replace mac os version brew install gnu-sed --with-default-names # erlang programming language @@ -52,7 +51,7 @@ brew: \ brew install pv /usr/local/bin/brew: - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" casks: \ /usr/local/bin/brew @@ -70,12 +69,20 @@ casks: \ brew cask install dropbox # 1password is an excellent password manager brew cask install 1password - # gpgtools provide me with all gpp related things - brew cask install gpgtools + # gpg-suite provide me with all gpp related things + brew cask install gpg-suite # virtualbox to handle virtual machines brew cask install virtualbox # handle google cloud related stuff brew cask install google-cloud-sdk + # adium is a nice chat client + brew cask install adium + # I do some JRuby development where java comes in handy :) + brew cask install java8 + # Skype is still used by many of my friends :) + brew cask install skype + # VLC an excellent video player + brew cask install vlc bash: # newer version of bash @@ -115,6 +122,106 @@ tmux: \ # install tmux plugin manager git clone --depth=10 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm +defaults: + # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) + defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 + # Enable subpixel font rendering on non-Apple LCDs + defaults write NSGlobalDomain AppleFontSmoothing -int 2 + # Enable the 2D Dock + defaults write com.apple.dock no-glass -bool true + # Automatically hide and show the Dock + defaults write com.apple.dock autohide -bool true + # Make Dock icons of hidden applications translucent + defaults write com.apple.dock showhidden -bool true + # Disable menu bar transparency + defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false + # Show remaining battery time; hide percentage + defaults write com.apple.menuextra.battery ShowPercent -string "NO" + defaults write com.apple.menuextra.battery ShowTime -string "YES" + # Enable highlight hover effect for the grid view of a stack (Dock) + defaults write com.apple.dock mouse-over-hilte-stack -bool true + # Enable spring loading for all Dock items + defaults write enable-spring-load-actions-on-all-items -bool true + # Show indicator lights for open applications in the Dock + defaults write com.apple.dock show-process-indicators -bool true + # Don’t animate opening applications from the Dock + defaults write com.apple.dock launchanim -bool false + # Disable press-and-hold for keys in favor of key repeat + defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false + # Set a blazingly fast keyboard repeat rate + defaults write NSGlobalDomain KeyRepeat -int 0 + # Disable auto-correct + defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false + # Disable window animations + defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false + # Enable AirDrop over Ethernet and on unsupported Macs running Lion + defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true + # Disable disk image verification + # defaults write com.apple.frameworks.diskimages skip-verify -bool true + # defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true + # defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true + # Disable the “Are you sure you want to open this application?” dialog + # defaults write com.apple.LaunchServices LSQuarantine -bool false + # Automatically open a new Finder window when a volume is mounted + defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true + defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true + # Increase window resize speed for Cocoa applications + defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 + # Avoid creating .DS_Store files on network volumes + defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true + # Disable the warning when changing a file extension + defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false + # Save to disk (not to iCloud) by default + defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + # Automatically quit printer app once the print jobs complete + defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true + # Check for software updates daily, not just once per week + defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 + # Disable smart quotes as they’re annoying when typing code + defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false + # Disable smart dashes as they’re annoying when typing code + defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false + # Trackpad: enable tap to click for this user and for the login screen + defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true + defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 + defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 + # Automatically illuminate built-in MacBook keyboard in low light + defaults write com.apple.BezelServices kDim -bool true + # Turn off keyboard illumination when computer is not used for 5 minutes + defaults write com.apple.BezelServices kDimTime -int 300 + # Save screenshots to the desktop + defaults write com.apple.screencapture location -string "${HOME}/Desktop" + # Disable shadow in screenshots + defaults write com.apple.screencapture disable-shadow -bool true + # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) + defaults write com.apple.screencapture type -string "png" + # Hide all desktop icons because who need 'em' + defaults write com.apple.finder CreateDesktop -bool false + # Enable HiDPI display modes (requires restart) + sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true + # Finder: disable window animations and Get Info animations + defaults write com.apple.finder DisableAllAnimations -bool true + # Finder: show hidden files by default + defaults write com.apple.Finder AppleShowAllFiles -bool true + # Finder: show all filename extensions + defaults write NSGlobalDomain AppleShowAllExtensions -bool true + # Finder: show path bar + defaults write com.apple.finder ShowPathbar -bool true + # Empty Trash securely by default + defaults write com.apple.finder EmptyTrashSecurely -bool false + # Require password immediately after 5 seconds on sleep or screen saver begins + defaults write com.apple.screensaver askForPassword -int 1 + defaults write com.apple.screensaver askForPasswordDelay -int 5 + # Only use UTF-8 in Terminal.app + defaults write com.apple.terminal StringEncodings -array 4 + # Show the ~/Library folder + chflags nohidden ~/Library + # disable apple captive portal (seucrity issue) + sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -bool false + # Keep this bit last + # Kill affected applications + for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done + dotfiles: $(DOTFILES) ~/.%: From d38b7a8510db96c69f54932e1c0a087236d55422 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 19:31:08 +0100 Subject: [PATCH 11/63] its java not java8 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index aa02e1a..a601674 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ casks: \ # adium is a nice chat client brew cask install adium # I do some JRuby development where java comes in handy :) - brew cask install java8 + brew cask install java # Skype is still used by many of my friends :) brew cask install skype # VLC an excellent video player From f24f199904297b11964e5125a24ac0044c9869a6 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 10 Mar 2018 23:58:51 +0100 Subject: [PATCH 12/63] restructure defaults into two new sections defaults-NSGlobalDomain and defaults-dock +add a few casks --- Makefile | 115 ++++++++++++++++++++++++++++++++---------------------- README.md | 5 +-- 2 files changed, 71 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index a601674..722e9a1 100644 --- a/Makefile +++ b/Makefile @@ -83,6 +83,10 @@ casks: \ brew cask install skype # VLC an excellent video player brew cask install vlc + # TextMate is an excellent GUI based editor + brew cask install textmate + # Flux reduces blue/green colors on the display spectrum and helps me sleep better + brew cask install flux bash: # newer version of bash @@ -108,13 +112,12 @@ vim-plugins: \ # install vundle, a vim package manager ~/.vim/bundle/Vundle.vim: - git clone https://github.com/gmarik/Vundle.vim.git ~.vim/bundle/Vundle.vim + git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim tmux: \ ~/.tmux.conf \ ~/.tmux/plugins/tpm brew install tmux - tmux source ~/.tmux.conf # install plugins ~/.tmux/plugins/tpm/bin/install_plugins @@ -122,38 +125,11 @@ tmux: \ # install tmux plugin manager git clone --depth=10 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm -defaults: - # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) - defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 - # Enable subpixel font rendering on non-Apple LCDs - defaults write NSGlobalDomain AppleFontSmoothing -int 2 - # Enable the 2D Dock - defaults write com.apple.dock no-glass -bool true - # Automatically hide and show the Dock - defaults write com.apple.dock autohide -bool true - # Make Dock icons of hidden applications translucent - defaults write com.apple.dock showhidden -bool true - # Disable menu bar transparency - defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false +defaults: \ + defaults-dock # Show remaining battery time; hide percentage defaults write com.apple.menuextra.battery ShowPercent -string "NO" defaults write com.apple.menuextra.battery ShowTime -string "YES" - # Enable highlight hover effect for the grid view of a stack (Dock) - defaults write com.apple.dock mouse-over-hilte-stack -bool true - # Enable spring loading for all Dock items - defaults write enable-spring-load-actions-on-all-items -bool true - # Show indicator lights for open applications in the Dock - defaults write com.apple.dock show-process-indicators -bool true - # Don’t animate opening applications from the Dock - defaults write com.apple.dock launchanim -bool false - # Disable press-and-hold for keys in favor of key repeat - defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false - # Set a blazingly fast keyboard repeat rate - defaults write NSGlobalDomain KeyRepeat -int 0 - # Disable auto-correct - defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false - # Disable window animations - defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false # Enable AirDrop over Ethernet and on unsupported Macs running Lion defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true # Disable disk image verification @@ -165,26 +141,14 @@ defaults: # Automatically open a new Finder window when a volume is mounted defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true - # Increase window resize speed for Cocoa applications - defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 # Avoid creating .DS_Store files on network volumes defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true # Disable the warning when changing a file extension defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false - # Save to disk (not to iCloud) by default - defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false # Automatically quit printer app once the print jobs complete defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true # Check for software updates daily, not just once per week defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 - # Disable smart quotes as they’re annoying when typing code - defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false - # Disable smart dashes as they’re annoying when typing code - defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false - # Trackpad: enable tap to click for this user and for the login screen - defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true - defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 - defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 # Automatically illuminate built-in MacBook keyboard in low light defaults write com.apple.BezelServices kDim -bool true # Turn off keyboard illumination when computer is not used for 5 minutes @@ -203,8 +167,6 @@ defaults: defaults write com.apple.finder DisableAllAnimations -bool true # Finder: show hidden files by default defaults write com.apple.Finder AppleShowAllFiles -bool true - # Finder: show all filename extensions - defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Finder: show path bar defaults write com.apple.finder ShowPathbar -bool true # Empty Trash securely by default @@ -220,7 +182,68 @@ defaults: sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -bool false # Keep this bit last # Kill affected applications - for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done + for app in Safari Finder Mail SystemUIServer; do killall "$$app" >/dev/null 2>&1; done + +defaults-dock: + # Enable the 2D Dock + defaults write com.apple.dock no-glass -bool true + # Automatically hide and show the Dock + defaults write com.apple.dock autohide -bool true + # Make Dock icons of hidden applications translucent + defaults write com.apple.dock showhidden -bool true + # Enable highlight hover effect for the grid view of a stack (Dock) + defaults write com.apple.dock mouse-over-hilte-stack -bool true + # Enable spring loading for all Dock items + defaults write enable-spring-load-actions-on-all-items -bool true + # Show indicator lights for open applications in the Dock + defaults write com.apple.dock show-process-indicators -bool true + # Don’t animate opening applications from the Dock + defaults write com.apple.dock launchanim -bool false + # clean up right side (persistent) + -defaults delete com.apple.dock persistent-others + # and add these folders + defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":3, "file-label":"Dropbox", "file-data":{"_CFURLString":"file:///Users/lukas/Dropbox/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":3, "file-label":"Desktop", "file-data":{"_CFURLString":"file:///Users/lukas/Desktop/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":3, "file-label":"Downloads", "file-data":{"_CFURLString":"file:///Users/lukas/Downloads/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + # restart dock + killall Dock + +defaults-NSGlobalDomain: + # Locale + defaults write NSGlobalDomain AppleLocale -string "en_US" + defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters" + defaults write NSGlobalDomain AppleMetricUnits -bool true + # 24-Hour Time + defaults write NSGlobalDomain AppleICUForce12HourTime -bool false + # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) + defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 + # Enable subpixel font rendering on non-Apple LCDs + defaults write NSGlobalDomain AppleFontSmoothing -int 2 + # Disable menu bar transparency + defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false + # Disable press-and-hold for keys in favor of key repeat + defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false + # Set a blazingly fast keyboard repeat rate + defaults write NSGlobalDomain KeyRepeat -int 0 + # Disable auto-correct + defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false + # Disable window animations + defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false + # Increase window resize speed for Cocoa applications + defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 + # Save to disk (not to iCloud) by default + defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false + # Disable smart quotes as they’re annoying when typing code + defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false + # Disable smart dashes as they’re annoying when typing code + defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false + # Trackpad: enable tap to click for this user and for the login screen + defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true + defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 + defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 + # Finder: show all filename extensions + defaults write NSGlobalDomain AppleShowAllExtensions -bool true + dotfiles: $(DOTFILES) diff --git a/README.md b/README.md index 145950e..c2d6045 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,7 @@ The Makefile contains sections for installing \*nix command line utilities, macO ├── .tm_properties # configuration for TextMate ├── .vimrc # a great .vimrc with comments ├── decrypt.sh # decrypt sensitive files and put them in place - ├── encrypt.sh # simple wrapper to encrypt sensitive files for storage - ├── Makefile # this Makefile controls all sections of this project - └── bootstrap.sh # 0-100 bootstrap script for a new freshly installed Mac + └── encrypt.sh # simple wrapper to encrypt sensitive files for storage ## Credits @@ -41,5 +39,6 @@ This seletion of dotfiles and system settings would not be possible with the gre * https://github.com/matijs/dotfiles * https://github.com/paulirish/dotfiles * https://github.com/why-jay/osx-init +* https://github.com/simonmcc/osx-bootstrap/blob/master/osx-user-defaults.sh * http://dotfiles.github.io * https://www.stackoverflow.com/ :) From b58301a7ff76408908b6cda5c32ad256e67668d3 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 11 Mar 2018 00:05:24 +0100 Subject: [PATCH 13/63] add config section to execute custom configs --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 722e9a1..3cf31d6 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ all: \ vim \ tmux \ dotfiles \ + config \ defaults brew: \ @@ -244,6 +245,12 @@ defaults-NSGlobalDomain: # Finder: show all filename extensions defaults write NSGlobalDomain AppleShowAllExtensions -bool true +config: \ + config-ssh + +config-ssh: + # Store the ssh-key passphrase in the keychain + ssh-add -K ~/.ssh/id_rsa dotfiles: $(DOTFILES) From e874eb363d6836c0f991eddb93293eb28eb30649 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 11 Mar 2018 00:07:08 +0100 Subject: [PATCH 14/63] correct vim directories --- .vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vimrc b/.vimrc index f9c9350..d896a80 100644 --- a/.vimrc +++ b/.vimrc @@ -213,8 +213,8 @@ set smartcase set nofoldenable " directories for backup, tmp and swp files -set backupdir=~/.vimtmp/backup -set directory=~/.vimtmp/swap +set backupdir=~/.vim/tmp/backup +set directory=~/.vim/tmp/swap " save an undofile to be able to undo changes after closing files set undofile From a2365d674333bb4828501b1ff69f399075ff9176 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 11 Mar 2018 00:45:22 +0100 Subject: [PATCH 15/63] add defaults for Calendar, cleanup and some fixes for make vim --- .vim/colors/Tomorrow-Night.vim | 362 --------------------------------- .vim/colors/paramount.vim | 198 ------------------ .vim/snippets/ruby.snippets | 5 - .vimrc | 3 + Makefile | 44 ++-- 5 files changed, 32 insertions(+), 580 deletions(-) delete mode 100644 .vim/colors/Tomorrow-Night.vim delete mode 100644 .vim/colors/paramount.vim delete mode 100644 .vim/snippets/ruby.snippets diff --git a/.vim/colors/Tomorrow-Night.vim b/.vim/colors/Tomorrow-Night.vim deleted file mode 100644 index 208b6d4..0000000 --- a/.vim/colors/Tomorrow-Night.vim +++ /dev/null @@ -1,362 +0,0 @@ -" Tomorrow Night - Full Colour and 256 Colour -" http://chriskempson.com -" -" Hex colour conversion functions borrowed from the theme "Desert256"" - -" Default GUI Colours -let s:foreground = "c5c8c6" -let s:background = "1d1f21" -let s:selection = "373b41" -let s:line = "282a2e" -let s:comment = "969896" -let s:red = "cc6666" -let s:orange = "de935f" -let s:yellow = "f0c674" -let s:green = "b5bd68" -let s:aqua = "8abeb7" -let s:blue = "81a2be" -let s:purple = "b294bb" -let s:window = "4d5057" - -" Console 256 Colours -if !has("gui_running") - let s:background = "303030" - let s:window = "5e5e5e" - let s:line = "3a3a3a" - let s:selection = "585858" -end - -set background=dark -hi clear -syntax reset - -let g:colors_name = "Tomorrow-Night" - -if has("gui_running") || &t_Co == 88 || &t_Co == 256 - " Returns an approximate grey index for the given grey level - fun grey_number(x) - if &t_Co == 88 - if a:x < 23 - return 0 - elseif a:x < 69 - return 1 - elseif a:x < 103 - return 2 - elseif a:x < 127 - return 3 - elseif a:x < 150 - return 4 - elseif a:x < 173 - return 5 - elseif a:x < 196 - return 6 - elseif a:x < 219 - return 7 - elseif a:x < 243 - return 8 - else - return 9 - endif - else - if a:x < 14 - return 0 - else - let l:n = (a:x - 8) / 10 - let l:m = (a:x - 8) % 10 - if l:m < 5 - return l:n - else - return l:n + 1 - endif - endif - endif - endfun - - " Returns the actual grey level represented by the grey index - fun grey_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 46 - elseif a:n == 2 - return 92 - elseif a:n == 3 - return 115 - elseif a:n == 4 - return 139 - elseif a:n == 5 - return 162 - elseif a:n == 6 - return 185 - elseif a:n == 7 - return 208 - elseif a:n == 8 - return 231 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 8 + (a:n * 10) - endif - endif - endfun - - " Returns the palette index for the given grey index - fun grey_colour(n) - if &t_Co == 88 - if a:n == 0 - return 16 - elseif a:n == 9 - return 79 - else - return 79 + a:n - endif - else - if a:n == 0 - return 16 - elseif a:n == 25 - return 231 - else - return 231 + a:n - endif - endif - endfun - - " Returns an approximate colour index for the given colour level - fun rgb_number(x) - if &t_Co == 88 - if a:x < 69 - return 0 - elseif a:x < 172 - return 1 - elseif a:x < 230 - return 2 - else - return 3 - endif - else - if a:x < 75 - return 0 - else - let l:n = (a:x - 55) / 40 - let l:m = (a:x - 55) % 40 - if l:m < 20 - return l:n - else - return l:n + 1 - endif - endif - endif - endfun - - " Returns the actual colour level for the given colour index - fun rgb_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 139 - elseif a:n == 2 - return 205 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 55 + (a:n * 40) - endif - endif - endfun - - " Returns the palette index for the given R/G/B colour indices - fun rgb_colour(x, y, z) - if &t_Co == 88 - return 16 + (a:x * 16) + (a:y * 4) + a:z - else - return 16 + (a:x * 36) + (a:y * 6) + a:z - endif - endfun - - " Returns the palette index to approximate the given R/G/B colour levels - fun colour(r, g, b) - " Get the closest grey - let l:gx = grey_number(a:r) - let l:gy = grey_number(a:g) - let l:gz = grey_number(a:b) - - " Get the closest colour - let l:x = rgb_number(a:r) - let l:y = rgb_number(a:g) - let l:z = rgb_number(a:b) - - if l:gx == l:gy && l:gy == l:gz - " There are two possibilities - let l:dgr = grey_level(l:gx) - a:r - let l:dgg = grey_level(l:gy) - a:g - let l:dgb = grey_level(l:gz) - a:b - let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) - let l:dr = rgb_level(l:gx) - a:r - let l:dg = rgb_level(l:gy) - a:g - let l:db = rgb_level(l:gz) - a:b - let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) - if l:dgrey < l:drgb - " Use the grey - return grey_colour(l:gx) - else - " Use the colour - return rgb_colour(l:x, l:y, l:z) - endif - else - " Only one possibility - return rgb_colour(l:x, l:y, l:z) - endif - endfun - - " Returns the palette index to approximate the 'rrggbb' hex string - fun rgb(rgb) - let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 - let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 - let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 - - return colour(l:r, l:g, l:b) - endfun - - " Sets the highlighting for the given group - fun X(group, fg, bg, attr) - if a:fg != "" - exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) - endif - if a:bg != "" - exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) - endif - if a:attr != "" - exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr - endif - endfun - - " Vim Highlighting - call X("Normal", s:foreground, s:background, "") - call X("LineNr", s:selection, "", "") - call X("NonText", s:selection, "", "") - call X("SpecialKey", s:selection, "", "") - call X("Search", s:background, s:yellow, "") - call X("TabLine", s:foreground, s:background, "reverse") - call X("StatusLine", s:window, s:yellow, "reverse") - call X("StatusLineNC", s:window, s:foreground, "reverse") - call X("VertSplit", s:window, s:window, "none") - call X("Visual", "", s:selection, "") - call X("Directory", s:blue, "", "") - call X("ModeMsg", s:green, "", "") - call X("MoreMsg", s:green, "", "") - call X("Question", s:green, "", "") - call X("WarningMsg", s:red, "", "") - call X("MatchParen", "", s:selection, "") - call X("Folded", s:comment, s:background, "") - call X("FoldColumn", "", s:background, "") - if version >= 700 - call X("CursorLine", "", s:line, "none") - call X("CursorColumn", "", s:line, "none") - call X("PMenu", s:foreground, s:selection, "none") - call X("PMenuSel", s:foreground, s:selection, "reverse") - call X("SignColumn", "", s:background, "none") - end - if version >= 703 - call X("ColorColumn", "", s:line, "none") - end - - " Standard Highlighting - call X("Comment", s:comment, "", "") - call X("Todo", s:comment, s:background, "") - call X("Title", s:comment, "", "") - call X("Identifier", s:red, "", "none") - call X("Statement", s:foreground, "", "") - call X("Conditional", s:foreground, "", "") - call X("Repeat", s:foreground, "", "") - call X("Structure", s:purple, "", "") - call X("Function", s:blue, "", "") - call X("Constant", s:orange, "", "") - call X("String", s:green, "", "") - call X("Special", s:foreground, "", "") - call X("PreProc", s:purple, "", "") - call X("Operator", s:aqua, "", "none") - call X("Type", s:blue, "", "none") - call X("Define", s:purple, "", "none") - call X("Include", s:blue, "", "") - "call X("Ignore", "666666", "", "") - - " Vim Highlighting - call X("vimCommand", s:red, "", "none") - - " C Highlighting - call X("cType", s:yellow, "", "") - call X("cStorageClass", s:purple, "", "") - call X("cConditional", s:purple, "", "") - call X("cRepeat", s:purple, "", "") - - " PHP Highlighting - call X("phpVarSelector", s:red, "", "") - call X("phpKeyword", s:purple, "", "") - call X("phpRepeat", s:purple, "", "") - call X("phpConditional", s:purple, "", "") - call X("phpStatement", s:purple, "", "") - call X("phpMemberSelector", s:foreground, "", "") - - " Ruby Highlighting - call X("rubySymbol", s:green, "", "") - call X("rubyConstant", s:yellow, "", "") - call X("rubyAttribute", s:blue, "", "") - call X("rubyInclude", s:blue, "", "") - call X("rubyLocalVariableOrMethod", s:orange, "", "") - call X("rubyCurlyBlock", s:orange, "", "") - call X("rubyStringDelimiter", s:green, "", "") - call X("rubyInterpolationDelimiter", s:orange, "", "") - call X("rubyConditional", s:purple, "", "") - call X("rubyRepeat", s:purple, "", "") - - " Python Highlighting - call X("pythonInclude", s:purple, "", "") - call X("pythonStatement", s:purple, "", "") - call X("pythonConditional", s:purple, "", "") - call X("pythonFunction", s:blue, "", "") - - " JavaScript Highlighting - call X("javaScriptBraces", s:foreground, "", "") - call X("javaScriptFunction", s:purple, "", "") - call X("javaScriptConditional", s:purple, "", "") - call X("javaScriptRepeat", s:purple, "", "") - call X("javaScriptNumber", s:orange, "", "") - call X("javaScriptMember", s:orange, "", "") - - " HTML Highlighting - call X("htmlTag", s:red, "", "") - call X("htmlTagName", s:red, "", "") - call X("htmlArg", s:red, "", "") - call X("htmlScriptTag", s:red, "", "") - - " Diff Highlighting - call X("diffAdded", s:green, "", "") - call X("diffRemoved", s:red, "", "") - - " ShowMarks Highlighting - call X("ShowMarksHLl", s:orange, s:background, "none") - call X("ShowMarksHLo", s:purple, s:background, "none") - call X("ShowMarksHLu", s:yellow, s:background, "none") - call X("ShowMarksHLm", s:aqua, s:background, "none") - - " Delete Functions - delf X - delf rgb - delf colour - delf rgb_colour - delf rgb_level - delf rgb_number - delf grey_colour - delf grey_level - delf grey_number -endif diff --git a/.vim/colors/paramount.vim b/.vim/colors/paramount.vim deleted file mode 100644 index 25500ed..0000000 --- a/.vim/colors/paramount.vim +++ /dev/null @@ -1,198 +0,0 @@ -" Name: paramount.vim -" Version: 0.1.0 -" Maintainer: github.com/owickstrom -" License: The MIT License (MIT) -" -" A minimal colorscheme for Vim that only puts emphasis on the paramount. -" -" Based on the pencil and off colorschemes: -" -" https://github.com/reedes/vim-colors-pencil -" https://github.com/reedes/vim-colors-off -" -""" -hi clear - -if exists('syntax on') - syntax reset -endif - -let g:colors_name='paramount' - -let s:black = { "gui": "#212121", "cterm": "235" } -let s:medium_gray = { "gui": "#767676", "cterm": "243" } -let s:white = { "gui": "#F1F1F1", "cterm": "15" } -let s:actual_white = { "gui": "#FFFFFF", "cterm": "231" } -let s:light_black = { "gui": "#424242", "cterm": "238" } -let s:lighter_black = { "gui": "#545454", "cterm": "240" } -let s:subtle_black = { "gui": "#303030", "cterm": "236" } -let s:light_gray = { "gui": "#B2B2B2", "cterm": "249" } -let s:lighter_gray = { "gui": "#C6C6C6", "cterm": "251" } -let s:lightest_gray = { "gui": "#DADADA", "cterm": "253" } -let s:pink = { "gui": "#fb007a", "cterm": "9" } -let s:dark_red = { "gui": "#C30771", "cterm": "1" } -let s:light_red = { "gui": "#E32791", "cterm": "1" } -let s:orange = { "gui": "#D75F5F", "cterm": "167" } -let s:darker_blue = { "gui": "#005F87", "cterm": "18" } -let s:dark_blue = { "gui": "#008EC4", "cterm": "4" } -let s:blue = { "gui": "#20BBFC", "cterm": "12" } -let s:light_blue = { "gui": "#b6d6fd", "cterm": "153" } -let s:dark_cyan = { "gui": "#20A5BA", "cterm": "6" } -let s:light_cyan = { "gui": "#4FB8CC", "cterm": "14" } -let s:dark_green = { "gui": "#10A778", "cterm": "2" } -let s:light_green = { "gui": "#5FD7A7", "cterm": "10" } -let s:dark_purple = { "gui": "#af5fd7", "cterm": "134" } -let s:light_purple = { "gui": "#a790d5", "cterm": "140" } -let s:yellow = { "gui": "#F3E430", "cterm": "11" } -let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" } - -if &background == "dark" - let s:bg = s:black - let s:bg_subtle = s:lighter_black - let s:bg_very_subtle = s:subtle_black - let s:norm = s:lighter_gray - let s:norm_subtle = s:medium_gray - let s:purple = s:light_purple - let s:cyan = s:light_cyan - let s:green = s:light_green - let s:red = s:light_red - let s:visual = s:light_purple -else - let s:bg = s:actual_white - let s:bg_subtle = s:light_gray - let s:bg_very_subtle = s:lightest_gray - let s:norm = s:light_black - let s:norm_subtle = s:medium_gray - let s:purple = s:dark_purple - let s:cyan = s:dark_cyan - let s:green = s:dark_green - let s:red = s:dark_red - let s:visual = s:dark_purple -endif - -" https://github.com/noahfrederick/vim-hemisu/ -function! s:h(group, style) - execute "highlight" a:group - \ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE") - \ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE") - \ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE") - \ "gui=" (has_key(a:style, "gui") ? a:style.gui : "NONE") - \ "ctermfg=" (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE") - \ "ctermbg=" (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE") - \ "cterm=" (has_key(a:style, "cterm") ? a:style.cterm : "NONE") -endfunction - -call s:h("Normal", {"bg": s:bg, "fg": s:norm}) -call s:h("Cursor", {"bg": s:purple, "fg": s:norm }) -call s:h("Comment", {"fg": s:bg_subtle, "gui": "italic"}) - -call s:h("Constant", {"fg": s:purple}) -hi! link Character Constant -hi! link Number Constant -hi! link Boolean Constant -hi! link Float Constant -hi! link String Constant - -"call s:h("Identifier", {"fg": s:dark_blue}) -hi! link Identifier Normal -hi! link Function Identifier - -call s:h("Statement", {"fg": s:norm_subtle}) -hi! link Conditonal Statement -hi! link Repeat Statement -hi! link Label Statement -hi! link Keyword Statement -hi! link Exception Statement - -call s:h("Operator", {"fg": s:norm, "cterm": "bold", "gui": "bold"}) - -call s:h("PreProc", {"fg": s:norm_subtle}) -hi! link Include PreProc -hi! link Define PreProc -hi! link Macro PreProc -hi! link PreCondit PreProc - -call s:h("Type", {"fg": s:norm}) -hi! link StorageClass Type -hi! link Structure Type -hi! link Typedef Type - -call s:h("Special", {"fg": s:norm_subtle, "gui": "italic"}) -hi! link SpecialChar Special -hi! link Tag Special -hi! link Delimiter Special -hi! link SpecialComment Special -hi! link Debug Special - -call s:h("Underlined", {"fg": s:norm, "gui": "underline", "cterm": "underline"}) -call s:h("Ignore", {"fg": s:bg}) -call s:h("Error", {"fg": s:actual_white, "bg": s:red, "cterm": "bold"}) -call s:h("Todo", {"fg": s:purple, "gui": "underline", "cterm": "underline"}) -call s:h("SpecialKey", {"fg": s:light_green}) -call s:h("NonText", {"fg": s:medium_gray}) -call s:h("Directory", {"fg": s:dark_blue}) -call s:h("ErrorMsg", {"fg": s:pink}) -call s:h("IncSearch", {"bg": s:yellow, "fg": s:light_black}) -call s:h("Search", {"bg": s:bg_subtle}) -call s:h("MoreMsg", {"fg": s:medium_gray, "cterm": "bold", "gui": "bold"}) -hi! link ModeMsg MoreMsg -call s:h("LineNr", {"fg": s:bg_subtle}) -call s:h("CursorLineNr", {"fg": s:purple, "bg": s:bg_very_subtle}) -call s:h("Question", {"fg": s:red}) -call s:h("StatusLine", {"bg": s:bg_very_subtle}) -call s:h("StatusLineNC", {"bg": s:bg_very_subtle, "fg": s:medium_gray}) -call s:h("VertSplit", {"bg": s:bg_very_subtle, "fg": s:bg_very_subtle}) -call s:h("Title", {"fg": s:dark_blue}) -call s:h("Visual", {"fg": s:norm, "bg": s:visual}) -call s:h("VisualNOS", {"bg": s:bg_subtle}) -call s:h("WarningMsg", {"fg": s:red}) -call s:h("WildMenu", {"fg": s:bg, "bg": s:norm}) -call s:h("Folded", {"fg": s:medium_gray}) -call s:h("FoldColumn", {"fg": s:bg_subtle}) -call s:h("DiffAdd", {"fg": s:green}) -call s:h("DiffDelete", {"fg": s:red}) -call s:h("DiffChange", {"fg": s:dark_yellow}) -call s:h("DiffText", {"fg": s:dark_blue}) -call s:h("SignColumn", {"fg": s:light_green}) - -if has("gui_running") - call s:h("SpellBad", {"gui": "underline", "sp": s:red}) - call s:h("SpellCap", {"gui": "underline", "sp": s:light_green}) - call s:h("SpellRare", {"gui": "underline", "sp": s:pink}) - call s:h("SpellLocal", {"gui": "underline", "sp": s:dark_green}) -else - call s:h("SpellBad", {"cterm": "underline", "fg": s:red}) - call s:h("SpellCap", {"cterm": "underline", "fg": s:light_green}) - call s:h("SpellRare", {"cterm": "underline", "fg": s:pink}) - call s:h("SpellLocal", {"cterm": "underline", "fg": s:dark_green}) -endif - -call s:h("Pmenu", {"fg": s:norm, "bg": s:bg_subtle}) -call s:h("PmenuSel", {"fg": s:norm, "bg": s:purple}) -call s:h("PmenuSbar", {"fg": s:norm, "bg": s:bg_subtle}) -call s:h("PmenuThumb", {"fg": s:norm, "bg": s:bg_subtle}) -call s:h("TabLine", {"fg": s:norm, "bg": s:bg_very_subtle}) -call s:h("TabLineSel", {"fg": s:purple, "bg": s:bg_subtle, "gui": "bold", "cterm": "bold"}) -call s:h("TabLineFill", {"fg": s:norm, "bg": s:bg_very_subtle}) -call s:h("CursorColumn", {"bg": s:bg_very_subtle}) -call s:h("CursorLine", {"bg": s:bg_very_subtle}) -call s:h("ColorColumn", {"bg": s:bg_subtle}) - -call s:h("MatchParen", {"bg": s:bg_subtle, "fg": s:norm}) -call s:h("qfLineNr", {"fg": s:medium_gray}) - -call s:h("htmlH1", {"bg": s:bg, "fg": s:norm}) -call s:h("htmlH2", {"bg": s:bg, "fg": s:norm}) -call s:h("htmlH3", {"bg": s:bg, "fg": s:norm}) -call s:h("htmlH4", {"bg": s:bg, "fg": s:norm}) -call s:h("htmlH5", {"bg": s:bg, "fg": s:norm}) -call s:h("htmlH6", {"bg": s:bg, "fg": s:norm}) - -" Signify, git-gutter -hi link SignifySignAdd LineNr -hi link SignifySignDelete LineNr -hi link SignifySignChange LineNr -hi link GitGutterAdd LineNr -hi link GitGutterDelete LineNr -hi link GitGutterChange LineNr -hi link GitGutterChangeDelete LineNr diff --git a/.vim/snippets/ruby.snippets b/.vim/snippets/ruby.snippets deleted file mode 100644 index 195bc52..0000000 --- a/.vim/snippets/ruby.snippets +++ /dev/null @@ -1,5 +0,0 @@ -snippet test - test "${1:method_name}" do - ${2} - end - diff --git a/.vimrc b/.vimrc index d896a80..10ff9be 100644 --- a/.vimrc +++ b/.vimrc @@ -154,6 +154,9 @@ Plugin 'tpope/vim-fugitive' " Mainly working with bash .sh scripts let g:is_bash=1 +" Install colorschema paramount +Plugin 'owickstrom/vim-colors-paramount' + call vundle#end() filetype plugin indent on diff --git a/Makefile b/Makefile index 3cf31d6..cffb4cc 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,10 @@ brew: \ brew install jq --HEAD # pipeviewer allows to display throughput/eta information on unix pipes brew install pv + # pstree is nice to look at + brew install pstree + # watch is great for building an overview on running stuff + brew install watch /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -105,11 +109,15 @@ vim-itself: # newer version of vim brew install vim --with-override-system-vi # create vim directories - mkdir -p .vim/tmp/{backup,swap,undo} + mkdir -p ~/.vim/tmp/{backup,swap,undo} vim-plugins: \ ~/.vim/bundle/Vundle.vim - vim +PluginInstall +qall + # disable colorscheme for installing plugins to a temporary .vimrc + sed 's/colorscheme/"colorscheme/' .vimrc > /tmp/.vimrc + # install plugins with temporary vimrc + vim -u /tmp/.vimrc +PluginInstall +qall + -rm /tmp/.vimrc # install vundle, a vim package manager ~/.vim/bundle/Vundle.vim: @@ -127,18 +135,14 @@ tmux: \ git clone --depth=10 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm defaults: \ - defaults-dock + defaults-Dock \ + defaults-NSGlobalDomain \ + defaults-Calendar # Show remaining battery time; hide percentage defaults write com.apple.menuextra.battery ShowPercent -string "NO" defaults write com.apple.menuextra.battery ShowTime -string "YES" # Enable AirDrop over Ethernet and on unsupported Macs running Lion defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true - # Disable disk image verification - # defaults write com.apple.frameworks.diskimages skip-verify -bool true - # defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true - # defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true - # Disable the “Are you sure you want to open this application?” dialog - # defaults write com.apple.LaunchServices LSQuarantine -bool false # Automatically open a new Finder window when a volume is mounted defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true @@ -185,7 +189,7 @@ defaults: \ # Kill affected applications for app in Safari Finder Mail SystemUIServer; do killall "$$app" >/dev/null 2>&1; done -defaults-dock: +defaults-Dock: # Enable the 2D Dock defaults write com.apple.dock no-glass -bool true # Automatically hide and show the Dock @@ -203,9 +207,9 @@ defaults-dock: # clean up right side (persistent) -defaults delete com.apple.dock persistent-others # and add these folders - defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":3, "file-label":"Dropbox", "file-data":{"_CFURLString":"file:///Users/lukas/Dropbox/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; - defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":3, "file-label":"Desktop", "file-data":{"_CFURLString":"file:///Users/lukas/Desktop/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; - defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":3, "file-label":"Downloads", "file-data":{"_CFURLString":"file:///Users/lukas/Downloads/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":1, "file-label":"Dropbox", "file-data":{"_CFURLString":"file:///Users/lukas/Dropbox/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":1, "file-label":"Desktop", "file-data":{"_CFURLString":"file:///Users/lukas/Desktop/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; + defaults write com.apple.dock persistent-others -array-add "$$(echo '{"tile-type": "directory-tile", "tile-data": {"displayas": 0, "file-type":2, "showas":1, "file-label":"Downloads", "file-data":{"_CFURLString":"file:///Users/lukas/Downloads/","_CFURLStringType":15}}}' | plutil -convert xml1 - -o -)"; # restart dock killall Dock @@ -226,8 +230,8 @@ defaults-NSGlobalDomain: defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false # Set a blazingly fast keyboard repeat rate defaults write NSGlobalDomain KeyRepeat -int 0 - # Disable auto-correct - defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false + # Enable auto-correct + defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool true # Disable window animations defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false # Increase window resize speed for Cocoa applications @@ -245,6 +249,16 @@ defaults-NSGlobalDomain: # Finder: show all filename extensions defaults write NSGlobalDomain AppleShowAllExtensions -bool true +defaults-Calendar: + # Show week numbers (10.8 only) + defaults write com.apple.iCal "Show Week Numbers" -bool true + # Show 7 days + defaults write com.apple.iCal "n days of week" -int 7 + # Week starts on monday + defaults write com.apple.iCal "first day of week" -int 1 + # Show event times + defaults write com.apple.iCal "Show time in Month View" -bool true + config: \ config-ssh From 6a747fdac8c107b5b6acd68dfa9942effde9218b Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 11 Mar 2018 17:39:02 +0100 Subject: [PATCH 16/63] Update README.md --- README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c2d6045..65040e1 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,28 @@ On a new mac, open a Terminal and run: ## Maintenance -Enter the `~/dotfiles` directory, make changes and make it: +Enter the `~/dotfiles` directory, make changes and `make` it: cd ~/dotfiles make The Makefile contains sections for installing \*nix command line utilities, macOS applications, macOS settings and maintaing specific configurations. +So you can also only re-make a section of the project, for example the macOS dock settings: + + cd ~/dotfiles + make defaults-Dock + +Or only rebuild your vim: + + cd ~/dotfiles + make vim + +Or upgrade all installed packages: + + cd ~/dotfiles + make brew + ## Contents . @@ -33,7 +48,7 @@ The Makefile contains sections for installing \*nix command line utilities, macO ## Credits -This seletion of dotfiles and system settings would not be possible with the great examples provided by: +This seletion of dotfiles and system settings would not be possible without the great examples provided by: * https://github.com/mathiasbynens/dotfiles * https://github.com/matijs/dotfiles From 63099e3626bf726f396c744ccb9fc21a68c2ee2f Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 11 Mar 2018 17:40:16 +0100 Subject: [PATCH 17/63] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 65040e1..cf1fe52 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ On a new mac, open a Terminal and run: - curl https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh | bash + curl -O https://raw.githubusercontent.com/Overbryd/dotfiles/master/bootstrap.sh + chmod +x bootstrap.sh + ./bootstrap.sh ## Maintenance From 1691d7e1e4f96be2c9d4dfc95258962c75d98097 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 12 Mar 2018 17:00:46 +0100 Subject: [PATCH 18/63] set dns servers and enable press and hold behaviour --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index cffb4cc..165a8b7 100644 --- a/Makefile +++ b/Makefile @@ -185,6 +185,8 @@ defaults: \ chflags nohidden ~/Library # disable apple captive portal (seucrity issue) sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.captive.control Active -bool false + # setup Quad9 DNS + networksetup -setdnsservers Wi-Fi 9.9.9.9 # Keep this bit last # Kill affected applications for app in Safari Finder Mail SystemUIServer; do killall "$$app" >/dev/null 2>&1; done @@ -226,8 +228,8 @@ defaults-NSGlobalDomain: defaults write NSGlobalDomain AppleFontSmoothing -int 2 # Disable menu bar transparency defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false - # Disable press-and-hold for keys in favor of key repeat - defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false + # Enable press-and-hold for keys + defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true # Set a blazingly fast keyboard repeat rate defaults write NSGlobalDomain KeyRepeat -int 0 # Enable auto-correct From f8b793d6993652f1971445777afe4fb5349f26e8 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 12 Mar 2018 17:15:30 +0100 Subject: [PATCH 19/63] add vim/command-t post installation step --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 165a8b7..36aa96d 100644 --- a/Makefile +++ b/Makefile @@ -118,6 +118,8 @@ vim-plugins: \ # install plugins with temporary vimrc vim -u /tmp/.vimrc +PluginInstall +qall -rm /tmp/.vimrc + # post installation steps of command-t + cd ~/.vim/bundle/command-t/ruby/command-t/ext/command-t && ruby extconf.rb && make # install vundle, a vim package manager ~/.vim/bundle/Vundle.vim: From 9887cd01358076d913bcddb458706f5621503881 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 12 Mar 2018 17:30:06 +0100 Subject: [PATCH 20/63] add make section to build and manage ruby with rbenv --- Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Makefile b/Makefile index 36aa96d..41f1f55 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ all: \ brew \ casks \ bash \ + ruby \ vim \ tmux \ dotfiles \ @@ -92,6 +93,8 @@ casks: \ brew cask install textmate # Flux reduces blue/green colors on the display spectrum and helps me sleep better brew cask install flux + # slack is my preferred team chat + brew cask install slack bash: # newer version of bash @@ -101,6 +104,34 @@ bash: echo "/usr/local/bin/bash" | sudo tee -a /etc/shells chsh -s /usr/local/bin/bash +ruby: \ + ~/.rbenv \ + ~/.rbenv/plugins/ruby-build \ + ~/.rbenv/plugins/rbenv-update \ + ~/.rbenv/plugins/rbenv-readline \ + ~/.rbenv/plugins/rbenv-gemset + +# rbenv is an amazing ruby version manager, simple, straightforward, local +~/.rbenv: + git clone https://github.com/rbenv/rbenv.git ~/.rbenv + cd ~/.rbenv && src/configure && make -C src + +# ruby-build is a repository hosting all kinds of ruby versions to install +~/.rbenv/plugins/ruby-build: + git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build + +# rbenv-update allows updating rbenv plugins easily +~/.rbenv/plugins/rbenv-update: + git clone https://github.com/rkh/rbenv-update.git ~/.rbenv/plugins/rbenv-update + +# rbenv-readline does the right thing when it comes to linking a brew installed readline to ruby +~/.rbenv/plugins/rbenv-readline: + git clone git://github.com/tpope/rbenv-readline.git ~/.rbenv/plugins/rbenv-readline + +# rbenv-gemset allows managing project specific set of gems +~/.rbenv/plugins/rbenv-gemset: + git clone git://github.com/jf/rbenv-gemset.git ~/.rbenv/plugins/rbenv-gemset + vim: \ vim-itself \ vim-plugins From 8e34492d6ea39067d00e54910ed68a907d31cd02 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 12 Mar 2018 17:47:04 +0100 Subject: [PATCH 21/63] fix high key repeat rate for macOS high sierra --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 41f1f55..426fff9 100644 --- a/Makefile +++ b/Makefile @@ -262,9 +262,11 @@ defaults-NSGlobalDomain: # Disable menu bar transparency defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false # Enable press-and-hold for keys - defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true - # Set a blazingly fast keyboard repeat rate - defaults write NSGlobalDomain KeyRepeat -int 0 + defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false + # Set a blazingly fast keyboard repeat rate (1 = fastest for macOS high sierra, older versions support 0) + defaults write NSGlobalDomain KeyRepeat -int 1 + # Decrase the time to initially trigger key repeat + defaults write NSGlobalDomain InitialKeyRepeat -int 10 # Enable auto-correct defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool true # Disable window animations From 1d7596f6bc53c7c90931c19085b8ef9e786c1798 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Tue, 13 Mar 2018 11:08:09 +0100 Subject: [PATCH 22/63] add launchbar, god I love this tool --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 426fff9..385eafd 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,8 @@ casks: \ brew cask install flux # slack is my preferred team chat brew cask install slack + # launchbar is my preferred app launcher/clipboard history, calculator and goto mac utility + brew cask install launchbar bash: # newer version of bash From 7c687fd68f69dd54b97b8dc7d9ad442ced4d7b56 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 11:38:17 +0100 Subject: [PATCH 23/63] Add 1 git-crypt collaborator New collaborators: 784E1A78 Lukas Rieder --- .git-crypt/.gitattributes | 4 ++++ .../716AB422E5AF3B07CD08D61C4905A8AC784E1A78.gpg | Bin 0 -> 725 bytes 2 files changed, 4 insertions(+) create mode 100644 .git-crypt/.gitattributes create mode 100644 .git-crypt/keys/default/0/716AB422E5AF3B07CD08D61C4905A8AC784E1A78.gpg diff --git a/.git-crypt/.gitattributes b/.git-crypt/.gitattributes new file mode 100644 index 0000000..665b10e --- /dev/null +++ b/.git-crypt/.gitattributes @@ -0,0 +1,4 @@ +# Do not edit this file. To specify the files to encrypt, create your own +# .gitattributes file in the directory where your files are. +* !filter !diff +*.gpg binary diff --git a/.git-crypt/keys/default/0/716AB422E5AF3B07CD08D61C4905A8AC784E1A78.gpg b/.git-crypt/keys/default/0/716AB422E5AF3B07CD08D61C4905A8AC784E1A78.gpg new file mode 100644 index 0000000000000000000000000000000000000000..184e033b696a59fb62f2a9047372a4b5c5c2729c GIT binary patch literal 725 zcmV;`0xJE50t^F}71Gr!IH-#O5Bv>oOc@a$19%$uk&mNH9!FJ|@Nuu%DAHUpacpHx zW%WnAiSA{Dn4JX&x}Oc_kq_=x?HwYr6tgZSyt(m1nx3W`{qdO@!Diyh*J8mv#g#FU@7&Zt4KpZzj}-UvJ}O*@ze|HHSUo; z=Ta7am$7^iiY8FghQ9s41mQK0N@KwX92N8Rq>|3~p;}PrtR1f1lg}Za+!%kM!268^ zu)IX4mIpqGflo#ZA+LJW6|oM`3g}&8q*GTSzZv|s=BLN96ajra!nsgX6J!!~q0>gr z7mlLk^7+VQTV%@C)Hyl}GDaHA%2c%dmU$A-;Cv9Zlo50UVV}G&l!|8R1RjphOxUD0%DbI)*3 zS(JN>9B#c0bFeFQ9U!HD+iR9soy32)1TS6i#GfpN+b5jBc=*{8M1{p?;S7BrlArwd z8|;}eiI%SSgSz(i|1y5`##eW!dY)Gnr|{6sia_<@i&Ytbm|_L7zj7sGSC-^22SL9& zJuwjqzkiH0my00|9CDM>I=yYE1cF3XA$2+_{4Y`TmPynBvHnNMpM4Z3jp- zD&zg7_Q=Gd@=8ZkZ)=b{ykPQj&*Xo*=4h+RK(ru=UJJgCqsi{R!7CK44{-9Z^Tous z5DkD1VTqYGC3ybRH>~ Date: Wed, 14 Mar 2018 11:48:13 +0100 Subject: [PATCH 24/63] add git-crypt and encrypted .ssh/config --- .gitattributes | 4 +++- .gitignore | 8 +------- .ssh/config | Bin 0 -> 355 bytes 3 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 .ssh/config diff --git a/.gitattributes b/.gitattributes index 2125666..cfb837b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -* text=auto \ No newline at end of file +* text=auto +.ssh/config filter=git-crypt diff=git-crypt + diff --git a/.gitignore b/.gitignore index 76496b7..e60f10c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,11 +10,5 @@ Thumbs.db .Spotlight-V100 .Trashes -# vim plugins handled by vundle -.vim/bundle -!.vim/bundle/vundle - -.ssh/config -.ssh/wooga_heroku_id_rsa - +# Ruby byebug debugger history files .byebug_history diff --git a/.ssh/config b/.ssh/config new file mode 100644 index 0000000000000000000000000000000000000000..0127b4731dbe65e136781d037a872b75c558a61c GIT binary patch literal 355 zcmV-p0i6B-M@dveQdv+`0O|6{b~}L}3{B||gwEPgC|vpB-AlgBluFotLFETQqcT4g?>v=g)aTJa8L&xw;67A8)Iv%CIC~|2K)n)=o1#Tdl6jfok z3=wu?am=RwDkEMXUrpAqoCzl*YOz&(xOg{Fwx&6{5%+RK$TiqLrH6uYkjD}EaE1!= zN>S0flGNj>LXE!{se!Lt7X?`W07JB*{lk!zv>-$M!_|&IS)p-r#YTU^g5Vm~?zuvr zkwp;R4c( ztAsyWJ;uA|&9jpa$oGx`;p3n1TK_j4Q+5fHA^ce4B_9jI#jPPLM9!CN;iU`Nu6vXT BuGatn literal 0 HcmV?d00001 From 34673bc7b57e7c7405421d79d05ed920498c081a Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 11:51:29 +0100 Subject: [PATCH 25/63] reduce tmux configuration --- .tmux.conf | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 8e1a069..3492a1b 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -16,15 +16,11 @@ setw -g mouse on # monitor activity setw -g monitor-activity on -# status bar setup -set -g status-bg black -set -g status-fg white - # enable clipboard # set -g clipboard jn # reattach to user namespace to enable mac osx clipboard -set-option -g default-command "reattach-to-user-namespace -l $SHELL" +# set-option -g default-command "reattach-to-user-namespace -l $SHELL" # set faster escape time (ms) set escape-time 150 @@ -64,13 +60,3 @@ set -g status-right '' # increase scrollback lines set -g history-limit 10000 -# plugins, keep this section at the very bottom - -# tpm is the tmux plugin manager itself -set -g @plugin 'tmux-plugins/tpm' - -# persists tmux environment across system restarts -set -g @plugin 'tmux-plugins/tmux-resurrect' - -# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) -run '~/.tmux/plugins/tpm/tpm' From 13c1d132b8db2acde78463fe006e34f1cf102f26 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 11:52:42 +0100 Subject: [PATCH 26/63] split out ssh setup, slow down key repeat (it was too damn fast) and remove tmux cruft --- Makefile | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 385eafd..21fb5d8 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,6 @@ all: \ vim \ tmux \ dotfiles \ - config \ defaults brew: \ @@ -160,14 +159,7 @@ vim-plugins: \ tmux: \ ~/.tmux.conf \ - ~/.tmux/plugins/tpm brew install tmux - # install plugins - ~/.tmux/plugins/tpm/bin/install_plugins - -~/.tmux/plugins/tpm: - # install tmux plugin manager - git clone --depth=10 https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm defaults: \ defaults-Dock \ @@ -266,9 +258,9 @@ defaults-NSGlobalDomain: # Enable press-and-hold for keys defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false # Set a blazingly fast keyboard repeat rate (1 = fastest for macOS high sierra, older versions support 0) - defaults write NSGlobalDomain KeyRepeat -int 1 + defaults write NSGlobalDomain KeyRepeat -int 2 # Decrase the time to initially trigger key repeat - defaults write NSGlobalDomain InitialKeyRepeat -int 10 + defaults write NSGlobalDomain InitialKeyRepeat -int 15 # Enable auto-correct defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool true # Disable window animations @@ -298,14 +290,14 @@ defaults-Calendar: # Show event times defaults write com.apple.iCal "Show time in Month View" -bool true -config: \ - config-ssh +dotfiles: $(DOTFILES) -config-ssh: - # Store the ssh-key passphrase in the keychain - ssh-add -K ~/.ssh/id_rsa +dotfiles-ssh: + # Test that .ssh/config is decrypted (gpg has been setup) + grep "Host *" ~/dotfiles/.ssh/config + # Symlink .ssh/config + cd ~/.ssh && ln -sv ../dotfiles/.ssh/config . -dotfiles: $(DOTFILES) ~/.%: cd ~ && ln -sv dotfiles/$(notdir $@) $@ From b282a3894591a6f576421e295822b998d31cd5a0 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 11:54:02 +0100 Subject: [PATCH 27/63] remove AskPassGUI from .ssh/config --- .ssh/config | Bin 355 -> 336 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.ssh/config b/.ssh/config index 0127b4731dbe65e136781d037a872b75c558a61c..093388c3d5e3b5bb7b8bb22edb90798ea5da097b 100644 GIT binary patch literal 336 zcmV-W0k8f5M@dveQdv+`0EkIPdmg!PsBeXvB!kv?(y5qy1rt!7{%KT_6Y!fwm{87` zP%BMmq3Ca{gOjgsa6}@1c6Aby#6WSM4xnRPcT%gzYQQ3x4f*idmCfrzT-r z&srPfOtaZr=SoKPjK{r7%L}Y2BQo7D%6g(xb+T@wpWi%8e5#&4jB`D*Nnn5W(6U irDYUf;3^p?6%8VZrFvkNIIvgD=jSeg3u-_|L2>SV1)*{P literal 355 zcmV-p0i6B-M@dveQdv+`0O|6{b~}L}3{B||gwEPgC|vpB-AlgBluFotLFETQqcT4g?>v=g)aTJa8L&xw;67A8)Iv%CIC~|2K)n)=o1#Tdl6jfok z3=wu?am=RwDkEMXUrpAqoCzl*YOz&(xOg{Fwx&6{5%+RK$TiqLrH6uYkjD}EaE1!= zN>S0flGNj>LXE!{se!Lt7X?`W07JB*{lk!zv>-$M!_|&IS)p-r#YTU^g5Vm~?zuvr zkwp;R4c( ztAsyWJ;uA|&9jpa$oGx`;p3n1TK_j4Q+5fHA^ce4B_9jI#jPPLM9!CN;iU`Nu6vXT BuGatn From d91b591b36469db8cc9ea8c6a62ca34cd156c1b9 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 12:03:38 +0100 Subject: [PATCH 28/63] update .profile --- .profile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.profile b/.profile index 2acf8a9..ec46fa8 100644 --- a/.profile +++ b/.profile @@ -35,6 +35,11 @@ function tmate-start { eval "$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}')" } +function tms { + local name=$(basename $PWD) + tmux new -s $name +} + # Fancy prompt function git-prompt { if (git status >/dev/null 2>&1); then @@ -161,11 +166,9 @@ function bundle-open() { } # The next line updates PATH for the Google Cloud SDK. -if [ -f /usr/local/google-cloud-sdk/path.bash.inc ]; then - source '/usr/local/google-cloud-sdk/path.bash.inc' -fi - +source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.bash.inc' # The next line enables shell command completion for gcloud. -if [ -f /usr/local/google-cloud-sdk/completion.bash.inc ]; then - source '/usr/local/google-cloud-sdk/completion.bash.inc' -fi +source '/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.bash.inc' +# Source kubectl bash completion (generated with `kubectl completion bash > ~/.kube/bash_completion`) +source ~/.kube/bash_completion + From 3ce85ced302abc2380020f4a194e2dd194cc392c Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 12:06:02 +0100 Subject: [PATCH 29/63] add `make bootstrap` to run one-time setup tasks like restoring .gnupg from backup --- Makefile | 18 ++++++++++++++++-- bootstrap.sh | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 21fb5d8..c6582dc 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ -EXCLUDED_DOTFILES := .git .gitattributes .gitignore .gitmodules +EXCLUDED_DOTFILES := .git .gitattributes .gitignore .gitmodules .ssh DOTFILES := $(addprefix ~/, $(filter-out $(EXCLUDED_DOTFILES), $(wildcard .*))) +# everything, geared towards to be run for setup and maintenance all: \ brew \ casks \ @@ -11,6 +12,15 @@ all: \ dotfiles \ defaults +# bootstrap only, add one-time bootstrap tasks here +# setups everything +# restore .gnupg and thus decrypt the secrets from this repository +# setup ssh config (relies on decrypted repository) +bootstrap: \ + all \ + ~/.gnupg \ + ~/.ssh/config + brew: \ /usr/local/bin/brew # upgrade all installed packages @@ -292,12 +302,16 @@ defaults-Calendar: dotfiles: $(DOTFILES) -dotfiles-ssh: +~/.ssh/config: # Test that .ssh/config is decrypted (gpg has been setup) grep "Host *" ~/dotfiles/.ssh/config # Symlink .ssh/config cd ~/.ssh && ln -sv ../dotfiles/.ssh/config . +~/.gnupg: + # Ask where to get .gnupg from + @read -p "Where is .gnupg (from backup) located?" gnupg_source; + cp -v $$gnupg_source ~/.gnupg ~/.%: cd ~ && ln -sv dotfiles/$(notdir $@) $@ diff --git a/bootstrap.sh b/bootstrap.sh index d95028d..31a0f9b 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -20,4 +20,4 @@ softwareupdate -i "$PROD" -v # clone my dotfiles and make them git clone git@github.com:Overbryd/dotfiles.git ~/dotfiles -make -C ~/dotfiles +make -C ~/dotfiles bootstrap From ec480bba7a55103b306bba7e6c683f6032132e1d Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 12:10:23 +0100 Subject: [PATCH 30/63] add graphiql to casks --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index c6582dc..bb37472 100644 --- a/Makefile +++ b/Makefile @@ -106,6 +106,8 @@ casks: \ brew cask install slack # launchbar is my preferred app launcher/clipboard history, calculator and goto mac utility brew cask install launchbar + # graphiql helps debugging graphql based apis + brew cask install graphiql bash: # newer version of bash From 1ad3294a32f04f88e4e92124c79ad6154780a6e4 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 14 Mar 2018 12:18:18 +0100 Subject: [PATCH 31/63] add casks for graphical database clients --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index bb37472..6716ea6 100644 --- a/Makefile +++ b/Makefile @@ -108,6 +108,10 @@ casks: \ brew cask install launchbar # graphiql helps debugging graphql based apis brew cask install graphiql + # sequel-pro is a great graphical MySQL client + brew cask install sequel-pro + # postico is a great graphical PostgreSQL client + brew cask install postico bash: # newer version of bash From 52c9b86074ea915d6ca29ffef23b0715bb2061b3 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 19 Mar 2018 12:11:59 +0100 Subject: [PATCH 32/63] add docker setup to Makefile; tms just opens a session by name or creates one --- .profile | 2 +- Makefile | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index ec46fa8..f544923 100644 --- a/.profile +++ b/.profile @@ -37,7 +37,7 @@ function tmate-start { function tms { local name=$(basename $PWD) - tmux new -s $name + tmux new -s $name || tmux attach-session -t $name } # Fancy prompt diff --git a/Makefile b/Makefile index 6716ea6..5d5e012 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ all: \ vim \ tmux \ dotfiles \ - defaults + defaults \ + docker # bootstrap only, add one-time bootstrap tasks here # setups everything @@ -322,3 +323,8 @@ dotfiles: $(DOTFILES) ~/.%: cd ~ && ln -sv dotfiles/$(notdir $@) $@ +docker: ~/.docker/machine/machines/default + +~/.docker/machine/machines/default: + docker-machine create default --driver virtualbox --virtualbox-cpu-count "2" --virtualbox-hostonly-cidr "10.0.0.1/24" --virtualbox-memory "2048" + From 5fa3b5ceb09a3f59e3bd13359fcaccb4f9196384 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 26 Mar 2018 12:00:23 +0200 Subject: [PATCH 33/63] add redis and itsycal (a nice menu bar calendar with events from ical) --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 5d5e012..6685392 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,8 @@ brew: \ brew install postgres # mysql brew install mysql + # redis + brew install redis # sed, stream editor, but replace mac os version brew install gnu-sed --with-default-names # erlang programming language @@ -113,6 +115,8 @@ casks: \ brew cask install sequel-pro # postico is a great graphical PostgreSQL client brew cask install postico + # itsycal is a nice menu bar clock replacement that features a calendar with events from iCal + brew cask install itsycal bash: # newer version of bash From e8e7cdf08dd0fbb2af36bc0d0e59882576adcb0b Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 26 Mar 2018 12:47:10 +0200 Subject: [PATCH 34/63] separate bash-aliases and bash-functions into their own files. --- .bash_aliases | 14 ++++ .bash_functions | 86 ++++++++++++++++++++++++ .profile | 175 +++++++++--------------------------------------- Makefile | 5 +- 4 files changed, 136 insertions(+), 144 deletions(-) create mode 100644 .bash_aliases create mode 100644 .bash_functions diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..ca9323d --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,14 @@ +# if we are in a tmate session, alias tmux as tmate +if [[ $TMUX =~ tmate ]]; then alias tmux=tmate; fi + +# nice directory listing +alias l="ls -Glah" + +# nice directory tree listing showing permissions, user, group and size (human readable) +alias t="tree -L 1 --dirsfirst -shugp" +# nice directory tree listing, but just 2 levels +alias tt="tree -L 2 --dirsfirst" + +# I use git so often that aliasing it saves a lot +alias g="git" + diff --git a/.bash_functions b/.bash_functions new file mode 100644 index 0000000..7e9f134 --- /dev/null +++ b/.bash_functions @@ -0,0 +1,86 @@ +# print some information on the current tmate session +function tmate-info { + echo "rw: $(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' 2>/dev/null)" + echo "ro: $(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh_ro}' 2>/dev/null)" +} + +# start tmate session +function tmate-start { + tmate -S /tmp/tmate.sock new-session -d + tmate -S /tmp/tmate.sock wait tmate-ready + eval "$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}')" +} + +# tmux, be there and be named well +function tms { + local name=$(basename $PWD | sed -e s/\[^a-zA-Z0-9\\\//\$]/-/g -e s/--*/-/g) + tmux new -s $name || tmux attach-session -t $name +} + +# docker-machine, be there and make it happen +function dms { + docker-machine start + eval `docker-machine env` +} + +# Start an HTTP server from a directory, optionally specifying the port +function server() { + local port="${1:-8000}" + open "http://localhost:${port}/" + # Set the default Content-Type to `text/plain` instead of `application/octet-stream` + # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) + python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" +} + +# Mirror a complete website +function mirror-website() { + local url=$@ + local domain=`expr "$url" : '^http[s]*://\([^/?]*\)'` + wget \ + --recursive \ + --no-clobber \ + --page-requisites \ + --html-extension \ + --convert-links \ + --restrict-file-names=windows \ + --domains $domain \ + --no-parent \ + $url +} + +# Put my computer to sleep in X minutes +function sleep-in() { + local minutes=$1 + if [ -z "$minutes" ]; then + echo "Usage: sleep-in " + else + local datetime=`date -v+${minutes}M +"%m/%d/%y %H:%M:%S"` + echo "Scheduling sleep at $datetime" + sudo pmset schedule sleep "$datetime" + fi +} + +# Open conflicts at once, setting the search pattern to <<<<<<< in order to cycle through them pressing 'n' +function editconflicts() { + vim +/"<<<<<<<" `git diff --name-only --diff-filter=U | xargs` +} + +# quickly cleanup cruft from docker machine +function docker-cleanup() { + docker rm `docker ps -a -q` + docker rmi `docker images | grep "^/dev/null)" - echo "ro: $(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh_ro}' 2>/dev/null)" -} -function tmate-start { - tmate -S /tmp/tmate.sock new-session -d - tmate -S /tmp/tmate.sock wait tmate-ready - eval "$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}')" -} - -function tms { - local name=$(basename $PWD) - tmux new -s $name || tmux attach-session -t $name -} - -# Fancy prompt -function git-prompt { - if (git status >/dev/null 2>&1); then - local symbolic_ref_head=$(git symbolic-ref HEAD 2> /dev/null) - local branch=${symbolic_ref_head#refs/heads/} - local stash_count=$(git stash list --oneline 2> /dev/null | sed -n "$=") - local dirty_star=$(git status --porcelain . | sed -e "$ ! d" -e "s/.*/*/") - echo "$branch$stash_count$dirty_star" - else - echo "" - fi -} -function rbenv-prompt { - local version=$(rbenv version-name | sed -e 's/system/s/; s/jruby-/j/') - local gemset=$(rbenv gemset active 2>&1 | cut -d ' ' -f1) - if (test "$gemset" = "no"); then - echo " $version" - else - echo " $version@$gemset" - fi -} -if [[ $TERM != "" ]]; then - export red=$(tput setaf 1) - export green=$(tput setaf 2) - export yellow=$(tput setaf 3) - export bold=$(tput bold) - export reset=$(tput sgr0) -fi +# setup a simple PROMPT/PS1 export PROMPT_DIRTRIM=1 -#export PS1="\[$yellow\]\$(git-prompt)\[$red\]\$(rbenv-prompt)\n\[$reset\]\w: " +export PS1="\n\W> " # Case-insensitive globbing (used in pathname expansion) shopt -s nocaseglob @@ -78,97 +33,31 @@ shopt -s nocaseglob export HISTCONTROL=ignoreboth export HISTSIZE=1000000 +# directly save every command to history shopt -s histappend if [ "x$PROMPT_COMMAND" != "x" ]; then export PROMPT_COMMAND="$PROMPT_COMMAND;" fi export PROMPT_COMMAND="$PROMPT_COMMAND history -a; history -n" # preserve other PROMPT_COMMAND stuff! -# Start an HTTP server from a directory, optionally specifying the port -function server() { - local port="${1:-8000}" - open "http://localhost:${port}/" - # Set the default Content-Type to `text/plain` instead of `application/octet-stream` - # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) - python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" -} - -# Mirror a complete website -function mirror-website() { - local url=$@ - local domain=`expr "$url" : '^http[s]*://\([^/?]*\)'` - wget \ - --recursive \ - --no-clobber \ - --page-requisites \ - --html-extension \ - --convert-links \ - --restrict-file-names=windows \ - --domains $domain \ - --no-parent \ - $url -} - -# Put my computer to sleep in X minutes -function sleep-in() { - local minutes=$1 - if [ -z "$minutes" ]; then - echo "Usage: sleep-in " - else - local datetime=`date -v+${minutes}M +"%m/%d/%y %H:%M:%S"` - echo "Scheduling sleep at $datetime" - sudo pmset schedule sleep "$datetime" - fi -} - -# Open conflicts at once, setting the search pattern to <<<<<<< in order to cycle through them pressing 'n' -function editconflicts() { - vim +/"<<<<<<<" `git diff --name-only --diff-filter=U | xargs` -} - -# Selectively load bash completions for better performance -function load-bash-completion() { - local file="$(brew --prefix)/etc/bash_completion.d/$1" - if [ -f "$file" ]; then - . "$file" - fi -} -. "$(brew --prefix)/etc/bash_completion" -# load-bash-completion "git-completion.bash" -# load-bash-completion "ssh" - -# Heroku Toolbelt -export PATH="/usr/local/heroku/bin:$PATH" - -function docker-cleanup() { - docker rm `docker ps -a -q` - docker rmi `docker images | grep "^ ~/.kube/bash_completion`) source ~/.kube/bash_completion +# Bash completion for brew installed tools +source "$(brew --prefix)/etc/bash_completion" + +# Aliases are managed here +source .bash_aliases + +# Functions are managed here +source .bash_functions + diff --git a/Makefile b/Makefile index 6685392..64cfebe 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -EXCLUDED_DOTFILES := .git .gitattributes .gitignore .gitmodules .ssh +EXCLUDED_DOTFILES := .git .git-crypt .gitattributes .gitignore .gitmodules .ssh DOTFILES := $(addprefix ~/, $(filter-out $(EXCLUDED_DOTFILES), $(wildcard .*))) # everything, geared towards to be run for setup and maintenance @@ -327,6 +327,9 @@ dotfiles: $(DOTFILES) ~/.%: cd ~ && ln -sv dotfiles/$(notdir $@) $@ +~/.kube/bash_completion: + kubectl completion bash > ~/.kube/bash_completion + docker: ~/.docker/machine/machines/default ~/.docker/machine/machines/default: From 8e945bdd2f707c54cc89ce1cca95a2b53c300b91 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 26 Mar 2018 13:24:00 +0200 Subject: [PATCH 35/63] fix source reference to home directory --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 15cecea..426ea83 100644 --- a/.profile +++ b/.profile @@ -56,8 +56,8 @@ source ~/.kube/bash_completion source "$(brew --prefix)/etc/bash_completion" # Aliases are managed here -source .bash_aliases +source ~/.bash_aliases # Functions are managed here -source .bash_functions +source ~/.bash_functions From 9e709f53ecfd6fe608181492ac30a085906a83d1 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 28 Mar 2018 19:07:20 +0200 Subject: [PATCH 36/63] fix RBENV initalisation in .profile --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 426ea83..3c93b78 100644 --- a/.profile +++ b/.profile @@ -1,13 +1,13 @@ # PATH setup export PATH="$HOME/bin:$PATH" -# add ruby gems/rbenv shims to PATH -export PATH="$RBENV_ROOT/bin:$PATH" # add escripts (elixir scripts) to PATH export PATH="/Users/lukas/.mix/escripts:$PATH" # Rbenv setup export RBENV_ROOT="$HOME/.rbenv" export RBENV_BUILD_ROOT="$RBENV_ROOT/sources" +# add ruby gems/rbenv shims to PATH +export PATH="$RBENV_ROOT/bin:$PATH" eval "$(rbenv init -)" # vim all the things From 140da2dd55c1e33b373e065e6e52b35bcfb64569 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 28 Mar 2018 19:07:53 +0200 Subject: [PATCH 37/63] change PS1 separation charactor back to a dollar sign --- .profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.profile b/.profile index 3c93b78..2745589 100644 --- a/.profile +++ b/.profile @@ -24,7 +24,7 @@ export HOMEBREW_NO_ANALYTICS=1 # setup a simple PROMPT/PS1 export PROMPT_DIRTRIM=1 -export PS1="\n\W> " +export PS1="\n\W$ " # Case-insensitive globbing (used in pathname expansion) shopt -s nocaseglob From ff0bb662ef30d0c09b9a0bd11d168f2890368680 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Tue, 3 Apr 2018 23:17:32 +0200 Subject: [PATCH 38/63] adding 'make harder' to host a collection of basic security settings --- .profile | 2 ++ Makefile | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.profile b/.profile index 2745589..0029de8 100644 --- a/.profile +++ b/.profile @@ -21,6 +21,8 @@ export LANG=en_US.UTF-8 # prevent API throttling when installing/updating homebrew things export HOMEBREW_GITHUB_API_TOKEN=9d9f01f0d6cf2214fe951cc95f9d79872fbd5499 export HOMEBREW_NO_ANALYTICS=1 +export HOMEBREW_NO_INSECURE_REDIRECT=1 +export HOMEBREW_CASK_OPTS=--require-sha # setup a simple PROMPT/PS1 export PROMPT_DIRTRIM=1 diff --git a/Makefile b/Makefile index 64cfebe..e53c7f6 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ all: \ tmux \ dotfiles \ defaults \ - docker + docker \ + harder # bootstrap only, add one-time bootstrap tasks here # setups everything @@ -70,6 +71,7 @@ brew: \ /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + brew analytics off casks: \ /usr/local/bin/brew @@ -335,3 +337,17 @@ docker: ~/.docker/machine/machines/default ~/.docker/machine/machines/default: docker-machine create default --driver virtualbox --virtualbox-cpu-count "2" --virtualbox-hostonly-cidr "10.0.0.1/24" --virtualbox-memory "2048" +# Here is a comprehensive guide: https://github.com/drduh/macOS-Security-and-Privacy-Guide +# The following settings implement some basic security measures +harder: + # Enable the firewall + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on + # Enable logging on the firewall + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on + # Enable stealth mode (computer does not respond to PING or TCP connections on closed ports) + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on + # Prevent built-in software as well as code-signed, downloaded software from being whitelisted automatically + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned off + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off + # Restart the firewall (this should remain last) + -sudo pkill -HUP socketfilterfw From 8bf641a4c1d43522fb44d23a9e2dde38ac220cab Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 9 Apr 2018 20:29:31 +0200 Subject: [PATCH 39/63] add macdown and some hardening instructions --- Makefile | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index e53c7f6..5968a36 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ all: \ tmux \ dotfiles \ defaults \ - docker \ - harder + docker \ + harder # bootstrap only, add one-time bootstrap tasks here # setups everything @@ -71,7 +71,7 @@ brew: \ /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - brew analytics off + brew analytics off casks: \ /usr/local/bin/brew @@ -119,6 +119,8 @@ casks: \ brew cask install postico # itsycal is a nice menu bar clock replacement that features a calendar with events from iCal brew cask install itsycal + # macdown is a nice markdown editor, I use it to write my articles/presentation scripts + brew cask install macdown bash: # newer version of bash @@ -340,14 +342,15 @@ docker: ~/.docker/machine/machines/default # Here is a comprehensive guide: https://github.com/drduh/macOS-Security-and-Privacy-Guide # The following settings implement some basic security measures harder: - # Enable the firewall - sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on - # Enable logging on the firewall - sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on - # Enable stealth mode (computer does not respond to PING or TCP connections on closed ports) - sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on - # Prevent built-in software as well as code-signed, downloaded software from being whitelisted automatically - sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned off - sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off - # Restart the firewall (this should remain last) - -sudo pkill -HUP socketfilterfw + # Enable the firewall + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on + # Enable logging on the firewall + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on + # Enable stealth mode (computer does not respond to PING or TCP connections on closed ports) + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on + # Prevent built-in software as well as code-signed, downloaded software from being whitelisted automatically + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned off + sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off + # Restart the firewall (this should remain last) + -sudo pkill -HUP socketfilterfw + From 1894b61494cfab77fe537f609a8c1d7db7b55536 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Tue, 10 Apr 2018 11:45:50 +0200 Subject: [PATCH 40/63] add nmap to brew installs --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 5968a36..890f27a 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,8 @@ brew: \ brew install pstree # watch is great for building an overview on running stuff brew install watch + # nmap is great for test and probing network related stuff + brew install nmap /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" From 43c1da3eab42a9e5eb4f95ed284e31862033282f Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 9 Jun 2018 11:21:35 +0200 Subject: [PATCH 41/63] add `make fonts` as their own section --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 64cfebe..db12b0f 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ DOTFILES := $(addprefix ~/, $(filter-out $(EXCLUDED_DOTFILES), $(wildcard .*))) all: \ brew \ casks \ + fonts \ bash \ ruby \ vim \ @@ -75,10 +76,6 @@ casks: \ /usr/local/bin/brew # tap homebrew-cask to install other osx related stuff brew tap caskroom/cask - # tap into homebrew-fonts - brew tap caskroom/fonts - # install Adobe Source Code Pro, an excellent mono space font for programming - brew cask install font-source-code-pro # spectacle for mac osx window management/tiling brew cask install spectacle # opera for browsing the web @@ -118,6 +115,15 @@ casks: \ # itsycal is a nice menu bar clock replacement that features a calendar with events from iCal brew cask install itsycal +fonts: \ + /usr/local/bin/brew + # tap homebrew-fonts to install freely available fonts + brew tap caskroom/fonts + # install IBM Plex, an excellent modern font (https://www.ibm.com/plex/) + brew cask install font-ibm-plex + # install Adobe Source Code Pro, an excellent mono space font for programming + brew cask install font-source-code-pro + bash: # newer version of bash brew install bash From e4f5621cefe07bcda37a536709ac2bbddb5efbd6 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 9 Jun 2018 11:22:33 +0200 Subject: [PATCH 42/63] use docker for mac instead of docker-machine --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index db12b0f..d2f1d3b 100644 --- a/Makefile +++ b/Makefile @@ -336,8 +336,7 @@ dotfiles: $(DOTFILES) ~/.kube/bash_completion: kubectl completion bash > ~/.kube/bash_completion -docker: ~/.docker/machine/machines/default +docker: + brew cask install docker -~/.docker/machine/machines/default: - docker-machine create default --driver virtualbox --virtualbox-cpu-count "2" --virtualbox-hostonly-cidr "10.0.0.1/24" --virtualbox-memory "2048" From c93c0bb747f45ae39dfb6d55ebd92d157602b161 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 9 Jun 2018 11:23:44 +0200 Subject: [PATCH 43/63] fix intendation --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d2f1d3b..81da08e 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ DOTFILES := $(addprefix ~/, $(filter-out $(EXCLUDED_DOTFILES), $(wildcard .*))) all: \ brew \ casks \ - fonts \ + fonts \ bash \ ruby \ vim \ @@ -116,13 +116,13 @@ casks: \ brew cask install itsycal fonts: \ - /usr/local/bin/brew - # tap homebrew-fonts to install freely available fonts - brew tap caskroom/fonts - # install IBM Plex, an excellent modern font (https://www.ibm.com/plex/) - brew cask install font-ibm-plex - # install Adobe Source Code Pro, an excellent mono space font for programming - brew cask install font-source-code-pro + /usr/local/bin/brew + # tap homebrew-fonts to install freely available fonts + brew tap caskroom/fonts + # install IBM Plex, an excellent modern font (https://www.ibm.com/plex/) + brew cask install font-ibm-plex + # install Adobe Source Code Pro, an excellent mono space font for programming + brew cask install font-source-code-pro bash: # newer version of bash From 2b74a49c31e5987d9f9a9d1c764b0a2ee477eb3e Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 9 Jun 2018 11:24:35 +0200 Subject: [PATCH 44/63] fix intendation --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c6a59b1..198392a 100644 --- a/Makefile +++ b/Makefile @@ -343,7 +343,7 @@ dotfiles: $(DOTFILES) kubectl completion bash > ~/.kube/bash_completion docker: - brew cask install docker + brew cask install docker # Here is a comprehensive guide: https://github.com/drduh/macOS-Security-and-Privacy-Guide From ded3079819e5fab5a960795477580e22a93b8cba Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 9 Jun 2018 11:25:40 +0200 Subject: [PATCH 45/63] remove docker-machine related installs --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index 198392a..35389f5 100644 --- a/Makefile +++ b/Makefile @@ -55,10 +55,6 @@ brew: \ brew install erlang # elixir programming language brew install elixir - # docker related tools - brew install docker - brew install docker-machine - brew install docker-compose # handle amazon web services related stuff brew install awscli # handle json on the command line From 0846bdf67aa9e41a9f93ea5bb7df95d82870348f Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Fri, 15 Jun 2018 09:32:24 +0200 Subject: [PATCH 46/63] add Dash to the list of installed software --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 35389f5..516ba21 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,8 @@ casks: \ brew cask install itsycal # macdown is a nice markdown editor, I use it to write my articles/presentation scripts brew cask install macdown + # Dash gives your Mac instant offline access to 200+ API documentation sets. + brew cask install dash fonts: \ /usr/local/bin/brew From 6c49f432faf312076e09f98138b0d724fea43855 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Fri, 15 Jun 2018 09:33:10 +0200 Subject: [PATCH 47/63] add git staged as an alias for `git diff --staged` --- .gitconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitconfig b/.gitconfig index c0d1527..1c47af2 100644 --- a/.gitconfig +++ b/.gitconfig @@ -46,7 +46,10 @@ pick = "cherry-pick" contributors = "shortlog -n -s --no-merges" amend = "commit -a --amend" + staged = "diff --staged" [push] default = upstream [status] submoduleSummary = true +[http] + cookiefile = /Users/lukas/.gitcookies From 4da85539e9722009b4e8246f906ff991accfc379 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Mon, 18 Jun 2018 10:42:25 +0200 Subject: [PATCH 48/63] fix 8-spaces -> tab --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 516ba21..d18d0db 100644 --- a/Makefile +++ b/Makefile @@ -116,8 +116,8 @@ casks: \ brew cask install itsycal # macdown is a nice markdown editor, I use it to write my articles/presentation scripts brew cask install macdown - # Dash gives your Mac instant offline access to 200+ API documentation sets. - brew cask install dash + # Dash gives your Mac instant offline access to 200+ API documentation sets. + brew cask install dash fonts: \ /usr/local/bin/brew From c5ac0ecf9ee079fcb4749a2e853b40a8144610ee Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Tue, 10 Jul 2018 12:47:38 +0200 Subject: [PATCH 49/63] add brew version of curl --- .profile | 5 +++++ Makefile | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 0029de8..888e390 100644 --- a/.profile +++ b/.profile @@ -2,6 +2,11 @@ export PATH="$HOME/bin:$PATH" # add escripts (elixir scripts) to PATH export PATH="/Users/lukas/.mix/escripts:$PATH" +# add brew version of curl to PATH +export PATH="/usr/local/opt/curl/bin:$PATH" + +export GOPATH="$HOME/Projects/go" +export PATH="$GOPATH/bin:$PATH" # Rbenv setup export RBENV_ROOT="$HOME/.rbenv" diff --git a/Makefile b/Makefile index 516ba21..2aab12c 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,8 @@ brew: \ brew install watch # nmap is great for test and probing network related stuff brew install nmap + # curl is a http development essential + brew install curl /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -116,8 +118,8 @@ casks: \ brew cask install itsycal # macdown is a nice markdown editor, I use it to write my articles/presentation scripts brew cask install macdown - # Dash gives your Mac instant offline access to 200+ API documentation sets. - brew cask install dash + # Dash gives your Mac instant offline access to 200+ API documentation sets. + brew cask install dash fonts: \ /usr/local/bin/brew From ba0b43abca2d39a78ade29b75a5e537275899748 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Tue, 10 Jul 2018 13:01:44 +0200 Subject: [PATCH 50/63] encrypt .ssh/*.pem --- .gitattributes | 1 + .ssh/whatdropsnow-production.pem | Bin 0 -> 1714 bytes .ssh/whatdropsnow-staging.pem | Bin 0 -> 1696 bytes 3 files changed, 1 insertion(+) create mode 100644 .ssh/whatdropsnow-production.pem create mode 100644 .ssh/whatdropsnow-staging.pem diff --git a/.gitattributes b/.gitattributes index cfb837b..56662a3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ * text=auto .ssh/config filter=git-crypt diff=git-crypt +.ssh/*.pem filter=git-crypt diff=git-crypt diff --git a/.ssh/whatdropsnow-production.pem b/.ssh/whatdropsnow-production.pem new file mode 100644 index 0000000000000000000000000000000000000000..5efabad05fac9cdbca04f51a4f66a3adeccb131f GIT binary patch literal 1714 zcmV;j22J?@M@dveQdv+`0Ekb=;IMgC;1YOdaRKG@e@~EnV_PAepRpb6o|KK9R z7`-2?=8_wlaCHgraLPtxv%Jp zPCX0{yi_8*WIeZOjgTps{JChDSwoF1B_@M62 z+XMJp{JEeCzlMS1y{=&QLJ#D?%HnUdB5S8Xw`8ql?h_V9S1;z$AtsJV zDJko?BspcyK5x7zi-(g-m~mZ5G?3|UrL_Z zR2Tv4_PJZ;Tcsc!Nc)X-CO48@Zl}q}((H9|^hZdgLRvG1gniF%z!Eg_qQI!Kic=NA$eDzD#Zp}glRNR68Yer z9e>ZYC!9NTCXR=wP}1T|NNe;Cy} zPj6>#h-CdTU<#A@|LM6)XzJn}B&m&$llt7dSvr;T40jp5x;6=)+eTlTeYmvc!J_Ik zvWt`xPWB%a&C&>PKp}+5fQ?K5!Hbn6yCV|m*PlZ)QhpLO@*G8b|3AGTJbKE7p^F-+-h0flmhsHdO@%V(RM zGTwDuei3a2eWp2A=4iH6r5RAIQ7qN7X&7jfFHy==_>VWdK2@c-$=`+8N@hYh#V%K# z45#gUU{XoJ<4Ae*?_U_0wnSRG7yVP33R_X|Cus7(%zutS%Q8{txE~ue?1dKofL%~# z&Dd>|{~cMIY@8S@t)9hIjpEuUda8rBK-t0bxgzp_M50{V-5~NfF*t)y)IWBw8@gPs Ic$h(+8qr%%r2qf` literal 0 HcmV?d00001 diff --git a/.ssh/whatdropsnow-staging.pem b/.ssh/whatdropsnow-staging.pem new file mode 100644 index 0000000000000000000000000000000000000000..a0888c70a73e30de329cec4307b0ac82f4c18469 GIT binary patch literal 1696 zcmV;R24DFAM@dveQdv+`08J0@gNs>uV6>W!5VGoXR0Hi3i?@S3fZk0z4?C-72V6)P z1czKni6C_gSF@k4s!b(;qRc4I$do;mvjK(w~#li!YKdp+|5zx#^W zP^lk95Mykm?8DO-;eAUp&xZbXZ051 zsnxQEt36zxrK2C8^S&kF*68%5Xa#^=s~G5DF;dx@&hfoYg?e_Onnmu$PGUo(J#8c8 z@v!wz7s51H_@^8lVp`deASeKD5ypoXmbEAiTy1%Q=yhw>E=4=3I@y`2RmQMbx^+0S5D!4`>}Jd%&Z z1oW+H@MEk`NU2%bw5`bKYJ522M|w-=?v22E(JdzR8SeWg%K zN$tf?7lX}>M$yLc_MA%iY1V08m!>ZqIVA_4qxIIQcDs8?u&>0E1kiICw4GAf_e9zmHf9sl0cg8nb&Ll&JjW1Lk*z!s8#BXt{1MlF zf-h!Pe)SEw*9lSXA$|*7#>`18=}0+EP=%4w#a~vjQBE16*Z0%H`MvN8@jpRS`Rk?z zpM4L{W(n@2#4`Fq&eB=2l%Hp#WRt1=fXC8I^Bccg6whMaO?4>uTERBPlcnR#n*{`Y z3e?O&W;6mCh`P(ZumM|_1zgQYiHQUrEfz|f-G8HJeZDktA!M#MgwX7n_zwbv_y>|d zZ=L$vtuQ1_W6*>qD3GYT?O)jf<-3-zlvEGXfpH3GohVsVEU-l+8KZ@8{4OluS0+zb zF1NL}D2TF8s45XfqqNMGnflKb+(#4+#4r>+lB7nD`-IjxRP^dH?J(JW-8~A(o)`}v z`%Y^RqJ=uE0Fm6^_0zg+At=SFR=~(gD6ceF`(*j~L8Xx>PXM3sFi zTdL!ep=l1F^dp&Gg0mRsyG!gc?@28(Z zEq{PDSfIf=B$Vh~V6Ee51eYoJ&9&0rOUwhKWhJLmQTzUUl0&_Y7ihde%E%0nVn@sF zlL5nx=oHR4Dk!gq_Dl&(9;HfsBvlEnt>hgOYh$jPS*(hghGf4hTEeB+w)NYUGnpsK zO1ysXBsQlb#7Npu5W+5-<75t<5t}#;7JWva2U&Ex^O zdzIk&7cm9lz|A3X7@jsaffV$FEF*ffvR}C5yyd=rp&&PT zatNMmcH(c-9$K>TO{jf4T;Hr(TdBh`>Zp-$lMlaar}mGlrq^x=RAp(wL!>QWUp?*F z90zthXr17BxE4UO*^TJ+L`O#f4c1p4>I|)(UUCPG686HnghA2I&Pve(mW(fI!+=fE zYry$|sS2R!!2UIcWgzXbW(pPu&2kz~r&C%c3Uv>j0nOEr0VY24P#40a5Qkp=c6Fwr zl7)sPv#lZB{kp*!;!+>6mJU^>Hh!FMa|CQ|GIw_Yjh!m1wkv?_q(t|0woLYL4^CQ} zv8|#7Wu+(wqFgEQxZE*TV^b}dqte>pEGMG*B?Fa^gWS1iiP6tEc1!|x)Ejo5BP;kF zk4)rnwKd@ZV8}S?MYl$->WTfP7}p2gK@0>uDs!ZqgmSl(eo-4FB4=`z#;W{T9-iXt z+&1*OL}(4?^m=M;15ENri>~Rv!kIF`SitU?fto)} z7XcOd&^Y@T5Ex0SfY5Q24Yot2)1TRux_5g_;&A$tyXC#Y7lh#G<4pL6`%NqBG@>lB qVmCxqJ|5>)5yBjicBlAKY2o=%^D{ Date: Sat, 28 Jul 2018 13:20:08 +0100 Subject: [PATCH 51/63] Enable touch id for sudo (if available) --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2aab12c..bba524e 100644 --- a/Makefile +++ b/Makefile @@ -360,4 +360,5 @@ harder: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off # Restart the firewall (this should remain last) -sudo pkill -HUP socketfilterfw - + # Enable touch id for sudo (if available) + -@test -f /usr/lib/pam/pam_tid.so* && (grep pam_tid.so /etc/pam.d/sudo || sudo /usr/local/bin/sed -e '2iauth sufficient pam_tid.so' -i /etc/pam.d/sudo) From df630a70fc8f838d7184a4d75ceafd057091ec2a Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 28 Jul 2018 13:48:10 +0100 Subject: [PATCH 52/63] add hugo, my blogging engine --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index bba524e..cb57f98 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,8 @@ brew: \ brew install nmap # curl is a http development essential brew install curl + # hugo is my blogging engine + brew install hugo /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" From a81233ba1f3b2b36c98c4c11fbe9e9997cf2f58a Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 16 Jan 2019 11:32:58 +0100 Subject: [PATCH 53/63] knot-resolver secure dns setup --- .bash_aliases | 6 +++ .bash_functions | 16 +++++++ Makefile | 9 +++- etc/certs/DigiCertECCSecureServerCA.pem | 22 ++++++++++ etc/kresd/config | 55 +++++++++++++++++++++++++ 5 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 etc/certs/DigiCertECCSecureServerCA.pem create mode 100644 etc/kresd/config diff --git a/.bash_aliases b/.bash_aliases index ca9323d..34245f9 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -12,3 +12,9 @@ alias tt="tree -L 2 --dirsfirst" # I use git so often that aliasing it saves a lot alias g="git" +# Add simulator to start the iOS simulator +alias simulator="open -a Simulator" + +# Access the console of the knot-resolver +alias kresd-console="sudo socat - /usr/local/var/kresd/tty/*" + diff --git a/.bash_functions b/.bash_functions index 7e9f134..d544e0f 100644 --- a/.bash_functions +++ b/.bash_functions @@ -84,3 +84,19 @@ function print-kube-secrets() { function bundle-open() { (cd $($(which bundle) show $@) && $EDITOR .) } + +# Use local dns server +function localdns() { + if [[ "$1" == "on" ]]; then + sudo networksetup -setdnsservers Wi-Fi 127.0.0.1 + sudo killall -HUP mDNSResponder + elif [[ "$1" == "off" ]]; then + sudo networksetup -setdnsservers Wi-Fi empty + sudo killall -HUP mDNSResponder + else + cat < +Enables or disables local DNS configuration (knot-resolver@127.0.0.1 ==(tls)==> cloudflare) +USAGE + fi +} diff --git a/Makefile b/Makefile index cb57f98..36ae89e 100644 --- a/Makefile +++ b/Makefile @@ -347,10 +347,10 @@ dotfiles: $(DOTFILES) docker: brew cask install docker - # Here is a comprehensive guide: https://github.com/drduh/macOS-Security-and-Privacy-Guide # The following settings implement some basic security measures -harder: +harder: \ + harder-dns-resolver # Enable the firewall sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on # Enable logging on the firewall @@ -364,3 +364,8 @@ harder: -sudo pkill -HUP socketfilterfw # Enable touch id for sudo (if available) -@test -f /usr/lib/pam/pam_tid.so* && (grep pam_tid.so /etc/pam.d/sudo || sudo /usr/local/bin/sed -e '2iauth sufficient pam_tid.so' -i /etc/pam.d/sudo) + +harder-dns-resolver: + brew install knot-resolver + cp -v ~/dotfiles/etc/kresd/config /usr/local/etc/kresd/config + sudo brew services start knot-resolver diff --git a/etc/certs/DigiCertECCSecureServerCA.pem b/etc/certs/DigiCertECCSecureServerCA.pem new file mode 100644 index 0000000..ba07b8c --- /dev/null +++ b/etc/certs/DigiCertECCSecureServerCA.pem @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDrDCCApSgAwIBAgIQCssoukZe5TkIdnRw883GEjANBgkqhkiG9w0BAQwFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD +QTAeFw0xMzAzMDgxMjAwMDBaFw0yMzAzMDgxMjAwMDBaMEwxCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxJjAkBgNVBAMTHURpZ2lDZXJ0IEVDQyBT +ZWN1cmUgU2VydmVyIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE4ghC6nfYJN6g +LGSkE85AnCNyqQIKDjc/ITa4jVMU9tWRlUvzlgKNcR7E2Munn17voOZ/WpIRllNv +68DLP679Wz9HJOeaBy6Wvqgvu1cYr3GkvXg6HuhbPGtkESvMNCuMo4IBITCCAR0w +EgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwNAYIKwYBBQUHAQEE +KDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wQgYDVR0f +BDswOTA3oDWgM4YxaHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0R2xv +YmFsUm9vdENBLmNybDA9BgNVHSAENjA0MDIGBFUdIAAwKjAoBggrBgEFBQcCARYc +aHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzAdBgNVHQ4EFgQUo53mH/naOU/A +buiRy5Wl2jHiCp8wHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJ +KoZIhvcNAQEMBQADggEBAMeKoENL7HTJxavVHzA1Nm6YVntIrAVjrnuaVyRXzG/6 +3qttnMe2uuzO58pzZNvfBDcKAEmzP58mrZGMIOgfiA4q+2Y3yDDo0sIkp0VILeoB +UEoxlBPfjV/aKrtJPGHzecicZpIalir0ezZYoyxBEHQa0+1IttK7igZFcTMQMHp6 +mCHdJLnsnLWSB62DxsRq+HfmNb4TDydkskO/g+l3VtsIh5RHFPVfKK+jaEyDj2D3 +loB5hWp2Jp2VDCADjT7ueihlZGak2YPqmXTNbk19HOuNssWvFhtOyPNV6og4ETQd +Ea8/B6hPatJ0ES8q/HO3X8IVQwVs1n3aAr0im0/T+Xc= +-----END CERTIFICATE----- diff --git a/etc/kresd/config b/etc/kresd/config new file mode 100644 index 0000000..6eaa8da --- /dev/null +++ b/etc/kresd/config @@ -0,0 +1,55 @@ +-- Config file for personal tls enabled resolver. +-- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration +-- +-- How to enter the knot resolver CLI +-- Ctrl+D to exit +-- +-- $ sudo socat - /tmp/kresd/tty/* +-- +-- > cache.clear() +-- +-- > trust_anchors.insecure + +-- Listen on localhost (default) +net = { '127.0.0.1', '::1' } +-- net.listen(net.lo) + +-- Drop root privileges +-- user('knot-resolver', 'knot-resolver') + +-- Auto-maintain root TA +trust_anchors.file = 'root.keys' + +-- If there are problems accessing a single DNSSEC domain, without turning DNSSEC off for others +-- trust_anchors.negative = { 'some.bad.domain' } + +-- Load Useful modules +modules = { + 'hints > iterate', -- Load /etc/hosts and allow custom root hints + 'stats', -- Track internal statistics + 'predict', -- Prefetch expiring/frequent records +} + +-- Configure blocks (e.g. block YouTube for getting productive) +-- modules.load('daf') +-- daf.add 'qname youtube.com deny' +-- daf.add 'qname youtu.be deny' + +-- Smaller cache size +cache.size = 10 * MB + +-- use the homebrew openssl ca cert bundle +cloudflare_ca_file='/Users/lukas/dotfiles/certs/DigiCertECCSecureServerCA.pem' + +-- forward all queries to Cloudflare DNS over tls +policy.add( + policy.all( + policy.TLS_FORWARD({ + {'1.1.1.1', hostname='cloudflare-dns.com', ca_file=cloudflare_ca_file}, + {'1.0.0.1', hostname='cloudflare-dns.com', ca_file=cloudflare_ca_file}, + {'2606:4700:4700::1111', hostname='cloudflare-dns.com', ca_file=cloudflare_ca_file}, + {'2606:4700:4700::1001', hostname='cloudflare-dns.com', ca_file=cloudflare_ca_file}, + }) + ) +) + From 9566e87da2410de05d90155a6fb08f1cdfe2ba29 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 19 Jan 2019 20:57:18 +0100 Subject: [PATCH 54/63] Fix kresd configuration and remove ocaml --- .bash_functions | 7 +++++-- .vimrc | 15 +-------------- etc/kresd/config | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.bash_functions b/.bash_functions index d544e0f..d322c30 100644 --- a/.bash_functions +++ b/.bash_functions @@ -87,11 +87,14 @@ function bundle-open() { # Use local dns server function localdns() { + if [[ "x$2" == "x" ]]; then + local network="Wi-Fi" + fi if [[ "$1" == "on" ]]; then - sudo networksetup -setdnsservers Wi-Fi 127.0.0.1 + sudo networksetup -setdnsservers "$network" 127.0.0.1 sudo killall -HUP mDNSResponder elif [[ "$1" == "off" ]]; then - sudo networksetup -setdnsservers Wi-Fi empty + sudo networksetup -setdnsservers "$network" empty sudo killall -HUP mDNSResponder else cat < ? :MerlinTypeOf -autocmd FileType ocaml vmap ? :MerlinTypeOfSel -autocmd FileType ocaml map n :MerlinGrowEnclosing -autocmd FileType ocaml map p :MerlinShrinkEnclosing - " fuzzy search files Plugin 'wincent/command-t' let g:CommandTMatchWindowReverse=1 @@ -135,6 +121,7 @@ let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 0 let g:syntastic_check_on_wq = 0 +let g:syntastic_mode_map = {'mode':'passive'} set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* diff --git a/etc/kresd/config b/etc/kresd/config index 6eaa8da..9a4e698 100644 --- a/etc/kresd/config +++ b/etc/kresd/config @@ -39,7 +39,7 @@ modules = { cache.size = 10 * MB -- use the homebrew openssl ca cert bundle -cloudflare_ca_file='/Users/lukas/dotfiles/certs/DigiCertECCSecureServerCA.pem' +cloudflare_ca_file='/Users/lukas/dotfiles/etc/certs/DigiCertECCSecureServerCA.pem' -- forward all queries to Cloudflare DNS over tls policy.add( From 1117b50896db14801c05d590cf04cd9acb5919a5 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 19 Jan 2019 20:58:21 +0100 Subject: [PATCH 55/63] Add .pryrc for byebug like pry-byebug handling --- .pryrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .pryrc diff --git a/.pryrc b/.pryrc new file mode 100644 index 0000000..705f61f --- /dev/null +++ b/.pryrc @@ -0,0 +1,6 @@ +if defined?(PryByebug) + Pry.commands.alias_command 'c', 'continue' + Pry.commands.alias_command 's', 'step' + Pry.commands.alias_command 'n', 'next' + Pry.commands.alias_command 'f', 'finish' +end From b13c290ac22d87735c9b6657ff3c73a2637824d8 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 20 Jan 2019 15:55:10 +0100 Subject: [PATCH 56/63] Add jenv support, brew install jenv --- .profile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.profile b/.profile index 888e390..5eb34d3 100644 --- a/.profile +++ b/.profile @@ -8,6 +8,11 @@ export PATH="/usr/local/opt/curl/bin:$PATH" export GOPATH="$HOME/Projects/go" export PATH="$GOPATH/bin:$PATH" +# Jenv setup +export JENV_ROOT="$HOME/.jenv" +export PATH="$JENV_ROOT/bin:$PATH" +eval "$(jenv init -)" + # Rbenv setup export RBENV_ROOT="$HOME/.rbenv" export RBENV_BUILD_ROOT="$RBENV_ROOT/sources" From 557e987a2ebd301a61d6352f55c41bcc0cfad342 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 20 Jan 2019 15:56:12 +0100 Subject: [PATCH 57/63] update .ssh/config --- .ssh/config | Bin 336 -> 1014 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/.ssh/config b/.ssh/config index 093388c3d5e3b5bb7b8bb22edb90798ea5da097b..e8af5e2b2cadeefe6551e3360833daf6a854f2b8 100644 GIT binary patch literal 1014 zcmV9M@dveQdv+`0J!C?6ak@FIlWZWdcU*Vgubi{(kbsR^5)?71hywuB4u<5 zmzadR$x-wtwTw3a&$_aTj0U4%)t_AQSKs|~&{fu&LnL!(^_c7*r(l>O{H+yyH&O7u zMmHV_pR=j%a$XZWl)F~;;U!5A2tn8{^V-m zD>}?M33ggf|APd$rIc0FoDSj?LFPE> z6uTz6V~?-HfMs__2dNc=TMe-}^89@6H{LCt6Rzv*?D6!y{-adT z>uW|k_E{j>*?aWAi;+!^UZfKOJUv602El7Ohkphox2>nVyo3Up$k~m)e0LfVMOTjU z%Cy}N62V}QKt(gy94&BO(D*|B(qf+O>b{i3W4#_E|2cGzngoKgx*a1}xUG3?qaCJE zcg$ux0N+!mqtvr1ly!n<6T{Q%q|dB9zfE=bh0WCg<)}wN5$Y_=h4{{fa-}!r$_)@2 zSFaTpQGuEsgxiV&5i;uhgm;IPX5f)0FsC}Y6V}A8De=)i0CeVLmy8$YY^X*avHmD| zr5S?YS%eW&<{qdzI*@zsO_Gc9NiNeTKFG45$_ptzaBQ3z1N&8^uvmpwxUUe<(mpWsH9q#a_F;p%J^aGxApS)9$}VbK-Mfg~s|%?H zy!ewpTSz1KMcN0Q|FOvhVe7p4qT#;IK>CVVTh{X@x3eD;AhcLdT2zMCY=?j|>{<`F zSt@EolwxlO#VjIH%6SM@h4lFW&P}fXj#VAwi(Sk2HWO(D*LEOMn^?pzoPbV%$j0@0 z9)W3o+{Fb{tp*au1qMfQt-rzrZ2hm| kzudo21~mXkYg~qAC3Gyq+A+h=VnecvdmCfrzT-r z&srPfOtaZr=SoKPjK{r7%L}Y2BQo7D%6g(xb+T@wpWi%8e5#&4jB`D*Nnn5W(6U irDYUf;3^p?6%8VZrFvkNIIvgD=jSeg3u-_|L2>SV1)*{P From 743e959bc744e64924deafc3e07cf3a52b2db89f Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sun, 20 Jan 2019 15:56:47 +0100 Subject: [PATCH 58/63] Add terraform and Dart / Flutter support to vim --- .vimrc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.vimrc b/.vimrc index 74ae479..267dd1b 100644 --- a/.vimrc +++ b/.vimrc @@ -9,6 +9,10 @@ Plugin 'gmarik/Vundle.vim' " repeat hooks for other plugins Plugin 'tpope/vim-repeat' +" Dart / Flutter +Plugin 'dart-lang/dart-vim-plugin' +Plugin 'reisub0/hot-reload.vim' + " fuzzy search files Plugin 'wincent/command-t' let g:CommandTMatchWindowReverse=1 @@ -144,6 +148,9 @@ let g:is_bash=1 " Install colorschema paramount Plugin 'owickstrom/vim-colors-paramount' +" Terraform support +Plugin 'hashivim/vim-terraform' + call vundle#end() filetype plugin indent on From 73b03daea683b7ff6c01dbabaccdd60b0ab8b4b0 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Wed, 6 Mar 2019 23:27:01 +0100 Subject: [PATCH 59/63] Fix vim and install jenv --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 36ae89e..92ec8e8 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,8 @@ brew: \ brew install curl # hugo is my blogging engine brew install hugo + # jenv manages different java versions + brew install jenv /usr/local/bin/brew: ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -174,7 +176,7 @@ vim: \ vim-itself: # newer version of vim - brew install vim --with-override-system-vi + brew install vim # create vim directories mkdir -p ~/.vim/tmp/{backup,swap,undo} From cf7bda261ed1a772fe38d2374742a88c6078c147 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Thu, 7 Mar 2019 22:07:06 +0100 Subject: [PATCH 60/63] Fix brew / vim / vim command-t / ruby combination command-t requires its extension to be compiled against the same ruby that installs with vim as a dependency through brew --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 92ec8e8..97777c7 100644 --- a/Makefile +++ b/Makefile @@ -187,8 +187,8 @@ vim-plugins: \ # install plugins with temporary vimrc vim -u /tmp/.vimrc +PluginInstall +qall -rm /tmp/.vimrc - # post installation steps of command-t - cd ~/.vim/bundle/command-t/ruby/command-t/ext/command-t && ruby extconf.rb && make + # post installation steps of command-t (use the ruby that ships with vim) + cd ~/.vim/bundle/command-t/ruby/command-t/ext/command-t && /usr/local/opt/ruby/bin/ruby extconf.rb && make # install vundle, a vim package manager ~/.vim/bundle/Vundle.vim: From d8492ca445355582861344ece6c40290919c8338 Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 23 Mar 2019 09:48:36 +0100 Subject: [PATCH 61/63] restart knot-resolver --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 36ae89e..b694113 100644 --- a/Makefile +++ b/Makefile @@ -368,4 +368,4 @@ harder: \ harder-dns-resolver: brew install knot-resolver cp -v ~/dotfiles/etc/kresd/config /usr/local/etc/kresd/config - sudo brew services start knot-resolver + sudo brew services restart knot-resolver From 5657c10e4dd5fca77da1a10d90e86a293f29eb7c Mon Sep 17 00:00:00 2001 From: Lukas Rieder Date: Sat, 23 Mar 2019 09:50:01 +0100 Subject: [PATCH 62/63] re-enable subpixel font aliasing that got disabled in Mojave --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 47e7059..7590ca2 100644 --- a/Makefile +++ b/Makefile @@ -254,6 +254,8 @@ defaults: \ # Keep this bit last # Kill affected applications for app in Safari Finder Mail SystemUIServer; do killall "$$app" >/dev/null 2>&1; done + # Re-enable subpixel aliases that got disabled by default in Mojave + defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO defaults-Dock: # Enable the 2D Dock From b7de2d4ad361918d2ad521b02bbf09ef0a20ba11 Mon Sep 17 00:00:00 2001 From: Alan Yee Date: Sun, 23 Jun 2019 21:11:02 -0700 Subject: [PATCH 63/63] Update .vimrc Disable nomodeline as a security precaution --- .vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vimrc b/.vimrc index 267dd1b..53e46be 100644 --- a/.vimrc +++ b/.vimrc @@ -236,6 +236,10 @@ set synmaxcol=160 " we have a good terminal connection, send more characters for redrawing set ttyfast +" Disable modeline as a security precaution +set modelines=0 +set nomodeline + " disable arrow keys " noremap " noremap