Skip to content

Instantly share code, notes, and snippets.

@hlb
Forked from saetia/gist:1623487
Last active June 14, 2022 02:48
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save hlb/f792f4fa680b737dc51f to your computer and use it in GitHub Desktop.
Save hlb/f792f4fa680b737dc51f to your computer and use it in GitHub Desktop.
Clean Install Script
cask_args appdir: '/Applications'
tap 'caskroom/cask'
tap "homebrew/cask-fonts"
tap 'caskroom/versions'
tap "homebrew/bundle"
tap "homebrew/core"
tap "homebrew/services"
tap "hsatac/toybox"
brew "coreutils"
brew "gnu-sed"
brew "gnu-tar"
brew "gawk"
brew "gnutls"
brew "grep"
brew "findutils"
brew "byobu"
brew "colordiff"
brew "diffutils"
brew "git"
brew "htop"
brew "imagemagick"
brew "macvim"
brew "mosh"
brew "mtr"
brew "rsync"
brew "ssh-copy-id"
brew "tree"
brew "wget"
brew "zsh"
brew "zsh-autosuggestions"
brew "zsh-syntax-highlighting"
brew "hsatac/toybox/wifi-password-qr"
brew "asciinema"
brew "ansible"
brew "terraform"
brew "dnsmasq", restart_service: true
brew "kubernetes-helm"
brew "helmfile"
brew "jq"
brew "kubernetes-cli"
brew "kube-ps1"
brew "kubectx"
brew "tmate"
brew "watch"
brew "yq"
cask '1password'
cask 'google-chrome'
cask 'slack'
cask "docker"
cask "font-fira-code"
cask "font-fontawesome"
cask "font-inconsolata-for-powerline"
cask "font-noto-sans-cjk"
cask "font-source-code-pro"
cask "font-sourcecodepro-nerd-font"
cask "google-cloud-sdk"
cask "iterm2"
cask "java"
cask "minikube"
cask "notion"
cask "virtualbox"
cask "visual-studio-code"

System Preferences

check set-system-preferences.sh

Install Software

Softwares should be controlled by brew. Install homebrew http://brew.sh

brew tap Homebrew/bundle
brew install mas

Install xcode:

mas install 497799835
sudo xcodebuild -license accept
xcode-select --install

Put Brewfile in the folder and run:

brew bundle

zshrc

Install oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh first. Then:

# alias "rm" to "rm -i" to avoid disaster.
echo 'alias rm="rm -i"' >> ~/.zshrc

# brew
echo 'alias cask="brew cask"' >> ~/.zshrc
echo 'export HOMEBREW_CASK_OPTS="--appdir=/Applications"' >> ~/.zshrc

# autojump
echo '[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh' >> ~/.zshrc

# Fish-like autosuggestions
echo 'source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ./.zshrc

Setup Hostname (Be sure to change hostname to yours)

sudo scutil --set HostName kelon

Setup Git (Be sure to change email and name to yours)

# Creates a new ssh key
ssh-keygen -t rsa -b 4096 -C "hlbyichi@gmail.com"

# Copy ssh key to clipboard for adding to github.com
pbcopy < ~/.ssh/id_rsa.pub

# Test connection
ssh -T git@github.com

# Set git config values
git config --global user.name "hlb" && \
git config --global user.email "hlbyichi@gmail.com" && \
git config --global github.user hlb && \
git config --global color.ui true && \
git config --global push.default simple && \
git config --global alias.co checkout && \
git config --global alias.ci commit -v&& \
git config --global alias.st status && \
git config --global alias.br branch && \
git config --global alias.ll "log --stat" && \
git config --global alias.lp "log --pretty=oneline --abbrev-commit --decorate --graph"
#!/bin/bash
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Disable window animations ("new window" scale effect)
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0
# Set default Finder location to home folder (~/)
defaults write com.apple.finder NewWindowTarget -string "PfLo" && \
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}"
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
# Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
# Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true && \
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true && \
defaults write com.apple.Safari IncludeDevelopMenu -bool true && \
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true && \
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true && \
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
# Show absolute path in finder's title bar.
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
@c9s
Copy link

c9s commented May 24, 2016

And ... change screenshot directory?

defaults write com.apple.screencapture location ~/Dropbox/Screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment