diff --git a/.gitignore b/.gitignore index 19a74cd..6a642a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /**/efu.log +/**/summary.efu.log +test.sh ### JetBrains template /**/.idea/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cb63cbe --- /dev/null +++ b/.travis.yml @@ -0,0 +1,36 @@ +language: sh + +before_script: + - sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-backports restricted main universe" + - sudo apt-get update -qq + - sudo apt-get install -qq shellcheck + +script: + - shellcheck functions.sh + - shellcheck createDirectoriesTree.sh + - shellcheck common.sh + - shellcheck install.sh + - shellcheck modules/sdkman/sdkman.sh + - shellcheck modules/android.sh + - shellcheck modules/gimp.sh + - shellcheck modules/git.sh + - shellcheck modules/go.sh + - shellcheck modules/google-app-engine.sh + - shellcheck modules/google-drive.sh + - shellcheck modules/heroku.sh + - shellcheck modules/homebrew.sh + - shellcheck modules/java.sh + - shellcheck modules/maven.sh + - shellcheck modules/mixxx.sh + - shellcheck modules/nodejs.sh + - shellcheck modules/oh-my-zsh.sh + - shellcheck modules/ssh.sh + - shellcheck modules/sublime-text.sh + - shellcheck modules/tomcat.sh + - shellcheck OS\ X/installAll-10.11.sh + - shellcheck Ubuntu/core.sh + - shellcheck Ubuntu/installAll-15.04.sh + +notifications: + email: + on_failure: change \ No newline at end of file diff --git a/OS X/installAll-10.11.sh b/OS X/installAll-10.11.sh new file mode 100644 index 0000000..c305070 --- /dev/null +++ b/OS X/installAll-10.11.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Created by Nahuel Barrios. +# Just comment the undesired software to skip installing specific software. + + +preInstallationLog "Transmission" +brew install transmission +postInstallationLog "Transmission" \ No newline at end of file diff --git a/OS X/installAll-10.9.sh b/OS X/installAll-10.9.sh deleted file mode 100644 index cd6beb5..0000000 --- a/OS X/installAll-10.9.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -# Script created by Nahuel Barrios: barrios.nahuel@gmail.com -# Last run: 11/12/14 -# Just comment the undesired software to skip installing specific software. - -# FROM HERE -. ./../createDirectoriesTree.sh -. ./../functions.sh - -echo "==> - EFU: Loading properties..." -. ./properties.sh -# TO HERE, IS THE SAME FOR ALL OTHER PLATFORMS - -echo "==> - EFU: Adding some aliases to ~/.bash_profile..." -echo "alias ll='ls -la'" >> ~/.bash_profile && -. ~/.bash_profile && - -echo 'export ANDROID_HOME=$HOME/Coding/xDKs/android-sdk-macosx' >> ~/.bash_profile && -echo 'export PATH=$ANDROID_HOME/tools:$PATH' >> ~/.bash_profile && -echo 'export PATH=$ANDROID_HOME/platform-tools:$PATH' >> ~/.bash_profile && -echo "==> - EFU: Successfully added Android path environment variables." - -echo "==> - EFU: Installing Gradle..." -curl -O https://downloads.gradle.org/distributions/gradle-2.2.1-bin.zip && -unzip gradle-2.2.1-bin.zip && -mv gradle-2.2.1 ~/Coding/xDKs && -mv gradle-2.2.1-bin.zip ~/Coding/xDKs && - -echo "==> - EFU: Configuring Gradle global properties into file= ~/.gradle/gradle.properties..." -echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties -echo "org.gradle.parallel=true" >> ~/.gradle/gradle.properties - -echo "==> - EFU: Updating Gradle PATH variables..." && -echo 'export GRADLE_HOME=$HOME/Coding/xDKs/gradle-2.2.1' >> ~/.bash_profile && -echo 'export PATH=$GRADLE_HOME/bin:$PATH' >> ~/.bash_profile -echo "==> - EFU: Successfully added Gradle to path environment variable." - -echo "==> - EFU: Setting up JAVA_HOME environment variable..." -echo 'export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home' >> ~/.bash_profile -echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bash_profile - -echo "==> - EFU: Installing Ant..." && -curl -O http://mirrors.dcarsat.com.ar/apache//ant/binaries/apache-ant-1.9.4-bin.zip && -unzip apache-ant-1.9.4-bin.zip && -mv apache-ant-1.9.4 ~/Coding/xDKs && -mv apache-ant-1.9.4-bin.zip ~/Coding/xDKs && -echo 'export ANT_HOME=$HOME/Coding/xDKs/apache-ant-1.9.4' >> ~/.bash_profile && -echo 'export PATH=$ANT_HOME/bin:$PATH' >> ~/.bash_profile && -echo "==> - EFU: Successfully added Ant to path environment variable." diff --git a/OS X/properties.sh b/OS X/properties.sh deleted file mode 100644 index 039ed3b..0000000 --- a/OS X/properties.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# Created by Nahuel Barrios on 15/04/15. Contact me at: Barrios.Nahuel@gmail.com - -GOOGLE_CHROME=https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg -ANDROID_STUDIO=https://dl.google.com/dl/android/studio/install/1.0.0/android-studio-ide-135.1629389.dmg -ANDROID_FILE_TRANSFER=https://dl.google.com/dl/androidjumper/mtp/current/androidfiletransfer.dmg -GOOGLE_DRIVE=https://dl.google.com/drive/installgoogledrive.dmg -MEGA=https://mega.co.nz/MEGAsyncSetup.dmg -NODE_JS=http://nodejs.org/dist/v0.12.2/node-v0.12.2.pkg -HEROKU=https://s3.amazonaws.com/assets.heroku.com/heroku-toolbelt/heroku-toolbelt.pkg -TRANSMISSION=https://transmission.cachefly.net/Transmission-2.84.dmg -IDEA_ULTIMATE=http://download-cf.jetbrains.com/idea/ideaIU-14.1.2.dmg -IDEA_COMMUNITY=http://download-cf.jetbrains.com/idea/ideaIC-14.1.2.dmg -GRADLE=https://downloads.gradle.org/distributions/gradle-2.5-all.zip -APACHE_ANT=http://mirrors.dcarsat.com.ar/apache//ant/binaries/apache-ant-1.9.4-bin.zip -APACHE_MAVEN=http://mirrors.nxnethosting.com/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.zip -APACHE_TOMCAT=http://mirrors.nxnethosting.com/apache/tomcat/tomcat-8/v8.0.22/bin/apache-tomcat-8.0.22.zip - diff --git a/README.md b/README.md index dfe9eb4..48921dc 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,36 @@ EFU (Easy-Fast-Upgradable): The SH script you need to finish your Ubuntu/MacOS X [![GitHub version](https://badge.fury.io/gh/barriosnahuel%2Fefu.svg)](http://github.com/barriosnahuel/efu/releases) [![Semver](http://img.shields.io/SemVer/2.0.0.png)](http://semver.org/spec/v2.0.0.html) [![stable](https://img.shields.io/badge/stability-stable-green.svg)](https://nodejs.org/api/documentation.html#documentation_stability_index) - +[![Build Status](https://travis-ci.org/barriosnahuel/efu.svg?branch=master)](https://travis-ci.org/barriosnahuel/efu) ## Issues: [![Stories ready to be worked on](https://badge.waffle.io/barriosnahuel/efu.png?label=ready&title=Ready)](https://waffle.io/barriosnahuel/efu) [![Stories in progress](https://badge.waffle.io/barriosnahuel/efu.png?label=in progress&title=In Progress)](https://waffle.io/barriosnahuel/efu) +## Use it +1. Download [latest release](https://github.com/barriosnahuel/efu/releases). +2. `cd` into downloaded directory. +3. Edit `properties.sh` with your custom info. +4. `sh install.sh [osx | ubuntu | lubuntu]` +5. In a new tab of your terminal: `tail –f ~/Downloads/efu.log` +6. Once finished, take a look to: `~/Downloads/summary.efu.log` + +### Ubuntu PRO tip! +If you want to run EFU on **Ubuntu**, you can just: +1. Download [latest release](https://github.com/barriosnahuel/efu/releases) on your `~/Downloads` directory. +2. `gnome-terminal --working-directory ~/Downloads/ \ +--tab -e "sh install.sh ubuntu" \ +--tab -e "tail -f efu.log" \ +--tab -e "tail -f summary.efu.log" \ +; exit` + +And this will open a new terminal with 3 tabs: +- One for the main script: `install.sh` ⇐ *You should check this tab because it will ask you for some things.* +- One for `efu.log` output. ⇐ *Full script output.* +- One for `summary.efu.log` output. ⇐ *Most cases this will be enough.* + ## Repo usage *Do not clone or push to* **master** *branch.* Create branch or fork from **develop**, then push or create pull requests (if you don't have access) to that branch. -The repo uses [this branching model](http://nvie.com/posts/a-successful-git-branching-model/). +The repo uses [this branching model](http://nvie.com/posts/a-successful-git-branching-model/). \ No newline at end of file diff --git a/Ubuntu/core.sh b/Ubuntu/core.sh new file mode 100644 index 0000000..bf45a8e --- /dev/null +++ b/Ubuntu/core.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Created by Nahuel Barrios on 27/3/16. + + +preInstallationLog "Gnome System Tools" +sudo apt-get -fy install gnome-system-tools +postInstallationLog "Gnome System Tools" +logInfo "Available programs: network-admin, shares-admin, time-admin, users-admin" + + +log "Installing packages to compress and extract different kind of files..." +sudo apt-get -fy install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract + + +preInstallationLog "GParted with NTFS support" +sudo apt-get -fy install gparted ntfs-3g + + +logInfo "Adding repositories for Rhythmbox and its plugins..." +sudo add-apt-repository ppa:fossfreedom/rhythmbox -y +sudo add-apt-repository ppa:fossfreedom/rhythmbox-plugins -y +sudo apt-get update +log "Instaling latest Rhythmbox and its plugins..." +sudo apt-get -fy install rhythmbox rhythmbox-plugin-rhythmweb rhythmbox-plugin-equalizer rhythmbox-plugin-opencontainingfolder rhythmbox-plugin-llyrics + + +preInstallationLog "Subdownloader, GMountISO, Freemind (a mind maps editor), Sound Converter, Steam client (will update on first run) and PlayOnLinux" +sudo apt-get -fy install subdownloader gmountiso freemind soundconverter steam playonlinux + + +if isUbuntu "$PLATFORM"; then + . ./installAll-15.04.sh +fi + + +cd ~/Downloads/ + + +log "Cleaning up..." && +sudo apt-get -f install && +sudo apt-get autoremove && +sudo apt-get -y autoclean && +sudo apt-get -y clean + +log "Updating installed packages..." +sudo apt-get upgrade \ No newline at end of file diff --git a/Ubuntu/installAll-15-04.sh b/Ubuntu/installAll-15-04.sh deleted file mode 100644 index 7167018..0000000 --- a/Ubuntu/installAll-15-04.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/env bash - -# Script created by Nahuel Barrios: Barrios.Nahuel@gmail.com -# Just comment the undesired command lines to skip the installation of specific software. - -echo "==> - EFU: To see the installation log run the following line on the command line: tail –f efu.log" - -# FROM HERE -. ./../createDirectoriesTree.sh -. ./../functions.sh - -echo "==> - EFU: Loading properties..." -. ./properties.sh -# TO HERE, IS THE SAME FOR ALL OTHER PLATFORMS - - -log "==> - EFU: ############################## Adding particular software repositories ##############################" - -log "==> - EFU: Adding repositories for Sublime Text 3..." -sudo add-apt-repository ppa:webupd8team/sublime-text-3 -y - -log "==> - EFU: Adding repositories for Ubuntu Make..." -sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make -y - -log "==> - EFU: Adding repositories for Drive..." -sudo add-apt-repository ppa:twodopeshaggy/drive -y - -log "==> - EFU: Adding repositories for JDownloader..." -sudo add-apt-repository ppa:jd-team/jdownloader -y - -log "==> - EFU: Adding repositories for Mixxx DJ software..." -sudo add-apt-repository ppa:mixxx/mixxx -y - -log "==> - EFU: Adding repositories for Rhythmbox and its plugins..." -sudo add-apt-repository ppa:fossfreedom/rhythmbox -y -sudo add-apt-repository ppa:fossfreedom/rhythmbox-plugins -y - -echo "==> - EFU: Updating software sources. Required after adding ppa repositories." -sudo apt-get update - -echo "==> - EFU: Fixing current packages..." -sudo apt-get -f install - -echo "==> - EFU: Removing packages that are not neccessary to prevent conflicts..." -sudo apt-get autoremove - -log "==> - EFU: Installing gdebi package manager..." -sudo apt-get -fy install gdebi - -log "==> - EFU: ############################## Installing favorite software ##############################" - -downloadAndInstall "GetDeb" http://archive.getdeb.net/install_deb/getdeb-repository_0.1-1~getdeb1_all.deb -downloadAndInstall "PlayDeb" http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb - -log "==> - EFU: Instaling latest Rhythmbox and its plugins..." -sudo apt-get -fy install rhythmbox rhythmbox-plugin-rhythmweb rhythmbox-plugin-equalizer rhythmbox-plugin-opencontainingfolder rhythmbox-plugin-llyrics - -log "==> - EFU: Instaling Drive, Sublime Text 3, GIT, MongoDB and WebP command line tools..." -sudo apt-get -fy install drive sublime-text-installer git-core mongodb curl webp golang-go - -log "==> - EFU: Installing packages to compress and extract different kind of files..." -sudo apt-get -fy install unace unrar zip unzip p7zip-full p7zip-rar sharutils rar uudeview mpack arj cabextract - -log "==> - EFU: Installing Mixxx DJ software..." -sudo apt-get -fy install mixxx libportaudio2 - -downloadAndInstall "Mega Sync client" $MEGA -downloadAndInstall "Mega Nautilus extension" $MEGA_NAUTILUS - -log "==> - EFU: Installing Dropbox and XClip (to copy into clipboard from terminal),..." -sudo apt-get -fy install nautilus-dropbox xclip - - -echo "==> - EFU: Generating an SSH Key..." && -# Creates a new ssh key, using the provided email as a label -ssh-keygen -t rsa -C "barrios.nahuel@gmail.com" && -# start the ssh-agent in the background -eval "$(ssh-agent-s)" && -ssh-add ~/.ssh/id_rsa && -log "==> - EFU: SSH Key for barrios.nahuel@gmail.com successfully generated in ~/.ssh/id_rsa.pub" - -xclip -sel clip < ~/.ssh/id_rsa.pub && -log "==> - EFU: SSH Key copied to clipboard." - - -log "==> - EFU: ################ Installing development kits ################" - -echo "==> - EFU: Installing and configuring the Android development environment..." && -sudo apt-get -fy install ubuntu-make && -umake android && - -cd ~/Coding/xDKs/ && - -echo "==> - EFU: Configuring Android SDK environment variables..." && -echo 'export ANDROID_HOME=$HOME/Coding/xDKs/android-sdk' >> ~/.bashrc && -echo 'export PATH=$ANDROID_HOME/tools:$PATH' >> ~/.bashrc && -echo 'export PATH=$ANDROID_HOME/platform-tools:$PATH' >> ~/.bashrc && -. ~/.bashrc && -log "==> - EFU: Android SDK installed and configured successfully" - -echo "==> - EFU: Installing Gradle..." && -downloadAndUncompress "Gradle" $GRADLE -echo 'export GRADLE_HOME=$HOME/Coding/xDKs/gradle-2.6' >> ~/.bashrc && -echo 'export PATH=$GRADLE_HOME/bin:$PATH' >> ~/.bashrc && -. ~/.bashrc && -echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties && -echo "org.gradle.parallel=true" >> ~/.gradle/gradle.properties && -log "==> - EFU: Gradle installed and configured successfully." - -echo "==> - EFU: Installing Apache Ant..." && -downloadAndUncompress "Apache Ant" $APACHE_ANT && -echo 'export ANT_HOME=$HOME/Coding/xDKs/apache-ant-1.9.6' >> ~/.bashrc && -echo 'export PATH=$ANT_HOME/bin:$PATH' >> ~/.bashrc && -. ~/.bashrc && -log "==> - EFU: Apache Ant configured successfully." - -echo "==> - EFU: Installing Apache Maven..." && -downloadAndUncompress "Apache Maven" $APACHE_MAVEN && -echo 'export M2_HOME=$HOME/Coding/xDKs/apache-maven-3.3.3' >> ~/.bashrc && -echo 'export PATH=$M2_HOME/bin:$PATH' >> ~/.bashrc && -. ~/.bashrc && -log "==> - EFU: Apache Maven configured successfully." - -echo "==> - EFU: Installing NodeJS..." && -downloadAndUncompress "NodeJS" $NODE_JS -echo 'export PATH=$HOME/Coding/xDKs/node-v4.1.1-linux-x64/bin:$PATH' >> ~/.bashrc && - -. ~/.bashrc && -log "==> - EFU: NodeJS installed and configured successfully." - -echo "==> - EFU: Installing NPM package manager (latest version)..." && -curl https://www.npmjs.com/install.sh | sh && -log "==> - EFU: NPM successfully installed." - -echo "==> - EFU: Installing via the NPM package manager: Apache Cordova and Plugman (a command line tool to install and uninstall plugins for use with Apache Cordova projects), Mocha (for testing) and Bower..." && -npm install -g cordova plugman mocha bower express-generator grunt-cli && - -echo "==> - EFU: Installing Heroku toolbelt to run Heroku commands from command line..." && -wget -qO- $HEROKU | sh && -echo "==> - EFU: Please login against Heroku with your account." && -heroku login && -echo "==> - EFU: Adding existent public keys to Heroku to be able to run commands..." && -heroku keys:add && -log "==> - EFU: Heroku configured successfully." - -downloadAndUncompress "Google App Engine SDK" https://storage.googleapis.com/appengine-sdks/featured/appengine-java-sdk-1.9.27.zip -echo 'export PATH=$PATH:$HOME/Coding/xDKs/appengine-java-sdk-1.9.27/' >> ~/.bashrc -. ~/.bashrc - - -log "==> - EFU: ################ Finished installing development kits ################" - -echo "==> - EFU: Installing Intellij IDEA Ultimate Edition..." && -cd ~/Coding/IDEs/ -downloadAndUncompress "Intellij IDEA Ultimate Edition" $IDEA_ULTIMATE && -echo "==> - EFU: Setting up JAVA_HOME environment variable pointing to a JDK 8 to use as default java command." && -echo 'export JAVA_HOME=$HOME/Coding/xDKs/jdk1.8.0_45' >> ~/.bashrc -echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc && -. ~/.bashrc - -cd ~/Coding/servers/ -downloadAndUncompress "Apache Tomcat" $APACHE_TOMCAT -TOMCAT_DIRECTORY=$(getFileNameWithoutExtension $(getFileName $APACHE_TOMCAT)) -cd ~/Coding/servers/$TOMCAT_DIRECTORY/bin && -chmod +x catalina.sh && -log "==> - EFU: Apache Tomcat configured successfully. Now you can run: sh startup.sh and sh shutdown.sh" - - -echo "==> - EFU: Installing Gimp with some plugins..." -sudo apt-get -fy install gimp gimp-data gimp-plugin-registry gimp-data-extras - -echo "==> - EFU: Installing JDownloader, Subdownloader, GMountISO, Freemind (a mind maps editor), Gnac (to convert audio files), and a Steam client (will update on first run)..." -sudo apt-get -fy install jdownloader subdownloader gmountiso freemind gnac steam - -cd ~/Downloads/ -downloadAndInstall "TeamViewer" http://www.teamviewer.com/download/teamviewer_linux.deb -downloadAndInstall "RoboMongo" http://robomongo.org/files/linux/robomongo-0.8.5-x86_64.deb - -echo "==> - EFU: Cleaning up..." && -sudo apt-get -f install && -sudo apt-get autoremove && -sudo apt-get -y autoclean && -sudo apt-get -y clean - -log "==> - EFU: Updating installed packages..." -sudo apt-get upgrade - -log "==> - EFU: ############################## Finished installation of favorite software ##############################" -log "==> - EFU: Thanks for using me! --- Don't forget to fork me on Github: http://github.com/barriosnahuel/efu ###########" -echo "==> - EFU: To see the installation log run the following line on the command line: tail –f efu.log" diff --git a/Ubuntu/installAll-15.04.sh b/Ubuntu/installAll-15.04.sh new file mode 100644 index 0000000..3e4cb8c --- /dev/null +++ b/Ubuntu/installAll-15.04.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Created by Nahuel Barrios. + + +cd ~/Downloads/ +downloadAndInstall "GetDeb" http://archive.getdeb.net/install_deb/getdeb-repository_0.1-1~getdeb1_all.deb +downloadAndInstall "PlayDeb" http://archive.getdeb.net/install_deb/playdeb_0.3-1~getdeb1_all.deb + + +log "Installing Dropbox, MongoDB and WebP command line tools..." +sudo apt-get -fy install nautilus-dropbox mongodb curl webp + + +cd ~/Downloads/ +downloadAndInstall "Mega Sync client" https://mega.nz/linux/MEGAsync/xUbuntu_15.04/amd64/megasync-xUbuntu_15.04_amd64.deb +downloadAndInstall "Mega Nautilus extension" https://mega.nz/linux/MEGAsync/xUbuntu_15.04/amd64/nautilus-megasync-xUbuntu_15.04_amd64.deb +downloadAndInstall "TeamViewer" http://www.teamviewer.com/download/teamviewer_linux.deb +downloadAndInstall "RoboMongo" http://robomongo.org/files/linux/robomongo-0.8.5-x86_64.deb \ No newline at end of file diff --git a/Ubuntu/properties.sh b/Ubuntu/properties.sh deleted file mode 100644 index 9d22f75..0000000 --- a/Ubuntu/properties.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# Created by Nahuel Barrios on 15/04/15. Contact me at: Barrios.Nahuel@gmail.com - -MEGA=https://mega.co.nz/linux/MEGAsync/xUbuntu_15.04/amd64/megasync-xUbuntu_15.04_amd64.deb -MEGA_NAUTILUS=https://mega.co.nz/linux/MEGAsync/xUbuntu_15.04/amd64/nautilus-megasync-xUbuntu_15.04_amd64.deb -NODE_JS=https://nodejs.org/dist/v4.1.1/node-v4.1.1-linux-x64.tar.gz -HEROKU=https://toolbelt.heroku.com/install-ubuntu.sh -IDEA_ULTIMATE=https://d1opms6zj7jotq.cloudfront.net/idea/ideaIU-14.1.5.tar.gz -GRADLE=https://downloads.gradle.org/distributions/gradle-2.6-all.zip -APACHE_ANT=http://apache.xfree.com.ar//ant/binaries/apache-ant-1.9.6-bin.zip -APACHE_MAVEN=http://mirrors.nxnethosting.com/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.zip -APACHE_TOMCAT=http://apache.dattatec.com/tomcat/tomcat-8/v8.0.27/bin/apache-tomcat-8.0.27.zip diff --git a/common.sh b/common.sh new file mode 100644 index 0000000..1e98a79 --- /dev/null +++ b/common.sh @@ -0,0 +1,60 @@ +#!/bin/bash +#### +# Created by Nahuel Barrios on 17/3/16. +#### + +if isOsx "$PLATFORM"; then + . modules/homebrew.sh +else + log "Installing gdebi package manager..." + sudo apt-get -fy install gdebi + + log "Updating software sources. Required after adding ppa repositories." + sudo apt-get update + + log "Fixing current packages..." + sudo apt-get -f install + + log "Removing packages that are not necessary to prevent conflicts..." + sudo apt-get autoremove + + log "#### Software repositories and packages updated ok ####" +fi + +if isLubuntu "$PLATFORM"; then + return 0 +fi + +# Remember that oh-my-zsh.sh requires Homebrew.sh. +. modules/oh-my-zsh.sh + +. modules/git.sh +. modules/ssh.sh + +# Remember that nodejs.sh requires Homebrew.sh. +. modules/nodejs.sh + +. modules/android.sh +. modules/sublime-text.sh + +# Remember that go.sh requires Homebrew.sh. +. modules/go.sh + +# Remember that nodejs.sh requires go.sh. +. modules/google-drive.sh + +. modules/java.sh +. modules/gimp.sh +. modules/google-app-engine.sh + +# Remember that heroku.sh requires Homebrew.sh. +. modules/heroku.sh + +. modules/tomcat.sh +. modules/mixxx.sh + +# sdkman at the end because SDKMAN_DIR environment variable must be at the end to work. +. modules/sdkman/sdkman.sh + +# Remember that maven.sh requires sdkman.sh. +. modules/maven.sh \ No newline at end of file diff --git a/createDirectoriesTree.sh b/createDirectoriesTree.sh index 2ad63b3..809ffcf 100644 --- a/createDirectoriesTree.sh +++ b/createDirectoriesTree.sh @@ -1,26 +1,17 @@ #!/usr/bin/env bash # Created by Nahuel Barrios on 15/04/15. Contact me at: Barrios.Nahuel@gmail.com -. ./functions.sh - -log "==> - EFU: ############################## Creating directories tree ##############################" +log "#### Creating directories tree ####" cd ~/ && mkdir .gradle -mkdir Coding && -cd Coding && -mkdir IDEs && -mkdir xDKs && -mkdir servers && -mkdir workspace-mine && -mkdir workspace-test && -mkdir workspace-tools && -mkdir workspace-work && -cd .. && -mkdir Software && -mkdir Songs\ Lyrics -mkdir VMs && - -log "==> - EFU: Directories tree successfully created." +mkdir Coding +cd Coding +mkdir IDEs +mkdir xDKs +mkdir servers +mkdir workspace-mine +mkdir workspace-test +mkdir workspace-work -cd ~/Downloads/ +cd ~/Downloads/ \ No newline at end of file diff --git a/functions.sh b/functions.sh index 8a00af1..201a39b 100644 --- a/functions.sh +++ b/functions.sh @@ -1,72 +1,134 @@ #!/bin/sh - -# Created by Nahuel Barrios on 15/04/15. Contact me at: Barrios.Nahuel@gmail.com +# Created by Nahuel Barrios on 15/04/15. log() { - echo $1 && - echo $1 >> ~/Downloads/efu.log + echo "EFU ==> $1 $2 $3" && + echo "EFU ==> $1 $2 $3" >> ~/Downloads/efu.log +} + +logError() { + echo "EFU ==> ERROR: $1 $2 $3" && + echo "EFU ==> ERROR: $1 $2 $3" >> ~/Downloads/efu.log +} + +logInfo (){ + log "$1 $2 $3" + echo "EFU ==> $1 $2 $3" >> ~/Downloads/summary.efu.log +} + +logAlreadyInstalled (){ + log "'$1' already installed. Skipping installation..." +} + +logProgramVersion (){ + log "$1 $2 $3" + echo "EFU ==> Installed $1 $2 $3" >> ~/Downloads/summary.efu.log +} + +preInstallationLog(){ + log "Installing $1..." +} + +postInstallationLog(){ + log "$1 installed ok" +} + +isUbuntu(){ + if [ "$1" = "ubuntu" ]; then + return 0 + else + return 1 + fi +} + +isLubuntu(){ + if [ "$1" = "lubuntu" ]; then + return 0 + else + return 1 + fi +} + +isOsx(){ + if [ "$1" = "osx" ]; then + return 0 + else + return 1 + fi } getFileName() { - echo ${1##*/} + echo "${1##*/}" } getFileExtension() { - echo ${1##*.} + echo "${1##*.}" } getFileNameWithoutExtension() { - echo ${1%.*} + echo "${1%.*}" } ## Parameters: # 1. URL download() { - curl -O $1 + curl -O "$1" } ## Parameters: # 1. URL downloadInBackground() { - curl -O $1 & + curl -O "$1" & } ## Parameters: # 1. Program name # 2. URL install() { - echo "==> - EFU: Installing" $1 "..." - FILE=$(getFileName $2) + preInstallationLog "$1" + FILE=$(getFileName "$2") - sudo gdebi $FILE && - echo $1 "installed successfully." && + sudo gdebi "$FILE" && + postInstallationLog "$1" && - rm -f $FILE + rm -f "$FILE" } ## Parameters: # 1. Program name # 2. URL downloadAndInstall() { - download $2 && - install $1 $2 + download "$2" && + install "$1" "$2" } ## Parameters: # 1. Program name # 2. URL downloadAndUncompress() { - download $2 && + download "$2" && # Get file name from path or URL. - FILE_NAME=$(getFileName $2) && + FILE_NAME=$(getFileName "$2") && # Use the file extension to use unzip or tar to uncompress the file. - if [ $(getFileExtension $FILE_NAME) = "zip" ]; then - unzip $FILE_NAME + if [ "$(getFileExtension "$FILE_NAME")" = "zip" ]; then + unzip "$FILE_NAME" else - tar -zxf $FILE_NAME + tar -zxf "$FILE_NAME" fi - echo $1 "uncompressed successfully." + echo "$1 uncompressed successfully." } + +addToShell() { + if [ -f ~/.bashrc ]; then + echo "$1" >> ~/.bashrc && + . ~/.bashrc + fi + + if [ -f ~/.zshrc ]; then + echo "$1" >> ~/.zshrc && + . ~/.zshrc + fi +} \ No newline at end of file diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..e16c2ae --- /dev/null +++ b/install.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Created by Nahuel Barrios on 17/3/16. + +. ./functions.sh +log "To see the installation log run the following in a new tab of your command line: tail –f ~/Downloads/efu.log" +log "Functions loaded OK" + + +log "Checking platform..." +PLATFORM=$1 + + +if ! isUbuntu "$1" && ! isOsx "$1" && ! isLubuntu "$1"; then + logError "Must specify a platform: [osx | ubuntu | lubuntu]" + exit 1 +fi + + +if isOsx "$PLATFORM"; then + log "Detected platform " +elif isUbuntu "$PLATFORM"; then + log "Detected platform " +else + log "Detected platform " +fi + + +log "Creating coding directories tree" +. ./createDirectoriesTree.sh +log "Coding directories tree created ok" + + +log "Loading properties file..." +. ./properties.sh +log "Properties file loaded ok" + + +log "Loading common software installation" +. ./common.sh +log "Common software installed ok" + + +log "Loading $PLATFORM custom installation file..." +if [ "$isOsx" ]; then + . ./OS\ X/installAll-10.11.sh +else + . ./Ubuntu/core.sh +fi + + +logInfo "Download latest JetBrains Intellij IDEA EAP from: https://confluence.jetbrains.com/display/IDEADEV/EAP" +logInfo "Download latest Android Studio from: http://tools.android.com/download/studio/canary/latest" +logInfo "Download JDownloader2 from: http://jdownloader.org/download/index" + + +logInfo "#### Installation of your favorite software has finished ####" +logInfo "Thanks for using me! -- Don't forget to fork me on Github: http://github.com/barriosnahuel/efu" +logInfo "To see the installation log run the following on the command line: 'tail –f ~/Downloads/efu.log'" +log "[Important] You should also take a look to: '~/Downloads/summary.efu.log'" \ No newline at end of file diff --git a/modules/android.sh b/modules/android.sh new file mode 100644 index 0000000..907dba2 --- /dev/null +++ b/modules/android.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Created by Nahuel Barrios on 17/3/16. + +log "Configuring Android development environment..." && + +if [ "$(isUbuntu "$PLATFORM")" ]; then + + logInfo "Adding repositories for Ubuntu Make..." + sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make -y + sudo apt-get update + + sudo apt-get -fy install ubuntu-make && + umake android && + log "Android SDK installed successfully" + + # This is to stop getting warning messages about iBus daemon. Taken from https://youtrack.jetbrains.com/issue/IDEA-78860 + addToShell "# This is to stop getting warning messages about iBus daemon. Taken from https://youtrack.jetbrains.com/issue/IDEA-78860" + addToShell "export IBUS_ENABLE_SYNC_MODE=1" +else + logInfo "Download Android File Transfer from: https://www.android.com/filetransfer" +fi + +log "Configuring Android SDK environment variables..." + +# shellcheck disable=SC2016 +addToShell 'export ANDROID_HOME=$HOME/Coding/xDKs/android-sdk' + +# shellcheck disable=SC2016 +addToShell 'export PATH=$ANDROID_HOME/tools:$PATH' + +# shellcheck disable=SC2016 +addToShell 'export PATH=$ANDROID_HOME/platform-tools:$PATH' + +# This is to be able to use the hierarchy viewer +addToShell "export ANDROID_HVPROTO=ddm" + +log "Successfully added Android environment variables." \ No newline at end of file diff --git a/modules/gimp.sh b/modules/gimp.sh new file mode 100644 index 0000000..34bb9fb --- /dev/null +++ b/modules/gimp.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + + +if [ "$(isUbuntu "$PLATFORM")" ]; then + + preInstallationLog "Gimp (with some plugins)" + sudo apt-get -fy install gimp gimp-data gimp-plugin-registry gimp-data-extras + postInstallationLog "Gimp (with some plugins)" + +else + logInfo "Download Gimp from: https://www.gimp.org/downloads/" +fi \ No newline at end of file diff --git a/modules/git.sh b/modules/git.sh new file mode 100644 index 0000000..677a472 --- /dev/null +++ b/modules/git.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Created by Nahuel Barrios on 17/3/16. + + +if ! command -v git >/dev/null; then + + if [ "$(isUbuntu "$PLATFORM")" ]; then + preInstallationLog "GIT" + sudo apt-get -fy install git + postInstallationLog "GIT" + else + preInstallationLog "Mac OS X Command line tools" + xcode-select --install + postInstallationLog "Mac OS X Command line tools" + fi + + git config --global user.name "$USER_FULL_NAME" && + git config --global user.email "$USER_EMAIL" && + git config --global push.default simple && + log "GIT configured successfully." +else + logAlreadyInstalled "git" +fi + +logProgramVersion "GIT" "$(git version)" \ No newline at end of file diff --git a/modules/go.sh b/modules/go.sh new file mode 100644 index 0000000..ea6d1d8 --- /dev/null +++ b/modules/go.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + + +if ! command -v go >/dev/null; then + + preInstallationLog "Go language" + + if [ "$(isUbuntu "$PLATFORM")" ]; then + + logInfo "Adding repositories for Go language" + + sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable + sudo apt-get update + sudo apt-get -fy install golang + else + brew install go + fi + + # shellcheck disable=SC2016 + addToShell 'export GOPATH=$HOME/Coding/xDKs/gopath' + + # shellcheck disable=SC2016 + addToShell 'export PATH=/usr/local/go/bin:$GOPATH/bin:$PATH' + + postInstallationLog "Go language" +else + logAlreadyInstalled "Go Language" +fi + +logProgramVersion "Go" "$(go version)" \ No newline at end of file diff --git a/modules/google-app-engine.sh b/modules/google-app-engine.sh new file mode 100644 index 0000000..2ccd825 --- /dev/null +++ b/modules/google-app-engine.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + +preInstallationLog "Google App Engine SDK" + +cd ~/Coding/xDKs/ +downloadAndUncompress "Google App Engine SDK" https://storage.googleapis.com/appengine-sdks/featured/appengine-java-sdk-1.9.34.zip +cd ~/Downloads/ + +# shellcheck disable=SC2016 +addToShell 'export PATH=$PATH:$HOME/Coding/xDKs/appengine-java-sdk-1.9.34/' + +postInstallationLog "Google App Engine SDK" +logInfo "Remember that Google App Engine requires Java7 to compile. If you're using Java8 then be sure to set the javac compiler flags to generate 1.7 bytecode: '-source 1.7 -target 1.7'" \ No newline at end of file diff --git a/modules/google-drive.sh b/modules/google-drive.sh new file mode 100644 index 0000000..af224c9 --- /dev/null +++ b/modules/google-drive.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + + +if ! command -v drive >/dev/null; then + + preInstallationLog "Google Drive client" + + if [ "$(isUbuntu "$PLATFORM")" ]; then + logInfo "Adding repositories for Google Drive client..." + + sudo add-apt-repository ppa:twodopeshaggy/drive + sudo apt-get update + sudo apt-get -fy install drive + else + go get -u github.com/odeke-em/drive/cmd/drive + fi + + postInstallationLog "Google Drive client" +else + logAlreadyInstalled "Google Drive Client" +fi + +logInfo "See https://github.com/odeke-em/drive#usage to mount your Google Drive directory on your local filesystem" +logProgramVersion "Google Drive client" "$(drive version)" \ No newline at end of file diff --git a/modules/heroku.sh b/modules/heroku.sh new file mode 100644 index 0000000..5b55b48 --- /dev/null +++ b/modules/heroku.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + +if ! command -v heroku >/dev/null; then + preInstallationLog "Heroku toolbelt" + + if [ "$(isUbuntu "$PLATFORM")" ]; then + wget -qO- "https://toolbelt.heroku.com/install-ubuntu.sh" | sh + else + brew install heroku-toolbelt + fi + postInstallationLog "Heroku toolbelt" + + log "Please login to Heroku with your account." + heroku login && + log "Adding existent public keys to Heroku to be able to run commands..." && + heroku keys:add + + logInfo "Heroku account configured successfully." +else + logAlreadyInstalled "Heroku toolbelt" +fi + +logProgramVersion "Heroku toolbelt" "$(heroku version)" + diff --git a/modules/homebrew.sh b/modules/homebrew.sh new file mode 100644 index 0000000..893f9e7 --- /dev/null +++ b/modules/homebrew.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Created by Nahuel Barrios on 18/3/16. + +preInstallationLog "Homebrew" +if ! command -v brew >/dev/null; then + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + + # shellcheck disable=SC2016 + addToShell 'export PATH="/usr/local/bin:$PATH"' +else + logAlreadyInstalled "Homebrew" +fi + +log "Updating Homebrew formulas..." +brew update + +log "Verifying the Homebrew installation..." +if brew doctor; then + postInstallationLog "Homebrew" +else + log "Your Homebrew installation reported some errors or warnings." + logError "Review the Homebrew messages to see if any action is needed." +fi + +logProgramVersion "Homebrew" "$(brew --version)" \ No newline at end of file diff --git a/modules/java.sh b/modules/java.sh new file mode 100644 index 0000000..11e27ce --- /dev/null +++ b/modules/java.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + + +if ! command -v java >/dev/null; then + logInfo "Download latest Java7 from: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html" + logInfo "Download latest Java8 from: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html" + logInfo "Remember to update JAVA_HOME environment variable after installing Java" + + log "Setting up Java environment variables..." + addToShell "#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_79.jdk/Contents/Home" + addToShell "#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home" + + # shellcheck disable=SC2016 + addToShell '#export PATH=$JAVA_HOME/bin:$PATH' +else + logAlreadyInstalled "Java" +fi + +logProgramVersion "Java" "$(java version)" \ No newline at end of file diff --git a/modules/maven.sh b/modules/maven.sh new file mode 100644 index 0000000..35cd5e9 --- /dev/null +++ b/modules/maven.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + +if ! command -v mvn >/dev/null; then + preInstallationLog "Apache Maven" + + if [ "$(isUbuntu "$PLATFORM")" ]; then + + cd ~/Coding/xDKs/ + downloadAndUncompress "Apache Maven" "http://mirrors.nxnethosting.com/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip" && + cd ~/Downloads/ + + # shellcheck disable=SC2016 + addToShell 'export M2_HOME=$HOME/Coding/xDKs/apache-maven-3.3.9' + + # shellcheck disable=SC2016 + addToShell 'export PATH=$M2_HOME/bin:$PATH' + + else + sdk install maven + fi + + postInstallationLog "Apache Maven" + +else + logAlreadyInstalled "Apache Maven" +fi + +logProgramVersion "Apache Maven" "$(mvn -v)" \ No newline at end of file diff --git a/modules/mixxx.sh b/modules/mixxx.sh new file mode 100644 index 0000000..dc80662 --- /dev/null +++ b/modules/mixxx.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + + +if [ "$(isUbuntu "$PLATFORM")" ]; then + + preInstallationLog "Mixxx DJ Software" + + logInfo "Adding repositories for Mixxx DJ software..." + sudo add-apt-repository ppa:mixxx/mixxx -y + sudo apt-get update + sudo apt-get -fy install mixxx libportaudio2 + + postInstallationLog "Mixxx DJ Software" +else + logInfo "Download Mixxx from: http://www.mixxx.org/download/" +fi \ No newline at end of file diff --git a/modules/nodejs.sh b/modules/nodejs.sh new file mode 100644 index 0000000..71fb199 --- /dev/null +++ b/modules/nodejs.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + + +if ! command -v node >/dev/null; then + preInstallationLog "NodeJS (with NPM)" + + if [ "$(isUbuntu "$PLATFORM")" ]; then + + cd ~/Coding/xDKs/ + downloadAndUncompress "NodeJS" "$NODE_JS" + cd ~/Downloads/ + + # shellcheck disable=SC2016 + addToShell 'export PATH=$HOME/Coding/xDKs/node-v4.4.1-linux-x64/bin:$PATH' + + log "NodeJS and NPM installed and configured successfully." + else + brew install node + + if ! command -v npm >/dev/null; then + preInstallationLog "NPM" + curl -L https://www.npmjs.com/install.sh | sh + postInstallationLog "NPM" + else + log "NPM installed ok through NodeJS" + fi + fi + + # shellcheck disable=SC2016 + addToShell 'export PATH="$HOME/.node/bin:$PATH"' + + log "Added ~/.node/bin to your PATH so commands you install globally are usable." +else + logAlreadyInstalled "NodeJS (with NPM)" +fi + + +logProgramVersion "Node" "$(node -v)" +logProgramVersion "NPM" "$(npm -v)" + +log "Installing (globally) via the NPM package manager: 'mocha', 'bower' and 'express-generator' modules" +npm install -g mocha bower express-generator + +logProgramVersion "Mocha" "$(mocha --version)" +logProgramVersion "Bower" "$(bower --version)" \ No newline at end of file diff --git a/modules/oh-my-zsh.sh b/modules/oh-my-zsh.sh new file mode 100644 index 0000000..d8c9163 --- /dev/null +++ b/modules/oh-my-zsh.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + +preInstallationLog "ZSH" +if [ "$(isUbuntu "$PLATFORM")" ]; then + sudo apt-get -fy install zsh +else + brew install zsh +fi + +chsh -s "$(which zsh)" && +postInstallationLog "ZSH" + +# shellcheck disable=SC2016 +log 'Default shell changed to "zsh", to revert change just run: "chsh -s $(which bash)"' + + +preInstallationLog "Oh-My-ZSH" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +postInstallationLog "Oh-My-ZSH" + + +sed -i -e 's/plugins=(git)/plugins=(git git-extras command-not-found common-aliases dirhistory)/' ~/.zshrc && +logInfo "Added some plugins to Oh-My-ZSH: git, git-extras, command-not-found, common-aliases, dirhistory." + +sed -i -e 's/ZSH_THEME="robbyrussell"/ZSH_THEME="avit"' ~/.zshrc && +logInfo 'ZSH Theme changed to "avit", to view more themes go to: https://github.com/robbyrussell/oh-my-zsh/wiki/themes' \ No newline at end of file diff --git a/modules/sdkman/gradle.properties b/modules/sdkman/gradle.properties new file mode 100644 index 0000000..e78af4c --- /dev/null +++ b/modules/sdkman/gradle.properties @@ -0,0 +1,15 @@ +# The Gradle daemon aims to improve the startup and execution time of Gradle. +# When set to true the Gradle daemon is to run the build. +org.gradle.daemon=true +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +org.gradle.parallel=true +# Enables new incubating mode that makes Gradle selective when configuring projects. +# Only relevant projects are configured which results in faster builds for large multi-projects. +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand +org.gradle.configureondemand=true \ No newline at end of file diff --git a/modules/sdkman/sdkman.sh b/modules/sdkman/sdkman.sh new file mode 100644 index 0000000..bb2d9b8 --- /dev/null +++ b/modules/sdkman/sdkman.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Created by Nahuel Barrios on 17/3/16. + + +if ! command -v sdk >/dev/null; then + preInstallationLog "sdkman" + export SDKMAN_DIR="$HOME/Coding/xDKs/sdkman" && curl -s get.sdkman.io | bash && + source "$HOME/Coding/xDKs/sdkman/bin/sdkman-init.sh" + postInstallationLog "sdkman" +else + logAlreadyInstalled "sdkman" +fi + +logProgramVersion "sdkman" "$(sdk version)" + +log "Installing Gradle through sdkman" +sdk install gradle && + +cp modules/sdkman/gradle.properties ~/.gradle/ && +log "Gradle installed and configured successfully. Check ~/.gradle/gradle.properties to see current configuration" + + +log "Installing Apache Ant through sdkman" +sdk install ant + + +log "Installing Kotlin through sdkman" +sdk install kotlin + + +log "Installing Groovy through sdkman" +sdk install groovy + + +log "Installing Grails through sdkman" +sdk install grails + + +# This is required in order to apply previous installs for current terminal session. +source "$HOME/Coding/xDKs/sdkman/bin/sdkman-init.sh" + +logProgramVersion "Gradle" "$(gradle -v)" +logProgramVersion "Apache Ant" "$(ant -v)" +logProgramVersion "Kotlin" "$(kotlin -version)" +logProgramVersion "Groovy" "$(groovy -v)" +logProgramVersion "Grails" "$(grails -v)" \ No newline at end of file diff --git a/modules/ssh.sh b/modules/ssh.sh new file mode 100644 index 0000000..e01d7b2 --- /dev/null +++ b/modules/ssh.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + +logInfo "Generating a new SSH Key for $USER_EMAIL" && + +# Creates a new ssh key, using the provided email as a label +ssh-keygen -t rsa -C "$USER_EMAIL" && + +# Start the ssh-agent in the background +eval "$(ssh-agent-s)" && + +# Finally add the new key. +ssh-add ~/.ssh/id_rsa && + + +if [ "$(isUbuntu "$PLATFORM")" ]; then + + if ! command -v xclip >/dev/null; then + preInstallationLog "xclip" + sudo apt-get -fy install xclip + postInstallationLog "xclip" + else + logAlreadyInstalled "xclip" + fi + + xclip -sel clip < ~/.ssh/id_rsa.pub + logInfo "SSH Key copied to clipboard. If don't, just run: 'xclip -sel clip < ~/.ssh/id_rsa.pub'" +else + + # shellcheck disable=SC2002 + cat ~/.ssh/id_rsa.pub | pbcopy + logInfo "SSH Key copied to clipboard. If not, just run: 'cat ~/.ssh/id_rsa.pub | pbcopy'" +fi \ No newline at end of file diff --git a/modules/sublime-text.sh b/modules/sublime-text.sh new file mode 100644 index 0000000..1fbe3c8 --- /dev/null +++ b/modules/sublime-text.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + + +if [ "$(isUbuntu "$PLATFORM")" ]; then + logInfo "Adding repositories for Sublime Text 3..." + sudo add-apt-repository ppa:webupd8team/sublime-text-3 -y + sudo apt-get update + + log "Instaling Sublime Text 3" + sudo apt-get -fy install sublime-text-installer +else + logInfo "Download Sublime Text from: https://www.sublimetext.com/3" +fi \ No newline at end of file diff --git a/modules/tomcat.sh b/modules/tomcat.sh new file mode 100644 index 0000000..b3c7285 --- /dev/null +++ b/modules/tomcat.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Created by Nahuel Barrios on 25/3/16. + +preInstallationLog "Apache Tomcat" + +cd ~/Coding/servers/ + +TOMCAT_DOWNLOAD_URL=http://apache.dattatec.com/tomcat/tomcat-8/v8.0.33/bin/apache-tomcat-8.0.33.zip +downloadAndUncompress "Apache Tomcat" "$TOMCAT_DOWNLOAD_URL" + +TOMCAT_DIRECTORY=$(getFileNameWithoutExtension "$(getFileName "$TOMCAT_DOWNLOAD_URL")") + +cd ~/Coding/servers/"$TOMCAT_DIRECTORY"/bin && +chmod +x catalina.sh && + +cd ~/Downloads/ + +postInstallationLog "Apache Tomcat" +logInfo "Apache Tomcat configured successfully. Now you can run: 'sh startup.sh' and 'sh shutdown.sh'" \ No newline at end of file diff --git a/properties.sh b/properties.sh new file mode 100644 index 0000000..0407482 --- /dev/null +++ b/properties.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Created by Nahuel Barrios on 24/3/16. + +USER_FULL_NAME="Nahuel Barrios" +USER_EMAIL="barrios.nahuel@gmail.com"