2016-01-24 10:01:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-02-03 08:19:29 +00:00
|
|
|
function install_linux_software {
|
|
|
|
#-------------------------------
|
|
|
|
# Check the OS and set install command
|
|
|
|
#-------------------------------
|
|
|
|
if [ -x "$(which yum)" ]; then
|
|
|
|
INSTALLCMD="yum install -y"
|
|
|
|
elif [ -x "$(which apt-get)" ]; then
|
|
|
|
INSTALLCMD="apt-get install -y"
|
|
|
|
else
|
2016-02-18 07:01:05 +00:00
|
|
|
echo "Sorry, I don't know how to install software on this OS yet."
|
2016-02-03 08:19:29 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
#-------------------------------
|
2016-01-27 15:55:53 +00:00
|
|
|
|
2016-02-07 18:39:49 +00:00
|
|
|
xargs sudo ${INSTALLCMD} <<-EOF
|
2016-02-03 08:19:29 +00:00
|
|
|
ack
|
|
|
|
git
|
|
|
|
htop
|
2016-02-16 19:03:18 +00:00
|
|
|
mosh
|
2016-02-05 13:18:22 +00:00
|
|
|
ss
|
2016-02-03 08:19:29 +00:00
|
|
|
vim
|
|
|
|
EOF
|
|
|
|
}
|
2016-01-24 12:42:52 +00:00
|
|
|
|
2016-02-03 08:19:29 +00:00
|
|
|
function install_osx_software {
|
|
|
|
#-------------------------------
|
|
|
|
# Install Homebrew if missing
|
|
|
|
#-------------------------------
|
|
|
|
if [ ! -x /usr/local/bin/brew ]; then
|
|
|
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
|
|
fi
|
|
|
|
#-------------------------------
|
2016-01-24 12:42:52 +00:00
|
|
|
|
2016-02-03 08:19:29 +00:00
|
|
|
#-------------------------------
|
|
|
|
# Install the basics
|
|
|
|
#-------------------------------
|
|
|
|
xargs brew install <<-EOF
|
|
|
|
ack
|
|
|
|
git
|
|
|
|
coreutils
|
2016-02-16 08:27:02 +00:00
|
|
|
htop-osx
|
2016-02-16 19:03:18 +00:00
|
|
|
mosh
|
2016-02-03 08:19:29 +00:00
|
|
|
python3
|
|
|
|
vim
|
|
|
|
EOF
|
|
|
|
#-------------------------------
|
|
|
|
|
|
|
|
#-------------------------------
|
|
|
|
# Install Casks
|
|
|
|
#-------------------------------
|
|
|
|
xargs brew cask install <<-EOF
|
|
|
|
alfred
|
|
|
|
bbc-iplayer-downloads
|
|
|
|
beardedspice
|
|
|
|
dashlane
|
|
|
|
day-o
|
|
|
|
dropbox
|
|
|
|
cleanmymac
|
|
|
|
firefox
|
|
|
|
flux
|
|
|
|
gitx
|
|
|
|
gpgtools
|
|
|
|
google-chrome
|
|
|
|
google-drive
|
|
|
|
google-hangouts
|
|
|
|
handbrake
|
|
|
|
iterm2
|
|
|
|
sonos
|
|
|
|
textmate
|
|
|
|
vlc
|
|
|
|
vmware-fusion
|
|
|
|
wireshark
|
|
|
|
xquartz
|
|
|
|
yubikey-neo-manager
|
|
|
|
yubikey-personalization-gui
|
|
|
|
EOF
|
|
|
|
#-------------------------------
|
|
|
|
|
|
|
|
#-------------------------------
|
|
|
|
# Some tools require root set-UID
|
|
|
|
#-------------------------------
|
|
|
|
xargs -n1 -I % bash -c 'find $(dirname $(greadlink -f $(which %))) -name $(basename $(which %)) -type f ! \( -perm -u+s -a -user root \) ' <<-EOF | xargs -n 1 -I % sudo bash -c 'chown root: % && chmod u+s %'
|
|
|
|
htop
|
|
|
|
EOF
|
|
|
|
#-------------------------------
|
2016-02-09 08:30:03 +00:00
|
|
|
|
|
|
|
#-------------------------------
|
|
|
|
# Clean up
|
|
|
|
#-------------------------------
|
|
|
|
brew cask cleanup
|
|
|
|
brew cleanup
|
|
|
|
#-------------------------------
|
2016-02-03 08:19:29 +00:00
|
|
|
}
|
2016-01-28 18:43:32 +00:00
|
|
|
|
|
|
|
#-------------------------------
|
2016-02-03 08:19:29 +00:00
|
|
|
# Check for Mac OS X
|
2016-01-28 18:43:32 +00:00
|
|
|
#-------------------------------
|
2016-02-03 08:19:29 +00:00
|
|
|
if [ $(uname -s) == "Darwin" ]; then
|
|
|
|
install_osx_software
|
|
|
|
else
|
|
|
|
install_linux_software
|
|
|
|
fi
|
2016-01-28 18:43:32 +00:00
|
|
|
#-------------------------------
|
2016-02-03 08:19:29 +00:00
|
|
|
|
|
|
|
exit 0
|