summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Firth <locallycompact@gmail.com>2012-09-22 17:56:08 +0100
committerDan Firth <locallycompact@gmail.com>2012-09-22 20:23:24 +0100
commit63c390a3b81640fe0d2baaeccf8646eab033018f (patch)
tree1e9c411209c9262cc9b734ab378cf8da6cf25b83
downloadsanity-bag-63c390a3b81640fe0d2baaeccf8646eab033018f.tar.bz2
Initial sanity script, includes bashrc configuration, git configuration, android sdk and yoxos setup
-rw-r--r--config/gitconfig21
-rwxr-xr-xrestore-sanity.sh112
2 files changed, 133 insertions, 0 deletions
diff --git a/config/gitconfig b/config/gitconfig
new file mode 100644
index 0000000..e7e144a
--- /dev/null
+++ b/config/gitconfig
@@ -0,0 +1,21 @@
+[user]
+ name = Dan Firth
+ email = locallycompact@gmail.com
+
+[color]
+ branch = auto
+ diff = auto
+ status = auto
+[color "branch"]
+ current = yellow reverse
+ local = yellow
+ remote = green
+[color "diff"]
+ meta = yellow bold
+ frag = magenta bold
+ old = red bold
+ new = green bold
+[color "status"]
+ added = yellow
+ changed = green
+ untracked = cyan
diff --git a/restore-sanity.sh b/restore-sanity.sh
new file mode 100755
index 0000000..783fe7c
--- /dev/null
+++ b/restore-sanity.sh
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+## INITIALIZE ##
+OPTS=`getopt -o axby -l nuke -- "$@"`
+if [ $? != 0 ]
+then
+ exit 1
+fi
+
+eval set -- "$OPTS"
+
+while true ; do
+ case "$1" in
+ --nuke) NUKE=true; shift 1;;
+ --) shift; break;;
+ esac
+done
+
+## COLORS ##
+DEFAULT_COLOR='\033[39;1m'
+HEADER_COLOR='\033[33;1m'
+echo -e $DEFAULT_COLOR
+
+## PATHS ##
+echo -e $HEADER_COLOR"Setting up home paths..."$DEFAULT_COLOR
+DESKTOP_PATH=$HOME/desktop
+DEVELOPMENT_PATH=$HOME/dev
+DOWNLOADS_PATH=$HOME/downloads
+SCRIPTS_PATH=$HOME/scripts
+SHORTCUTS_PATH=$HOME/shortcuts
+
+## CLEAN ##
+if [[ $NUKE ]]; then
+ echo -e $HEADER_COLOR"Cleaning paths..."$DEFAULT_COLOR
+ rm -rf $DESKTOP_PATH $DEVELOPMENT_PATH $DOWNLOADS_PATH $SCRIPTS_PATH $SHORTCUTS_PATH
+ mkdir $DESKTOP_PATH $DEVELOPMENT_PATH $DOWNLOADS_PATH $SCRIPTS_PATH $SHORTCUTS_PATH
+fi
+
+## GIT CONFIG ##
+echo -e $HEADER_COLOR"Configuring git..."$DEFAULT_COLOR
+GIT_CONFIG=config/gitconfig
+GIT_CONFIG_DST=$HOME/.gitconfig
+cp $GIT_CONFIG $GIT_CONFIG_DST
+
+## BASH-PRE ##
+echo -e $HEADER_COLOR"Creating bash configuration..."$DEFAULT_COLOR
+BASH_CONFIG=bashrc
+if [ -e $BASH_CONFIG ]; then
+ rm $BASH_CONFIG
+fi
+touch $BASH_CONFIG
+
+## INFRASTRUCTURE ##
+echo -e $HEADER_COLOR"Setting up environment infrastructure..."$DEFAULT_COLOR
+cp -r scripts/* $SCRIPTS_PATH/
+echo "HOME_SCRIPTS=$SCRIPTS_PATH" >> $BASH_CONFIG
+echo "HOME_SHORTCUTS=$SHORTCUTS_PATH" >> $BASH_CONFIG
+echo "PATH=\$PATH:\$HOME_SCRIPTS" >> $BASH_CONFIG
+echo "PATH=\$PATH:\$HOME_SHORTCUTS" >> $BASH_CONFIG
+
+## ANDROID SETUP ##
+
+ANDROID_SDK_URL_ROOT=http://dl.google.com/android
+ANDROID_SDK_RELEASE=android-sdk_r20.0.3-linux.tgz
+ANDROID_SDK_RELEASE_LOCAL=$DOWNLOADS_PATH/$ANDROID_SDK_RELEASE
+ANDROID_SDK_ROOT=$DEVELOPMENT_PATH/android-sdk-linux
+ANDROID_SDK_BASE=$ANDROID_SDK_ROOT/platform-tools
+ANDROID_SDK_TOOLS=$ANDROID_SDK_ROOT/tools
+
+if [[ $NUKE ]]; then
+ echo -e $HEADER_COLOR"Setting up Android SDK..."$DEFAULT_COLOR
+ wget $ANDROID_SDK_URL_ROOT/$ANDROID_SDK_RELEASE -P $DOWNLOADS_PATH
+ tar -xvf $ANDROID_SDK_RELEASE_LOCAL -C $DEVELOPMENT_PATH
+ android update sdk --no-ui
+fi
+echo "ANDROID_SDK=$ANDROID_SDK_BASE" >> $BASH_CONFIG
+echo "ANDROID_SDK_TOOLS=$ANDROID_SDK_TOOLS" >> $BASH_CONFIG
+echo "PATH=\$PATH:\$ANDROID_SDK:\$ANDROID_SDK_TOOLS" >> $BASH_CONFIG
+
+ANDROID_NDK_URL_ROOT=http://dl.google.com/android/ndk
+ANDROID_NDK_RELEASE=android-ndk-r8b-linux-x86.tar.bz2
+ANDROID_NDK_RELEASE_LOCAL=$DOWNLOADS_PATH/$ANDROID_NDK_RELEASE
+ANDROID_NDK_ROOT=$DEVELOPMENT_PATH/android-ndk-r8b
+
+if [[ $NUKE ]]; then
+ echo -e $HEADER_COLOR"Setting up Android NDK..."$DEFAULT_COLOR
+ wget $ANDROID_NDK_URL_ROOT/$ANDROID_NDK_RELEASE -P $DOWNLOADS_PATH
+ tar -xvf $ANDROID_NDK_RELEASE_LOCAL -C $DEVELOPMENT_PATH/
+fi
+
+echo "ANDROID_NDK=$ANDROID_NDK_ROOT" >> $BASH_CONFIG
+echo "PATH=\$PATH:\$ANDROID_NDK" >> $BASH_CONFIG
+
+## YOXOS SETUP ##
+
+YOXOS_URL_ROOT=http://dzcriijehao7a.cloudfront.net/5.5.1
+YOXOS_RELEASE=Yoxos_Launcher-5.5.1-linux.gtk.x86_64.zip
+YOXOS_RELEASE_LOCAL=$DOWNLOADS_PATH/$YOXOS_RELEASE
+YOXOS_ROOT=$DEVELOPMENT_PATH/yoxos_launcher
+
+if [[ $NUKE ]]; then
+ echo -e $HEADER_COLOR"Setting up Yoxos..."$DEFAULT_COLOR
+ wget $YOXOS_URL_ROOT/$YOXOS_RELEASE -P $DOWNLOADS_PATH
+ unzip -o $YOXOS_RELEASE_LOCAL -d $DEVELOPMENT_PATH
+fi
+ln -s $YOXOS_ROOT/yoxos $SHORTCUTS_PATH/yoxos
+
+## CONFIG ##
+echo -e $HEADER_COLOR"Finalizing configuration and permissions..."$DEFAULT_COLOR
+BASH_CONFIG_DST=$HOME/.bashrc
+mv $BASH_CONFIG $BASH_CONFIG_DST
+chmod +x $SCRIPTS_PATH/*