Browse Source

[TASK] Initial Commit

This is the initial commit.
pull/2/head
Michael Gerdemann 8 years ago
commit
dd720fb4ca
  1. 15
      README.md
  2. 16
      dotfiles/.aliases
  3. 5
      dotfiles/.exports
  4. 4
      dotfiles/.functions
  5. 43
      dotfiles/.gitconfig
  6. 14
      dotfiles/.gitignore
  7. 3
      dotfiles/.gitmessage
  8. 20
      dotfiles/.zshrc
  9. 22
      setup-a-new-machine.sh
  10. 36
      setup/brew-cask.sh
  11. 18
      setup/brew.sh
  12. 12
      setup/oh-my-zsh.sh
  13. 119
      setup/osx.sh
  14. 25
      sync.sh

15
README.md

@ -0,0 +1,15 @@
# My dotfiles
## How to start on a new machine
```bash
mkdir -p ~/.dotfiles; cd ~/.dotfiles; curl -#L https://github.com/michaelgerdemann/dotfiles/tarball/master | tar -xzv --strip-components 1; ~/.dotfiles/setup-a-new-machine.sh; cd ~
```
## Sync dotfiles to your home
Execute the file ```sync.sh```
```bash
~/.dotfiles/sync.sh
```

16
dotfiles/.aliases

@ -0,0 +1,16 @@
# Change directories
alias back='cd $OLDPWD'
alias cd..='cd ..'
alias ..='cd ../..'
alias ...='cd ../../..'
alias ....='cd ../../../..'
alias .....='cd ../../../../..'
alias .2='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd . ./../../../..'
alias ll='ls -la'
# Misc
alias reboot='sudo reboot'
alias x='exit'

5
dotfiles/.exports

@ -0,0 +1,5 @@
# Make vim the default editor
export EDITOR="vim"
export PATH=$HOME/bin:/usr/local/bin:$PATH
export HOMEBREW_CASK_OPTS="--appdir=/Applications"

4
dotfiles/.functions

@ -0,0 +1,4 @@
# Create a new directory and enter it
function md() {
mkdir -p "$@" && cd "$@"
}

43
dotfiles/.gitconfig

@ -0,0 +1,43 @@
[core]
autocrlf = input
editor = vim
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
excludesfile = ~/.gitignore
[color]
ui = true
diff = true
branch = true
status = true
interactive = true
[commit]
template = ~/.gitmessage
[push]
default = current
[branch]
autosetuprebase = remote
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
pushInsteadOf = "https://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
pushInsteadOf = "https://gist.github.com/"
# Any GitHub repo with my username should be checked out r/w by default
# (http://rentzsch.tumblr.com/post/564806957/public-but-hackable-git-submodules)
[url "git@github.com:michaelgerdemann/"]
insteadOf = "git://github.com/michaelgerdemann/"
# TYPO3 Gerrit Config
[url "ssh://michael.gerdemann@review.typo3.org:29418"]
pushInsteadOf = git://git.typo3.org

14
dotfiles/.gitignore vendored

@ -0,0 +1,14 @@
# Compiled Python files
*.pyc
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
.Trashes

3
dotfiles/.gitmessage

@ -0,0 +1,3 @@
[TASK|FEATURE|BUGFIX]
Resolves:

20
dotfiles/.zshrc

@ -0,0 +1,20 @@
# Path to your oh-my-zsh configuration.
ZSH=/Users/michaelgerdemann/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
plugins=(git flow sublime)
source $ZSH/oh-my-zsh.sh
# User configuration
# Load ~/.exports, ~/.aliases and ~/.functions
for file in ~/.{extra,bash_prompt,exports,aliases,functions}; do
[ -r "$file" ] && source "$file"
done
unset file

22
setup-a-new-machine.sh

@ -0,0 +1,22 @@
# Setup a new machine
echo "Install Homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Install Homebrew packages"
./setup/brew.sh
./setup/brew-cask.sh
echo "Install oh-my-zsh"
./setup/oh-my-zsh.sh
echo "Tweak OS X"
./setup/osx.sh
echo "Install composer"
curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
echo "Install all AppStore Apps!"
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo ""

36
setup/brew-cask.sh

@ -0,0 +1,36 @@
# Install native apps
brew install caskroom/cask/brew-cask
brew tap caskroom/versions
# tools
brew cask install --appdir="/Applications" alfred
brew cask install --appdir="/Applications" 1password
# filesync
brew cask install --appdir="/Applications" dropbox
brew cask install --appdir="/Applications" bittorrent-sync
# dev
brew cask install --appdir="/Applications" tower
brew cask install --appdir="/Applications" phpstorm
brew cask install --appdir="/Applications" sublime-text3
brew cask install --appdir="/Applications" virtualbox
brew cask install --appdir="/Applications" vagrant
brew cask install --appdir="/Applications" sequel-pro
brew cask install --appdir="/Applications" imagealpha
brew cask install --appdir="/Applications" imageoptim
# browsers
brew cask install --appdir="/Applications" google-chrome
brew cask install --appdir="/Applications" firefox
# mail & chat
brew cask install --appdir="/Applications" postbox
brew cask install --appdir="/Applications" adium
# ftp
brew cask install --appdir="/Applications" filezilla
# security
brew cask install --appdir="/Applications" little-snitch

18
setup/brew.sh

@ -0,0 +1,18 @@
# Install command-line tools using Homebrew
# Make sure we’re using the latest Homebrew
brew update
# Upgrade any already-installed formulae
brew upgrade
# Install wget with IRI support
brew install wget --enable-iri
# Install useful tools
brew install vim --override-system-vi
brew install git
brew install node
# Remove outdated versions from the cellar
brew cleanup

12
setup/oh-my-zsh.sh

@ -0,0 +1,12 @@
# Install oh-my-zsh
## Clone the repo
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
mkdir -p .oh-my-zsh/custom/plugins
cd .oh-my-zsh/custom/plugins
git clone git://github.com/sandstorm/oh-my-zsh-flow3-plugin.git flow
chsh -s /bin/zsh
source ~/.zshrc

119
setup/osx.sh

@ -0,0 +1,119 @@
# Tweak OS
## Disable the sound effects on boot
sudo nvram SystemAudioVolume=%00
## Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
## 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
## Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -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
## Enable full keyboard access for all controls
## (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
## Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
defaults write com.apple.screencapture type -string "png"
## 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 status bar
defaults write com.apple.finder ShowStatusBar -bool true
## When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
## Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
## Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
## Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
## Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
## Use column view in all Finder windows by default
## Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
defaults write com.apple.finder FXPreferredViewStyle -string "clmv"
## Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
## Show the ~/Library folder
chflags nohidden ~/Library
## Set the icon size of Dock items to 24 pixels
defaults write com.apple.dock tilesize -int 36
## Change minimize/maximize window effect
defaults write com.apple.dock mineffect -string "scale"
## Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
## Wipe all (default) app icons from the Dock
defaults write com.apple.dock persistent-apps -array
## Hot corners
## Possible values:
### 0: no-op
### 2: Mission Control
### 3: Show application windows
### 4: Desktop
### 5: Start screen saver
### 6: Disable screen saver
### 7: Dashboard
### 10: Put display to sleep
### 11: Launchpad
### 12: Notification Center
### Top left screen corner → Mission Control
defaults write com.apple.dock wvous-tl-corner -int 2
defaults write com.apple.dock wvous-tl-modifier -int 0
## Top right screen corner → Launchpad
defaults write com.apple.dock wvous-tr-corner -int 11
defaults write com.apple.dock wvous-tr-modifier -int 0
## Bottom left screen corner → Notification Center
defaults write com.apple.dock wvous-bl-corner -int 12
defaults write com.apple.dock wvous-bl-modifier -int 0
## Bottom left screen corner → Dashboard
defaults write com.apple.dock wvous-br-corner -int 7
defaults write com.apple.dock wvous-br-modifier -int 0
## Set size of launchpad
### rows
defaults write com.apple.dock springboard-rows -int 10
### columns
defaults write com.apple.dock springboard-columns -int 6
# Kill affected applications
for app in "Activity Monitor" "cfprefsd" \
"Dock" "Finder" "Mail" "Messages" "SystemUIServer" \
"Terminal" "Transmission"; do
killall "${app}" > /dev/null 2>&1
done
echo "Done. Note that some of these changes require a logout/restart to take effect."

25
sync.sh

@ -0,0 +1,25 @@
#!/usr/bin/env zsh
echo "=> Get latest version of dotfiles"
stderr="/tmp/stderr"
git pull --quiet origin master 2>$stderr
if [ -s "${stderr}" ]; then
echo "Opps, an error occured:\n"
cat ${stderr}
rm -f ${stderr}
exit 1
fi
echo "\n===========================================\n"
echo "=> Copy dotfiles into my home-directory"
cp -fRX ./dotfiles/ ~
echo "\n===========================================\n"
echo "=> Reload current session-config"
source ~/.zshrc
echo "\n===========================================\n"
echo "=> ready!"
Loading…
Cancel
Save