From 7e10f41a78da4eba1ea37d0fcc075c5fa12b7b25 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Sat, 15 Nov 2014 10:27:50 +0000 Subject: [PATCH] Added scripts to reduce the amount of Github repos. --- bin/genpw.sh | 8 +++++ bin/reconfig-osx.sh | 81 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100755 bin/genpw.sh create mode 100755 bin/reconfig-osx.sh diff --git a/bin/genpw.sh b/bin/genpw.sh new file mode 100755 index 0000000..f443bad --- /dev/null +++ b/bin/genpw.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +LENGTH=12 +[ ${1} ] && LENGTH=${1} + +PW=$(jot -rc 256 48 123 | grep -m${LENGTH} "\w" | rs -g 0 ${LENGTH}) + +echo -n ${PW} diff --git a/bin/reconfig-osx.sh b/bin/reconfig-osx.sh new file mode 100755 index 0000000..6a8a684 --- /dev/null +++ b/bin/reconfig-osx.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +# Prompt for sudo password +sudo -v + +echo " Disabling Dashboard" +defaults write com.apple.dashboard mcx-disabled -boolean YES + +echo " Setting verbose boot mode" +sudo nvram boot-args="-v" + +echo " Disabling trackpad annoyances" +defaults write NSGlobalDomain AppleEnableSwipeNavigateWithScrolls -bool false + +echo " Enable full keyboard control for UI components" +defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 + +echo " Enable password on wake" +defaults write com.apple.screensaver askForPassword -int 1 +defaults write com.apple.screensaver askForPasswordDelay -int 0 + +echo " Set screenshots to PNG" +defaults write com.apple.screencapture type -string "png" + +echo " Configure Finder options" +defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true +defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false +defaults write com.apple.finder ShowMountedServersOnDesktop -bool true +defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true +defaults write NSGlobalDomain AppleShowAllExtensions -bool true +defaults write com.apple.finder ShowStatusBar -bool true +defaults write com.apple.finder _FXShowPosixPathInTitle -bool true +defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" +defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false +defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true +defaults write com.apple.finder AppleShowAllFiles FALSE +defaults write com.apple.finder 'ShowPathbar' -bool true + +echo " Set Dock icon size" +defaults write com.apple.dock tilesize -int 36 +defaults write com.apple.dock no-glass -boolean YES + +echo " Configure Terminal.app" +cp ~/Google\ Drive/data/OS\ X/com.apple.Terminal.plist ~/Library/Preferences + +echo " Disable Time Machine" +hash tmutil &> /dev/null && sudo tmutil disablelocal +defaults write com.apple.TimeMachine 'AutoBackup' -bool false + +echo " Configure Alfred" +defaults write com.alfredapp.Alfred clipboard.autopaste -bool false +defaults write com.alfredapp.Alfred clipboard.enabled -bool true +defaults write com.alfredapp.Alfred clipboard.limit -int 4 +defaults write com.alfredapp.Alfred clipboard.persist -int 3 +defaults write com.alfredapp.Alfred clipboard.snippets.showparent -bool false +defaults write com.alfredapp.Alfred appearance.hideHat -bool true +defaults write com.alfredapp.Alfred appearance.hideStatusBarIcon -bool true +defaults write com.alfredapp.Alfred appearance.rememberQuery -bool true +defaults write com.alfredapp.Alfred appearance.resultCount -int 9 +defaults write com.alfredapp.Alfred appearance.smaller -bool true; +defaults write com.alfredapp.Alfred hotKey -int 49 +defaults write com.alfredapp.Alfred hotMod -int 1048840 +defaults write com.alfredapp.Alfred hotString -string " " +defaults write com.alfredapp.Alfred alfred.sync.folder -string "/Users/scott/Google Drive/data/Alfred" + +echo " Disable volume change notification" +defaults write -g 'com.apple.sound.beep.feedback' -bool false + +echo " Auto-dimming display off" +sudo defaults write /Library/Preferences/com.apple.iokit.AmbientLightSensor "Automatic Display Enabled" -bool false + +echo " Restarting apps" +killall Finder +killall Dock +killall SystemUIServer +killall Alfred\ 2 +killall rcd +open -a Alfred\ 2 + +echo "Done" +sudo -k