Welcome Corner Blog Posts
Go a little bit deeper into the Welcome Corner with blog posts. Learn how to get started in SAP Community and get tips on maximizing your participation.
cancel
Showing results for 
Search instead for 
Did you mean: 
craigcmehil
Community Administrator
Community Administrator
Years ago, we had started a little tradition in the community of sharing "What's in your bag".



 

The idea was a chance to share various setups and tools that we used to "get it done" in our daily work lives. Now with so many years gone by I find myself a bit nostalgic for those days... OK primarily because my MacBook has recently bit the dust. We are talking re-imaged twice and now the only option is wait for a new one to arrive and start all over.

So while the process of starting over can be amazingly cathartic and is a perfect chance to delete, remove, prune, purge and otherwise optimize your digital world it can also be painstakingly tedious.

So I decided to take the opportunity to kind of document how I work and how I might be able to optimize the setup from one machine to the next without impacting the machine if at all possible or to at least minimize the impact and thus make migration or moving machines easier.

First off, I stopped doing all backups, with the whole Cloud and connected folders there is no real need for a "backup" per se. It also makes it easy to separate work and personal.

For my personal content and the fact I am an Apple user I use iCloud.



For work we use OneDrive from Microsoft.



These two services eliminates all of my "document" needs. For development I use GitHub, the paid service for unlimited private repos works great for me.



 

Now for applications? Well as an Apple user I have the App Store which gets me several apps, we have an internal tool for company related apps then the rest of course are tools that I use and many are often development related which means I need to keep track of a few websites (luckily Chrome let's you sync bookmarks as does Safari).

Now that covers a broad range of what I need to do and be able to work on it. But it does not get into the actual setup of various development environments. Now in the past 3 years I piled a ton of stuff onto my machine and might (I can't confirm or deny) have caused me some issues.

So I've been exploring some tools to give me a development environment setup without too much of an impact on my local machine. Enter the idea of containers....

I've been working with both. With Vagrant I've been able to spin up a VM and provision it with nvm and multiple versions of Node. Which has been very good for running through several tutorials and working on several projects without a problem. I even played around with browser based tools for dev work to see how that might work out.
# -*- mode: ruby -*-
# vi: set ft=ruby :
$rootScript = <<SCRIPT
sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
sudo apt-get install -y git-core curl
SCRIPT

$userScript = <<SCRIPT
cd /home/vagrant
mkdir /home/vagrant/sqlpaddb

# Installing nvm
wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh

# This enables NVM without a logout/login
export NVM_DIR="/home/vagrant/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

echo "Installing: "
echo "Application: node.js"
nvm install stable &> /dev/null
nvm install 6.0.0
nvm alias default 6.0.0
npm install -g npm

# Install Apache, PHP and Codiad
sudo apt-get update && sudo apt-get upgrade
sudo apt-get --assume-yes install apache2 php7.0 libapache2-mod-php7.0
sudo apt-get --assume-yes install php-zip php-mbstring

# Clone Codiad into Apache root
sudo rm -r /var/www/html
sudo git clone https://github.com/Codiad/Codiad /var/www/html/
sudo touch /var/www/html/config.php
sudo chown www-data:www-data -R /var/www/html/
sudo chmod 777 /var/www/html/config.php
sudo chmod -R 777 /var/www/html/data
sudo chmod -R 777 /var/www/html/workspace
sudo chmod -R 777 /var/www/html/plugins
sudo chmod -R 777 /var/www/html/themes
sudo git clone https://github.com/Andr3as/Codiad-Beautify.git /var/www/html/plugins/Codiad-Beautify
sudo git clone https://github.com/Andr3as/Codiad-CodeGit.git /var/www/html/plugins/Codiad-CodeGit
sudo git clone https://github.com/Fluidbyte/Codiad-Terminal.git /var/www/html/plugins/Codiad-Terminal

# Install sqlpad
npm install sqlpad -g

echo "Restart Apache"
sudo service apache2 restart

sqlpad --dir /home/vagrant/sqlpaddb/ --port 3000 &> start.log & echo "SQL Pad started"
SCRIPT

ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provision "shell", inline: $rootScript
config.vm.provision "shell", inline: $userScript, privileged: false
config.vm.network "forwarded_port", guest: 3000, host: 3000, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 3010, host: 3010, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 80, host: 80, host_ip: "127.0.0.1"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "2048"
end
end

Another one I have gives me a full Eclipse environment with all the plugins installed and ready to go.

With Docker I am still working it out and seeing if I can do the same things (I have noticed a bit smaller footprint) but there are pros and cons of a full VM and a container.

I'm also not the only one looking at the differences and I think I may end up with both running.

With Docker you can even get a private registry for your containers.

Google Container Registry provides secure, private Docker image storage on Google Cloud Platform. The price for Multi-Regional buckets is about $0.026 per GB per month.

https://cloud.google.com/container-registry/pricing

Amazon Elastic Container Registry (ECR) is a fully-managed container registry that makes it easy for developers to store, manage, and deploy Docker container images.

Storage is $0.10 per GB-month
First 1 GB / month $0.000 per GB
Up to 10 TB / month $0.090 per GB
All data transfer in $0.000 per GB

https://aws.amazon.com/ecr/pricing/

Which means you can get them setup and store them remotely if you like. For now though I have them in a Github repo that let's me store the files that I use to build one and create it - for Vagrant I use Github as well to keep the setup files.

In the process of my work machine needed to be wiped and re-imaged (twice) I was able to test things for getting setup and working. Other than the document sync which takes awhile considering the amount of data, I was able to be working within about 20 mins and start development work in roughly 40 mins. Document sync depends on network connectivity and well that has taken me like 3 days so far to get all that sync'd - I may need to do more pruning in my documents.

So that's my bag so far, what's your setup? Care to share? #mydevsetup Crazy how mine has changed and how some things are the same since I shared my first setup.

 
5 Comments