1
0
mirror of https://github.com/kremalicious/dotfiles.git synced 2024-12-22 09:13:22 +01:00

update & cleanup almost everything

This commit is contained in:
Matthias Kretschmann 2014-11-03 17:40:13 +01:00
parent e0f119826a
commit 9374e26708
17 changed files with 278 additions and 150 deletions

View File

@ -7,11 +7,8 @@ alias ll='ls -la'
# Get into some servers FAST. Server, user & port are in .ssh/config
alias krlc='ssh kremalicious'
# Terminal needs more Espresso
alias esp="open -a Espresso"
# Update All The Things
alias update='update.sh'
alias update='update-everything.sh'
# Recursively delete `.DS_Store` files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"

View File

@ -12,7 +12,7 @@
# Load ~/.private, ~/.bash_prompt
# ----------------------------------------------------------------------
for file in ~/.{bash_prompt,aliases,private,inputrc}; do
for file in ~/.{bash_prompt,aliases,exports,paths,private,inputrc}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file"
done;
unset file;
@ -24,10 +24,6 @@ unset file;
# Append to the Bash history file, rather than overwriting it
shopt -s histappend
# Prefer US English and use UTF-8
export LC_ALL="en_US.UTF-8"
export LANG="en_US"
# fuck that you have new mail shit
unset MAILCHECK
@ -51,33 +47,11 @@ elif [ -f /etc/bash_completion ]; then
source /etc/bash_completion;
fi;
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
# ----------------------------------------------------------------------
# PATH
# ----------------------------------------------------------------------
# Add `killall` tab completion for common apps
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal" killall;
# we want the various sbins on the path along with /usr/local/bin
PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin"
PATH="/usr/local/bin:$PATH"
[ -d "$HOME/.bin" ] && PATH="$HOME/.bin:$PATH"
# if these bins exist, then add them to the PATH
ANDROID_HOME="/usr/local/opt/android-sdk"
[ -d "$ANDROID_HOME" ] && PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
[ -d "/usr/local/mysql/bin" ] && PATH="/usr/local/mysql/bin:$PATH"
[ -d "/usr/local/share/npm/bin" ] && PATH="/usr/local/share/npm/bin:$PATH"
[ -d "$HOME/.rvm/bin" ] && PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH;
# ----------------------------------------------------------------------
# LSCOLORS
# ----------------------------------------------------------------------
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad
# aws-cli tab completion
complete -C aws_completer aws

View File

@ -115,7 +115,7 @@ PS1+="\[${white}\] in ";
PS1+="\[${green}\]\w"; # working directory
PS1+="\$(prompt_git \"${white} on ${violet}\")"; # Git repository details
PS1+="\n";
PS1+="\[${white}\]→ \[${reset}\]"; # `$` (and reset color)
PS1+="\[${white}\]→ \[${reset}\]"; # `` (and reset color)
export PS1;
PS2="\[${yellow}\]→ \[${reset}\]";

3
bashrc
View File

@ -1 +1,2 @@
[ -n "$PS1" ] && source ~/.bash_profile
[ -n "$PS1" ] && source ~/.bash_profile
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

View File

@ -13,33 +13,61 @@
# dotfiles directory
dir=~/Projects/dotfiles
# list of files/folders to symlink in homedir
files="aliases bashrc bash_profile bash_prompt gemrc gitconfig gitignore_global hushlogin inputrc private tm_properties generator.json npmrc bin"
files="aliases bashrc bash_profile bash_prompt exports gemrc gitconfig gitignore hushlogin inputrc paths private tm_properties generator.json npmrc bin"
# ----------------------------------------------------------------------
# change to the dotfiles directory
# ----------------------------------------------------------------------
echo "Changing to the $dir directory"
cd $dir
echo "...done"
# ----------------------------------------------------------------------
# pull in changes
# ----------------------------------------------------------------------
echo "Getting changes"
git pull
echo "...done"
echo "$(tput setaf 136)"
echo " Getting changes "
echo "============================================="
echo "$(tput sgr0)" # reset
#git pull
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
# ----------------------------------------------------------------------
# delete existing dotfiles in ~
# ----------------------------------------------------------------------
for file in $files; do
rm ~/.$file
done
# ----------------------------------------------------------------------
# create symlinks from the homedir to any files in the ~/dotfiles directory
# specified in $files
# ----------------------------------------------------------------------
for file in $files; do
echo "Removing any existing dotfiles from ~"
rm ~/.$file
echo "...done"
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/.$file
echo "$(tput setaf 64)$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
done
echo "...all done"
# ----------------------------------------------------------------------
# source what we just created
# ----------------------------------------------------------------------
source ~/.bash_profile
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ all done"
echo "$(tput sgr0)" # reset

82
bin/update-everything.sh Executable file
View File

@ -0,0 +1,82 @@
#!/bin/bash
#
# OS X
# -------------
#sudo softwareupdate -i -a
#
# Homebrew
# -------------
echo "$(tput setaf 136)"
echo " Update Homebrew "
echo "============================================="
echo "$(tput sgr0)" # reset
brew update
brew upgrade
brew cleanup
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
#
# npm
# -------------
echo "$(tput setaf 136)"
echo " Update npm "
echo "============================================="
echo "$(tput sgr0)" # reset
# update npm itself
npm install npm -g
# update all global packages
#npm update -g
sh npm-upgrade.sh
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
#
# Ruby
# -------------
echo "$(tput setaf 136)"
echo " Update rvm "
echo "============================================="
echo "$(tput sgr0)" # reset
# update rvm itself
rvm get latest
rvm cleanup all
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
#
# Gems
# -------------
echo "$(tput setaf 136)"
echo " Update gems "
echo "============================================="
echo "$(tput sgr0)" # reset
gem update --system
gem update
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset

View File

@ -1,41 +0,0 @@
#!/bin/bash
#
# OS X
# -------------
#sudo softwareupdate -i -a
#
# Homebrew
# -------------
brew update
brew upgrade
brew cleanup
#
# npm
# -------------
# update npm itself
npm install npm -g
# update all global packages
#npm update -g
sh npm-upgrade.sh
#
# Ruby
# -------------
rvm get branch master
rvm cleanup all
#
# Gems
# -------------
gem update --system
gem update

View File

@ -12,24 +12,89 @@
# ----------------------------------------------------------------------
# dotfiles directory
dir=~/Projects/dotfiles
dir=$DOTFILES_DIR
# list of files/folders to symlink in homedir
files="aliases bashrc bash_profile bash_prompt gemrc gitconfig gitignore_global hushlogin inputrc private tm_properties generator.json npmrc bin"
files="aliases bashrc bash_profile bash_prompt exports gemrc gitconfig gitignore hushlogin inputrc paths private tm_properties generator.json npmrc bin"
# ----------------------------------------------------------------------
# change to the dotfiles directory
# ----------------------------------------------------------------------
echo "Changing to the $dir directory"
cd $dir
echo "...done"
# ----------------------------------------------------------------------
# create symlinks from the homedir to any files in the ~/dotfiles directory
# create symlinks from the homedir to any files in the dotfiles directory
# specified in $files
# ----------------------------------------------------------------------
for file in $files; do
echo "Creating symlink to $file in home directory."
ln -s $dir/$file ~/.$file
echo "$(tput setaf 64)$(tput sgr0) Created symlink to $(tput setaf 37)$file$(tput sgr0)"
done
echo "...all done"
# ----------------------------------------------------------------------
# source what we just created
# ----------------------------------------------------------------------
source ~/.bash_profile
# ----------------------------------------------------------------------
# Homebrew
# ----------------------------------------------------------------------
echo "$(tput setaf 136)"
echo " Brewing all the things. "
echo "============================================="
echo "$(tput sgr0)" # reset
./brew.sh
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
# ----------------------------------------------------------------------
# npm
# ----------------------------------------------------------------------
echo "$(tput setaf 136)"
echo " npm all the things. "
echo "============================================="
echo "$(tput sgr0)" # reset
./npm.sh
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
# ----------------------------------------------------------------------
# Ruby
# ----------------------------------------------------------------------
echo "$(tput setaf 136)"
echo " Ruby all the things. "
echo "============================================="
echo "$(tput sgr0)" # reset
./ruby.sh
echo "$(tput setaf 64)" # green
echo "---------------------------------------------"
echo " ✓ done"
echo "$(tput sgr0)" # reset
echo "$(tput setaf 64)" # green
echo "============================================="
echo " ✓ all done"
echo "============================================="
echo "$(tput sgr0)" # reset

View File

10
exports Normal file
View File

@ -0,0 +1,10 @@
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Prefer US English and use UTF-8
export LC_ALL="en_US.UTF-8"
export LANG="en_US"
# LSCOLORS
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad

View File

@ -2,17 +2,19 @@
# Le Git Config
########################################################################
[user]
email = m@kretschmann.io
name = Matthias Kretschmann
# Values coming from environment variables set in private file
# [user]
# email =
# name =
[github]
user = kremalicious
token = !"cat ~/.auth/github | tr -d \"\n\""
[credential]
helper = osxkeychain
[core]
excludesfile = ~/.gitignore_global
excludesfile = ~/.gitignore
quotepath = false
# Handle umlauts and such better on OS X
@ -82,4 +84,7 @@
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
trustExitCode = true
[user]
name =
email = m@kretschmann.io

19
inputrc
View File

@ -2,4 +2,21 @@
set completion-ignore-case on
# Auto list tab completions (use instead of TAB-cycling)
set show-all-if-ambiguous on
set show-all-if-ambiguous on
# Immediately add a trailing slash when autocompleting symlinks to directories
set mark-symlinked-directories on
# Do not autocomplete hidden files unless the pattern explicitly begins with a dot
set match-hidden-files off
# Show all autocomplete results at once
set page-completions off
# Show extra file information when completing, like `ls -F` does
set visible-stats on
# Allow UTF-8 input and output, instead of showing stuff like $'\0123\0456'
set input-meta on
set output-meta on
set convert-meta off

View File

@ -3,7 +3,7 @@
# Installed from brewfile with node
# install global stuff
npm install -g bower grunt grunt-cli gulp
npm install -g bower grunt grunt-cli gulp nib stylus
# Install Keybase
# https://keybase.io/docs/command_line/installation

59
osx
View File

@ -10,16 +10,6 @@ sudo -v
# Keep-alive: update existing `sudo` time stamp until `osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# General UI/UX #
###############################################################################
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable automatic termination of inactive apps
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
###############################################################################
# Trackpad, mouse, keyboard, and input #
@ -33,15 +23,9 @@ defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Finder #
###############################################################################
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# 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
@ -58,9 +42,6 @@ defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Disable the warning before emptying the Trash
defaults write com.apple.finder WarnOnEmptyTrash -bool false
# Empty Trash securely by default
defaults write com.apple.finder EmptyTrashSecurely -bool true
# Show the ~/Library folder
chflags nohidden ~/Library
@ -69,15 +50,6 @@ chflags nohidden ~/Library
# Dock, Dashboard, and hot corners #
###############################################################################
# Show indicator lights for open applications in the Dock
defaults write com.apple.dock show-process-indicators -bool true
# Speed up Mission Control animations
defaults write com.apple.dock expose-animation-duration -float 0.1
# Dont automatically rearrange Spaces based on most recent use
defaults write com.apple.dock mru-spaces -bool false
# Add a spacer to the left side of the Dock (where the applications are)
#defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
# Add a spacer to the right side of the Dock (where the Trash is)
@ -91,17 +63,6 @@ defaults write com.apple.dock mru-spaces -bool false
# Set Safaris home page to `about:blank` for faster loading
defaults write com.apple.Safari HomePage -string "about:blank"
# Allow hitting the Backspace key to go to the previous page in history
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
# Enable Safaris debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Enable the Develop menu and the Web Inspector in Safari
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
# Make Safaris search banners default to Contains instead of Starts With
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
@ -119,6 +80,16 @@ defaults write com.apple.Safari WebKitUserStyleSheetLocationPreferenceKey -strin
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
###############################################################################
# SSD-specific tweaks #
###############################################################################
# Disable local Time Machine snapshots
sudo tmutil disablelocal
# Disable the sudden motion sensor as its not useful for SSDs
sudo pmset -a sms 0
###############################################################################
# Terminal #
@ -140,8 +111,12 @@ hash tmutil &> /dev/null && sudo tmutil disablelocal
###############################################################################
# GPGMail 2 #
# Kill affected applications #
###############################################################################
# Disable signing emails by default
defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false
for app in "Activity Monitor" "Address Book" "Calendar" "Contacts" "cfprefsd" \
"Dock" "Finder" "Mail" "Messages" "Safari" "SystemUIServer" \
"Terminal"; do
killall "${app}" > /dev/null 2>&1
done
echo "Done. Note that some of these changes require a logout/restart to take effect."

12
paths Normal file
View File

@ -0,0 +1,12 @@
[ -d "$HOME/.bin" ] && PATH="$HOME/.bin:$PATH"
ANDROID_HOME="/usr/local/opt/android-sdk"
[ -d "$ANDROID_HOME" ] && PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
[ -d "/usr/local/mysql/bin" ] && PATH="/usr/local/mysql/bin:$PATH"
[ -d "/usr/local/share/npm/bin" ] && PATH="/usr/local/share/npm/bin:$PATH"
[ -d "$HOME/.rvm/bin" ] && PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH

View File

@ -3,9 +3,12 @@
# Install RVM
curl -sSL https://get.rvm.io | bash
# handle requirements
rvm requirements
# Install a Ruby
rvm install 2.1.1
rvm use 2.1.1
rvm install 2.1.4
rvm use --default 2.1.4
rvm rubygems latest
# Install gems