Add setup file stubs

This commit is contained in:
Marcel Bischoff 2015-10-24 20:12:16 +02:00
parent 9fd19f700c
commit 2a32adaa40
5 changed files with 264 additions and 0 deletions

11
.editorconfig Normal file
View File

@ -0,0 +1,11 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
[*.md]
indent_size = 4

151
aliases Normal file
View File

@ -0,0 +1,151 @@
###############################################################################
# Finder #
###############################################################################
# Layout {{{
# Hide All Desktop Icons
alias hideicons="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
# Show All Desktop Icons
alias showicons="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# }}}
# Metadata Files {{{
# Recursively Delete .DS_Store Files
alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
# }}}
# Opening Things {{{
# Change Working Directory to Finder Path
# If multiple windows are open, it chooses the top-most one.
alias cdf=`cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')"`
# }}}
###############################################################################
# Fonts #
###############################################################################
# {{{
# Clear Font Cache for Current User
# To clear font caches for all users, put sudo in front of this command.
alias clearfontcache="atsutil databases -removeUser && atsutil server -shutdown && atsutil server -ping"
# }}}
###############################################################################
# Hardware #
###############################################################################
# Hardware Information {{{
# Remaining Battery Percentage
alias battp=`pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f1 -d';'`
# Remaining Battery Time
alias battt=`pmset -g batt | egrep "([0-9]+\%).*" -o --colour=auto | cut -f3 -d';'`
# Show Connected Device's UDID
alias udid="system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p'"
# }}}
# Power Management {{{
# Prevent System Sleep
# Give time in seconds as parameter, like `nosleep 3600`.
alias nosleep="caffeinate -u -t"
# }}}
###############################################################################
# Media #
###############################################################################
# Audio {{{
# Mute Audio Output
alias mute="osascript -e 'set volume output muted true'"
# Set Audio Volume
alias unmute="osascript -e 'set volume 4'"
# }}}
###############################################################################
# Networking #
###############################################################################
# TCP/IP {{{
# Show External IP Address
alias extip="dig +short myip.opendns.com @resolver1.opendns.com"
# Show local IP Address
# Defaults to Wi-Fi connection, change accordingly if needed.
alias ip="ipconfig getifaddr en0"
# }}}
# Wi-Fi {{{
# Airport Utility
alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
# Show Current SSID
alias ssid="airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'"
# Show Wi-Fi Connection History
alias wifilast="defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences | grep LastConnected -A 7"
# Show Wi-Fi Password of Current Connection
alias wifipass=`security find-generic-password -D "AirPort network password" -a "$(airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}')" -gw`
# Show Wi-Fi Connection History
alias wifihist="defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences | grep LastConnected -A 7"
# }}}
###############################################################################
# Security #
###############################################################################
# Passwords {{{
# Generate Secure Password and Copy to Clipboard
# Needs `pwgen` via Homebrew, etc.
alias pw="pwgen -Cs 20 1 | tr -d ' ' | tr -d '\n' | pbcopy"
# }}}
# Physical Access {{{
# Lock Screen
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# }}}
###############################################################################
# System #
###############################################################################
# Software Update {{{
# Install All Available Software Updates
alias update="sudo softwareupdate -ia"
# }}}
###############################################################################
# Terminal #
###############################################################################
# {{{
# Ring Terminal Bell
alias bell="tput bel"
# }}}
# vim:foldmethod=marker:foldlevel=0:ft=sh

50
brew.sh Executable file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env bash
###############################################################################
# Install command-line tools using Homebrew #
###############################################################################
# Make sure were using the latest Homebrew
brew update
# Upgrade any already-installed formulae
brew upgrade
# Install GNU core utilities (those that come with OS X are outdated)
# Dont forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils
sudo ln -s $(brew --prefix)/bin/gsha256sum $(brew --prefix)/bin/sha256sum
# Install GNU `sed`, overwriting the built-in `sed`
brew install gnu-sed --with-default-names
# Install `wget` with IRI support
brew install wget --with-iri
# Install more recent versions of some OS X tools
brew install vim --override-system-vi
brew install homebrew/dupes/grep
brew install homebrew/dupes/openssh
brew install homebrew/dupes/screen
brew install homebrew/php/php56 --with-gmp
# Install archivers
brew install p7zip
brew install pigz
brew install pixz
brew install unrar
brew install xz
# Install other useful binaries
brew install aria2
brew install dark-mode
brew install git
brew install git-lfs
brew install htop
brew install pv
brew install speedtest_cli
brew install tmux
brew install tree
# Remove outdated versions from the cellar
brew cleanup

30
functions Normal file
View File

@ -0,0 +1,30 @@
###############################################################################
# Developer #
###############################################################################
# {{{
function mkicns() {
if [[ -z "$@" ]]; then
echo "Input file missing"
else
filename=${1%.*}
mkdir $filename.iconset
sips -z 16 16 $1 --out $filename.iconset/icon_16x16.png
sips -z 32 32 $1 --out $filename.iconset/icon_16x16@2x.png
sips -z 32 32 $1 --out $filename.iconset/icon_32x32.png
sips -z 64 64 $1 --out $filename.iconset/icon_32x32@2x.png
sips -z 128 128 $1 --out $filename.iconset/icon_128x128.png
sips -z 256 256 $1 --out $filename.iconset/icon_128x128@2x.png
sips -z 256 256 $1 --out $filename.iconset/icon_256x256.png
sips -z 512 512 $1 --out $filename.iconset/icon_256x256@2x.png
sips -z 512 512 $1 --out $filename.iconset/icon_512x512.png
cp $1 $filename.iconset/icon_512x512@2x.png
iconutil -c icns $filename.iconset
rm -r $filename.iconset
fi
}
# }}}
# vim:foldmethod=marker:foldlevel=0:ft=sh

22
setup.sh Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# OS X Setup
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `setup.sh` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# Media #
###############################################################################
# Audio {{{
# Disable Sound Effects on Boot
sudo nvram SystemAudioVolume=" "
# }}}
# vim:foldmethod=marker:foldlevel=0