My tooling: Text Editor of choice for javascript and python

I normally use vi as my favorite text editor. This can be in terminal or in
MacVIM. But because I looked for a good editor with mutli OS support I tried
Atom. And I was suprised I really liked the workflow and sepecially the Markdown
Support. I know there is a vi on Windows but the compatibility of your setup is
limited.

So I looked in the internet for interesting article about transitioning from vi
to atom. And found the following:

  • http://edsko.net/2015/03/07/vim-to-atom/
  • http://blog.blakesimpson.co.uk/read/84-getting-started-with-the-atom-editor-and-tips-for-switching-from-vim-
  • http://felixjung.io/blog/2014/12/20/atom-form-a-vim-user/

And an intersting article why this is not a good idea:

  • http://www.reddit.com/r/programming/comments/2727fg/why_atom_cant_replace_vim_learning_the_lesson_of/
  • https://pascalprecht.github.io/2014/03/18/why-i-use-vim/

I will continue to let your participate in my journey. I will still open my vi
especially if I am in Terminal. But for I hope to find a good replacement for my
MacVIM.

To be continued …

Use Java 8 on Bluemix: How to use a custom buildpack

The default java runtime is the ibm provides liberty profile. Which has very good additional features that increase performance, but is currently (May, 2015) still on Java 7. So when you want to use Java 8 features in your application you just have to deploy a customer build pack which is not more then to a just the manifest.yml file in the root directory of your application. And there you have to change the line with the buildpack: to https://github.com/cloudfoundry/java-buildpack. The result should look something like this.

buildpack bluemix java 8

Setting up your MEAN.js Develeoper Environment with Vagrant, Chef and Berkshelf

First you have to get started developing your Infrastructure Environment. An Up to Date Guide can be found at safaribooksonline.com. The following procedure will get your local workstation configured and ready to develop cookbooks with Test Kitchen, Vagrant and Chef-zero. Note that this is not a tutorial on how to write cookbooks.

This is just a short discription on the progress I made and not complete. Since I switch from the MEAN.js stack to the jHistper Stack (Java (Spring) in the Backend, AngularJS and Bootstrap in the Frontend, and a variety of databases) I won't continue this. Hope this still helps someone.

The Tools

Vagrant – We use Vagrant and Virtualbox to test our cookbook code and run our tests on our local workstations. The creator of Vagrant wrote the definitive guide for us all.

Test Kitchen – Test Kitchen is the tool we use to manage our Vagrant configurations, configure our environment to mirror Production in a meaningful way and run our tests.

Chef-Zero – Chef-Zero is a lightweight local Chef Server that our testing VMs use to mimic our live Chef environment.

ChefDK – The Chef Development Kit provided by Opscode bundles various Chef tools together. The beauty of ChefDK is that it comes with an embedded Ruby environment and the necessary Ruby Gems required by the tools. This is a great improvement if you’ve ever had to deal with pre-ChefDK local Ruby/RVM configurations, fluctuating gem dependancies and breaking changes between tools.

Getting Vagrant, ChefDK and Tools

ChefDK Installation

First, download and install ChefDK from https://downloads.getchef.com/chef-dk. ChefDK comes with chef-client, Berkshelf, Test Kitchen, ChefSpec, Foodcritic and more.

Vagrant Installation and Configuration

Next, install Vagrant. Head over to https://www.vagrantup.com/downloads.html and download and install the appropriate package for your system.

Once you have Vagrant installed you’ll run the following commands in your (bash) shell to install the supporting plug-ins that we need to integrate Vagrant and Chef.

vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-omnibus
vagrant plugin install vagrant-chef-zero
vagrant plugin install vagrant-vbguest

After installing these, you should logout of your shell and relaunch it to pickup the new environment variables.

Virtualbox Installation and Setup

Next, download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads.

Follow the directions for your platform but skip the VMWare portion and go to the Test Your Setup section below if you’ve opted to use Virtualbox.

Alternately, VMWare installation and Setup

(only do this if you use VMWare rather than Virtualbox)

Download and install VMWare from the web site and have your Vagrant VMWare license handy. You need to purchase the Vagrant VMWare integration license from HashiCorp (the company that makes Vagrant).

Copy your Vagrant VMWare license to ~/.vagrant.d/vmware-license.lic then follow the steps for your specific setup:

For VMWare Workstation, add the following to your ~/.bashrc file ( or ~/.bash_profile on OS X):

export VAGRANT_DEFAULT_PROVIDER=vmware_workstation

Then run:

vagrant plugin install vagrant-vmware-workstation
vagrant plugin license vagrant-vmware-workstation ~/.vagrant.d/vmware-license.lic

For VMWare Fusion, add the following to your ~/.bashrc file ( or ~/.bash_profile on OS X):

export VAGRANT_DEFAULT_PROVIDER=vmware_workstation

Then run:

vagrant plugin install vagrant-vmware-workstation
vagrant plugin license vagrant-vmware-workstation ~/.vagrant.d/vmware-license.lic

lly, everyone using VMWare should reboot their machine and launch VMWare for the first time, accepting the license agreement and allowing it to initialize itself once. Do this before running Vagrant. FYI: Vagrant has plans to consolidate Fusion and Workstation at some point in the near future.

Finally, everyone using VMWare should reboot their machine and launch VMWare for the first time, accepting the license agreement and allowing it to initialize itself once. Do this before running Vagrant. FYI: Vagrant has plans to consolidate Fusion and Workstation at some point in the near future.

Prepare Chef Tools

As you work more with Chef, you will eventually run into repositories that depend on Chef recipes that require your a broad range of tools to be available and configured on your workstation. Run through the following steps now so they are available when you need them.

Configure Knife

(do this only if you don’t have a knife configuration already)
Setup Knife and accept the defaults:

knife configure

You must place your validation key in the following location before generating instance data with Knife:

/etc/chef-server/chef-validator.pem

Create .pem File

Create a .pem for Chef Zero to use when faking Chef server for local configuration.

openssl genrsa 2048 > ~/.chef/<username from knife configure>.pem

Test Your New Setup

You should now create a temporary directory locally for Vagrant VMs and then test that you can create a new Vagrant project. There are many GitHub projects with Vagrant file templates. I recommend that you read up on Vagrant and create your own simple configuration file but if you want to test you can use the one in the next step.

Create an empty directory (~/vagrant_vm, say) for the configuration. This location will contain a Vagrantfile and will eventually contain the running VM as well.

you@workstation$ mkdir ~/vagrant_vm
you@workstation$ cd ~/vagrant_vm

Preparing your Vagrantfile

Copy a Vagrant file from a GitHub repo that suits you and put it in a new file called Vagrantfile in the ~/vagrant_vm directory. (You must name the file Vagrantfile. You cannot always leave it the same name as it is in GitHub.) You can find some generic Vagrantfile examples and the ssh key for the images here: https://github.com/patrickdlee/vagrant-examples.

Or you can use the example one below:

#Quick vagrant file for testing
#
Vagrant::Config.run do |config|
  config.vm.box = 'precise32'
  config.vm.box_url = 'http://files.vagrantup.com/precise32.box'
end

Using the Virtual Machine

Next, launch the VM from the ~/vagrant_vm directory using vagrant up:

you@workstation$ vagrant up

There will be lots of output and once the machine has booted you can ssh to it.

you@workstation$ vagrant ssh

Vagrant exports ~/vagrant_vm from your local your local machine to the VM. Check that you see the the Vagrantfile and .vagrant directories in the VM by running:

sbo@linux:~$ ls -la /vagrant
total 16drwxrwxr-x  1 sbo  sbo  4096 Oct 10 16:03 .
drwxr-xr-x 23 root root 4096 Oct 10 16:05 ..
drwxrwxr-x  1 sbo  sbo  4096 Oct 10 13:56 .vagrant
-rw-r--r--  1 sbo  sbo  1150 Oct 10 16:03 Vagrantfile

Exit from the VM

sbo@linux:~$ exit

Source: http://stackengine.com/devops-delight-chef-dk-chef-zero-vagrant/

Authoring a Cookbook

Each of the individual parts is now installed and shown to work. So lets configure a machine using chef. To do this we will:

  • Write a cookbook to install some of our favorite packages that should be on every machine
  • Run Foodcritic

Scaffolding a Cookbook with Berkshelf

Berkshelf is the “package manager” for Chef cookbooks. It is also the standard way to scaffold a cookbook with ChefDK.

Generate a Berksfile in a pre-existing cookbook
$ cd cookbooks
$ berks init .

https://www.youtube.com/watch?v=0sPuAb6nB2o

New Place API by Google #APIEconomy

Google has launched its Places API for Android and opened a beta program for it on iOS today. It will allow developers to add better location pickers to their apps, so users can specify where they are with real place names instead of latitudes and longitudes.

In addition, it also allows users to add new places to Google’s database of more than 100 million locations.

Google’s Places API and associated JavaScript library has been available for Web apps for some time now, but the new APIs will help developers easily add their functionality into native mobile apps.

You can hop over to this Google Developers site to find documentation, code samples and demos for the Android API, or sign up for iOS public beta on this page.

Mobile Design for the Apple Smart Watch – A Todo App

Apple gave Developers the chance to and guidelines to have their app ready for the Apple Watch. This show how Apple wants their Smart Watch App to look like. In this case Todoist developed almost a complete version of their todo app witch follower the apple guidelines:

[blockquote author=”Apple” link=”http://techcrunch.com/2015/02/02/heres-how-a-to-do-app-will-work-on-the-apple-watch/?ncid=rss” style=”” target=”_blank”]The apps themselves should not be very complicated or feature-heavy. Instead, they should focus on conveying the most, and most relevant information possible given the limited screen real estate, and for a to-do app, it makes sense that those limits would result in a lot of nested lists.[/blockquote]

I think this is a good advice and will consider this for my own smart watch apps either for iOS or Android.

Save git password and authentication in terminal

I was very annoyed with jazz.net as I had to type in my username and password every time I pushed or pulled something to the repository. But then on stackoverflow I found the solution for mac:

[code]git config –global credential.helper osxkeychain[/code]

this allows you to use the normal OS X keychain to store the git credentials. In the link you find also windows and linux solutions.