From 31ddb38d6a670e0fa1dc9a4f49f6f17158d5b118 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 13:29:45 -0400 Subject: [PATCH 1/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97db3db33..3813c8717 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ I'm documenting this for personal use. Shell settings, vim settings, commonly us * migrate Google Chrome bookmarks to new machine ### Commonly used applications -* homebrew - `key-repeat: 50ms delay-until-repeat: 300ms` necessary for procuring shell applications -* karabiner - increase your Mac's key repeat settings beyond the default range +* homebrew - necessary for procuring shell applications +* karabiner - `key-repeat: 50ms delay-until-repeat: 300ms` increase your Mac's key repeat settings beyond the default range * spectacle - resize and move your windows with keyboard shortcuts * iterm - substitute for Terminal application * oh my zsh - z-shell for Mac From 792c690e0d2908f5b4d83c03fb413b2c80975ab0 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 13:35:05 -0400 Subject: [PATCH 2/4] Adds script to batch install brew packages --- install_brew_packages.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 install_brew_packages.sh diff --git a/install_brew_packages.sh b/install_brew_packages.sh new file mode 100755 index 000000000..050ff655f --- /dev/null +++ b/install_brew_packages.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +pushd "$HOME/pc_settings" + +# install brew dependencies +cat ./brew_packages.txt | xargs brew install + +popd + From 3306754932caa6436ec51fe8d508eb6de75aaf1e Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 14:01:51 -0400 Subject: [PATCH 3/4] Adds brew to PATH and adds is_online function --- .bash_profile | 26 +++++++++++++++----------- .misc_functions.sh | 13 ------------- .w_functions.sh | 18 ++++++++++++++++-- install.sh | 5 +++++ install_brew.sh | 21 +++++++++++++++++++++ install_brew_packages.sh | 9 --------- 6 files changed, 57 insertions(+), 35 deletions(-) delete mode 100644 .misc_functions.sh create mode 100644 install.sh create mode 100755 install_brew.sh delete mode 100755 install_brew_packages.sh diff --git a/.bash_profile b/.bash_profile index b72e72584..cf03d3a6f 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,17 +1,21 @@ -# bash profile settings for William Carroll +export PATH=$HOME/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH -# welcome message -echo "Hello, welcome back, William" -# change bash prompt -PS1='$ ' +echo "Welcome back, $USER" -# input mode to Vi +# use vi bindings for terminal input set -o vi -# shortcuts -alias h="history" -alias vi="vim" -alias c="clear" +# aliases +source $HOME/pc_settings/.w_aliases.sh + +# functions +source $HOME/pc_settings/.w_functions.sh + +# run cmatrix command for 3 seconds before exiting +#. $HOME/pc_settings/.matrix_intro.sh + +# syntax highlighting for CLI; if not installed, run the following command +# brew install zsh-syntax-highlighting +source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -export EDITOR=/usr/bin/vim diff --git a/.misc_functions.sh b/.misc_functions.sh deleted file mode 100644 index e775c2a89..000000000 --- a/.misc_functions.sh +++ /dev/null @@ -1,13 +0,0 @@ -# download files to /tmp directory -function wdownload { - URL="$1" - FILENAME="$(basename $URL)" - - wget -O /tmp/"$FILENAME" $URL >/dev/null && open /tmp && echo "Downloaded to: /tmp/$FILENAME" || echo "Error ..." -} - -# spell checker -function wspcheck { - if [ $# -ge 1 -a -f "$1" ] && input="$1" || input="-" - cat "$input" | tr '[:upper:]' '[:lower:]' | tr -cd '[:alpha:]_ \n' | tr -s ' ' '\n' | sort | comm -23 - ~/english_words.txt -} diff --git a/.w_functions.sh b/.w_functions.sh index e1a76bd3f..071289e46 100644 --- a/.w_functions.sh +++ b/.w_functions.sh @@ -1,4 +1,4 @@ -functon npms() { +npms() { clear; npm start; } @@ -10,7 +10,7 @@ source $HOME/pc_settings/.js_to_bash.sh source $HOME/pc_settings/.git_functions.sh # custom bash helpers functions -source $HOME/pc_settings/.misc_functions.sh +# source $HOME/pc_settings/.misc_functions.sh # generates placeholder content for FE work function lorem { @@ -29,3 +29,17 @@ function wsearchpath { echo $PATH | tr ':' '\n' | xargs -I {} find {} -type f -perm +111 -maxdepth 1 -name "*${1}*" -print | xargs basename } + +# tests an internet connection +function is_online { + wget -q --spider "http://google.com" + + if [ $? -eq 0 ]; then + echo "Online" + return 0 + else + echo "Offline" + return 1 + fi +} + diff --git a/install.sh b/install.sh new file mode 100644 index 000000000..302245f14 --- /dev/null +++ b/install.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# install brew and its packages +. ./install_brew.sh + diff --git a/install_brew.sh b/install_brew.sh new file mode 100755 index 000000000..a86f1a155 --- /dev/null +++ b/install_brew.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +echo "Installing Homebrew..." +$(which ruby) -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" +$(which ruby) -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +echo "Homebrew installed." +echo "" + +pushd "$HOME/pc_settings" + +# install brew dependencies +echo "Installing Homebrew packages..." +cat ./brew_packages.txt | xargs brew install +echo "Homebrew packages installed." +echo "" + +echo "Homebrew installed complete!" +echo "" + +popd + diff --git a/install_brew_packages.sh b/install_brew_packages.sh deleted file mode 100755 index 050ff655f..000000000 --- a/install_brew_packages.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -pushd "$HOME/pc_settings" - -# install brew dependencies -cat ./brew_packages.txt | xargs brew install - -popd - From 342e7dbcd9fb6954be127b43a7850e4513ef8304 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 23 Aug 2016 14:12:30 -0400 Subject: [PATCH 4/4] Removes zsh related items --- .bash_profile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.bash_profile b/.bash_profile index cf03d3a6f..28e20bb64 100644 --- a/.bash_profile +++ b/.bash_profile @@ -12,10 +12,6 @@ source $HOME/pc_settings/.w_aliases.sh # functions source $HOME/pc_settings/.w_functions.sh -# run cmatrix command for 3 seconds before exiting -#. $HOME/pc_settings/.matrix_intro.sh - # syntax highlighting for CLI; if not installed, run the following command # brew install zsh-syntax-highlighting -source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh