forked from colonelpanic/dotfiles
Add a bunch of packages to brew.sh. Add python.sh for installing python things.
Clean up brew installation/add function do_the_brew with cl args for options.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
alias emacs="emacsclient -t"
|
||||
alias xemacs="\emacs --daemon > /dev/null 2&> /dev/null; emacsclient -c &"
|
||||
alias tmux="tmux -2"
|
||||
reload_tmux_conf="tmux source-file .tmux.conf"
|
||||
alias tmux_cb_to_remote_cb='tmux saveb - | linux_nc_paste_to_remote_clipboard'
|
||||
alias timestamp='date +%s'
|
||||
alias fn='find . -name '
|
||||
|
116
dotfiles/lib/shellrc/brew.sh
Executable file
116
dotfiles/lib/shellrc/brew.sh
Executable file
@@ -0,0 +1,116 @@
|
||||
function brew_install_items() {
|
||||
for package_install_string in $@;
|
||||
do
|
||||
# Horrible hack to induce word splitting.
|
||||
eval "package_args=($package_install_string)"
|
||||
brew install $package_args;
|
||||
brew link $package_args[0];
|
||||
done
|
||||
}
|
||||
|
||||
# htop wont display all process information if the owner is not root
|
||||
function fix_brew_htop() {
|
||||
sudo chmod 777 $(readlink -f `which htop`)
|
||||
sudo chown root $(readlink -f `which htop`)
|
||||
sudo chmod 6555 `which htop`
|
||||
}
|
||||
|
||||
function do_the_brew() {
|
||||
ESSENTIAL=(
|
||||
"emacs"
|
||||
"git"
|
||||
"tmux"
|
||||
"python --with-brewed-openssl"
|
||||
"htop"
|
||||
"greadlink"
|
||||
"vim --override-system-vi"
|
||||
"zsh"
|
||||
)
|
||||
# `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
|
||||
# core utilities (those that come with OS X are outdated)
|
||||
BASICS=(
|
||||
"findutils"
|
||||
"coreutils"
|
||||
"binutils"
|
||||
"diffutils"
|
||||
"ed --default-names"
|
||||
"gawk"
|
||||
"gnu-indent --default-names"
|
||||
"gnu-sed --default-names"
|
||||
"gnu-tar --default-names"
|
||||
"gnu-which --default-names"
|
||||
"gnutls --default-names"
|
||||
"grep --default-names"
|
||||
"gzip"
|
||||
"watch"
|
||||
"wdiff --with-gettext"
|
||||
"wget --enable-iri"
|
||||
)
|
||||
SHOULD_INSTALL=(
|
||||
"watch"
|
||||
"nmap"
|
||||
"readline"
|
||||
"netcat"
|
||||
"reattach-to-user-namespace"
|
||||
"daemonize"
|
||||
"ngrep"
|
||||
"gist"
|
||||
"gawk"
|
||||
"pstree"
|
||||
"ack"
|
||||
"hub"
|
||||
"tig"
|
||||
"heroku"
|
||||
"make"
|
||||
)
|
||||
MISC=(
|
||||
"file-formula"
|
||||
"git"
|
||||
"less"
|
||||
"openssh --with-brewed-openssl"
|
||||
"perl518"
|
||||
"python --with-brewed-openssl"
|
||||
"rsync"
|
||||
"svn"
|
||||
"unzip"
|
||||
"macvim --override-system-vim --custom-system-icons"
|
||||
)
|
||||
SCALA=(scala sbt)
|
||||
JAVASCRIPT=(node npm)
|
||||
|
||||
brew update
|
||||
brew tap homebrew/dupes
|
||||
brew install homebrew/dupes/grep
|
||||
while getopts "uebsma" OPTCHAR;
|
||||
do
|
||||
case $OPTCHAR in
|
||||
u)
|
||||
brew upgrade
|
||||
;;
|
||||
e)
|
||||
brew_install_items $ESSENTIAL
|
||||
fix_brew_htop
|
||||
;;
|
||||
b)
|
||||
brew_install_items $BASICS
|
||||
;;
|
||||
s)
|
||||
brew_install_items $SHOULD_INSTALL
|
||||
;;
|
||||
m)
|
||||
brew_install_items $MISC
|
||||
brew_install_items $SCALA
|
||||
brew_install_items $JAVASCRIPT
|
||||
;;
|
||||
a)
|
||||
brew_install_items $ESSENTIAL
|
||||
brew_install_items $BASICS
|
||||
brew_install_items $SHOULD_INSTALL
|
||||
brew_install_items $MISC
|
||||
brew_install_items $SCALA
|
||||
brew_install_items $JAVASCRIPT
|
||||
;;
|
||||
esac
|
||||
done
|
||||
brew cleanup
|
||||
}
|
@@ -1,3 +1,9 @@
|
||||
function dotfiles_abspath() {
|
||||
readlink_command='readlink'
|
||||
command -v greadlink > /dev/null && readlink_command="greadlink"
|
||||
echo "$(${readlink_command} -f "$BASH_SOURCE" | xargs dirname | xargs dirname)"
|
||||
}
|
||||
|
||||
function go2dotfiles() {
|
||||
cd $(dirname `readlink -f ~/.zshrc | xargs dirname`)
|
||||
}
|
||||
@@ -195,12 +201,6 @@ function set_osx_hostname() {
|
||||
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string $new_hostname
|
||||
}
|
||||
|
||||
function fix_brew_htop() {
|
||||
chmod 777 $(readlink -f `which htop`)
|
||||
sudo chown root $(readlink -f `which htop`)
|
||||
sudo chmod 6555 `which htop`
|
||||
}
|
||||
|
||||
function pip_package_location() {
|
||||
pip show $1 | grep Location | get_cols 2
|
||||
}
|
||||
|
35
dotfiles/lib/shellrc/python.sh
Normal file
35
dotfiles/lib/shellrc/python.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
ESSENTIAL=(ipdb ipython virtualenv)
|
||||
FOR_EDITOR=(jedi pyflakes)
|
||||
USEFUL=(
|
||||
Flask
|
||||
ddg
|
||||
ouimeaux
|
||||
readline
|
||||
simplejson
|
||||
tox
|
||||
numpy
|
||||
)
|
||||
|
||||
function install_python_packages() {
|
||||
sudo pip install $ESSENTIAL
|
||||
while getopts "uea" OPTCHAR;
|
||||
do
|
||||
case $OPTCHAR in
|
||||
u)
|
||||
sudo pip install $USEFUL
|
||||
;;
|
||||
e)
|
||||
sudo pip install $FOR_EDITOR
|
||||
;;
|
||||
a)
|
||||
sudo pip install $FOR_EDITOR
|
||||
sudo pip install $USEFUL
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
function install_pygame() {
|
||||
sudo pip install numpy
|
||||
brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
|
||||
/usr/local/share/python/pip install hg+http://bitbucket.org/pygame/pygame
|
||||
}
|
5
dotfiles/lib/shellrc/vim.sh
Normal file
5
dotfiles/lib/shellrc/vim.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
function vimstall() {
|
||||
# This sucks, but BundleInstall fails otherwise.
|
||||
sudo chmod -R 775 $(readlink -f ~/.vim)
|
||||
vim +BundleInstall! +q +q
|
||||
}
|
Reference in New Issue
Block a user