diff --git a/docs/cv-2016-01.md b/docs/cv-2016-01.md index 7bf8b1d..3badbb3 100644 --- a/docs/cv-2016-01.md +++ b/docs/cv-2016-01.md @@ -47,7 +47,12 @@ Javascript development including OO, DOM manipulation, HTML5, CSS3, Canvas, MVC ### Previous Employment -**Freelance Developer, Censis, March 2016 ** +**Freelance Developer, Censis, March 2016 - May 2016** + +- Developing software for the management of IoT (Internet of Things) devices. +- Full stack development, creating and writing backend servers running on Node, database management using Postgres and CouchDB to the frontend utilising Ember and plain Javascript. +- Using NodeJS, CouchDB, Postgres Sql, Nginx, Websockets, MQTT, EmberJS, EmberCLI, Mocha, deploying onto AWS servers. +- Using Cordova to create mobile versions of the applications to run on both Android and iOS. **Freelance Developer, Impera Media, October 2015 – February 2016** diff --git a/notes/apikeys.md b/notes/apikeys.md index 0c0425a..11d1b90 100644 --- a/notes/apikeys.md +++ b/notes/apikeys.md @@ -2,17 +2,20 @@ LifX + ``` c9bab9ace3433eff72d64f4d871fad575ac050b3783939ccde1b03e8b25c932b ``` Amazon AWS + ``` accessKeyId: 'AKIAJWJS75F7WNCGK64A', secretAccessKey: '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' ``` Forecast + ``` APIKey: '0657dc0d81c037cbc89ca88e383b6bbf' ``` \ No newline at end of file diff --git a/scripts/so_install.sh b/scripts/so_install.sh new file mode 100644 index 0000000..fad148e --- /dev/null +++ b/scripts/so_install.sh @@ -0,0 +1,162 @@ +#!/bin/bash +NVM="$HOME/.nvm" +NVM_VERSION="5.7.0" +DEV="$HOME/dev" +LIVE="$HOME/live" +STAGING="$HOME/staging" +SERVER="smartoffice" +FRONT="SODashServer" +SWAP="/swapfile" +PKG_MANAGER=$( command -v yum || command -v apt-get ) || echo "Neither yum nor apt-get found" +PKG_DEVICE=$(basename $PKG_MANAGER) +UPDATE=no +DATABASE=no +NGINX=no + +fancy_echo() { + local fmt="$1"; shift + + # shellcheck disable=SC2059 + printf "\n$fmt\n" "$@" +} + +for i in "$@" +do +case $i in + -u|--update) + UPDATE=YES + shift # past argument=value + ;; + -d|--database) + DATABASE=YES + shift # past argument=value + ;; + -n|--nginx) + NGINX=YES + shift # past argument=value + ;; + + --default) + DEFAULT=YES + shift # past argument with no value + ;; + *) + # unknown option + ;; +esac +done + + +fancy_echo "Installing Smart Office Console Server ..." +## Update initial packages + +fancy_echo Cleaning... + +if [ ! -d "$DEV" ]; then + mkdir -p $DEV +fi + +if [ ! -d "$LIVE" ]; then + mkdir -p $LIVE +fi + +if [ ! -d "$STAGING" ]; then + rm -rf $STAGING + mkdir -p $STAGING +else + mkdir -p $STAGING +fi + + +if [[ $UPDATE = "YES" ]]; then + if [ $(basename $PKG_MANAGER) = "yum" ]; then + sudo yum --assumeyes upgrade + sudo yum --assumeyes install git make automake gcc gcc-c++ kernel-devel nginx htop screen wget curl postgresql postgresql-contrib + else + sudo apt-get -y -q --force-yes update + sudo apt-get -y -q --force-yes upgrade + sudo apt-get --assume-yes install build-essential git nginx htop screen wget curl postgresql postgresql-contrib + fi +fi + +# set up and install swap file +if [[ ! -f "$SWAP" ]]; then + sudo fallocate -l 1G $SWAP + sudo chmod 600 $SWAP + sudo mkswap $SWAP + sudo swapon $SWAP +fi + +# setup node and npm +if [ ! -d "$NVM" ]; then + # Will enter here if $DIRECTORY exists, even if it contains spaces + + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash + export NVM_DIR=$NVM + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm + + source $HOME/.bashrc + source $NVM/nvm.sh +fi + +nvm install $NVM_VERSION + +# get source and build + +# Install global packages. +npm set progress=false + +if [[ $UPDATE = "YES" ]]; then + fancy_echo "Installing global packages ..." + npm install -g gulp bower pm2 npm-check npm-install-missing ember-cli phantomjs-prebuilt +fi + +if [ ! -d "$LIVE" ]; then + mkdir $LIVE +fi + +if [ ! -d "$DEV" ]; then + mkdir $DEV +fi + +cd $DEV + +# Get latest version of Obrand Admin + +if [ ! -d "$DEV/$FRONT/.git" ]; then + git clone http://gitlab.silvrtree.co.uk/martind2000/SODashServer.git +else + cd $DEV/$FRONT + git pull origin master + +fi + + +# Get latest version of Obrand Admin Server + + cd $DEV/$FRONT + +npm install . && npm-install-missing +bower install +gulp default +rsync -uav --exclude .git $DEV/$FRONT/ $STAGING + + + +echo Copying... +rsync -uav --exclude .git $STAGING/ $LIVE + +npm set progress=true + +# Configure nginx +if [[ $NGINX = "YES" ]]; then + +sudo fuser -k 80/tcp + +sudo wget https://dl.dropboxusercontent.com/u/233909/smartoffice/smartoffice.nginx -O /etc/nginx/sites-available/smartoffice.nginx && sudo ln -s /etc/nginx/sites-available/smartoffice.nginx /etc/nginx/sites-enabled/smartoffice.nginx + +sudo rm /etc/nginx/sites-enabled/default + +sudo /etc/init.d/nginx restart + +fi \ No newline at end of file diff --git a/shell_dotfiles/_gitconfig b/shell_dotfiles/_gitconfig index dc5fd6b..e5c2b5b 100644 --- a/shell_dotfiles/_gitconfig +++ b/shell_dotfiles/_gitconfig @@ -101,6 +101,7 @@ precomposeunicode = false editor = 'nano' + autocrlf = input [color] branch = always @@ -191,3 +192,6 @@ [url "git://gist.github.com/"] insteadOf = "gist:" +[user] + name = Martin Donnelly + email = martind2000@gmail.com