Setup Jenkins and DevTools on Ubuntu on AWS EC2

 

Install Git, Java7, Java 8 and Maven

sudo apt-get install git

sudo apt-add-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

sudo apt-get install oracle-java7-installer

sudo apt-get install oracle-java8-set-default

sudo apt-get install maven

 

Install Jenkins

sudo wget -q -O – https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add –
sudo sh -c ‘echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list’
sudo apt-get update
sudo apt-get install jenkins

 

Install MongoDB

 

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10

echo “deb http://repo.mongodb.org/apt/ubuntu “$(lsb_release -sc)”/mongodb-org/3.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list

sudo apt-get update

sudo apt-get install -y mongodb-org

sudo apt-get install -y mongodb-org=3.0.4 mongodb-org-server=3.0.4 mongodb-org-shell=3.0.4 mongodb-org-mongos=3.0.4 mongodb-org-tools=3.0.4

sudo service mongod start

sudo tail -5000 /var/log/mongodb/mongod.log

 

Install Postgresql

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

 

Install Redis

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-redis

sudo apt-get install build-essential

sudo apt-get install tcl8.5

sudo wget http://download.redis.io/releases/redis-stable.tar.gz

sudo tar xzf redis-stable.tar.gz

cd redis-stable

make

make test

sudo make install

cd utils

sudo ./install_server.sh

sudo service redis_6379 start

redis-cli

Install Scala

http://blog.prabeeshk.com/blog/2014/10/31/install-apache-spark-on-ubuntu-14-dot-04/

http://www.scala-lang.org/download/2.11.7.html

sudo wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.deb

sudo dpkg -i scala-2.11.7.deb

 

Install SBT and Gradle

http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html

echo “deb http://dl.bintray.com/sbt/debian /” | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-get update
sudo apt-get install sbt

install typesafe activator

sudo wget http://downloads.typesafe.com/typesafe-activator/1.3.5/typesafe-activator-1.3.5.zip

 

sudo apt-get install unzip

curl -s get.gvmtool.net | bash

source “/root/.gvm/bin/gvm-init.sh”

gvm install gradle

 

Notes

https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines

https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds

Setup back for jenkins

https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Best+Practices

 

/var/log/jenkins/jenkins.log

 

Add 8080 to all same ports as 80

http://MYIP:8080/configure

 

 

AWS Summit 2015 Slides of Interest

AWS Security

http://www.slideshare.net/AmazonWebServices/nyc-room2-architectingforgreatersecurityinawsbillshinn

http://www.slideshare.net/AmazonWebServices/intro-to-aws-security-50364629

Cost Optimization

http://www.slideshare.net/AmazonWebServices/nyc-room1-costoptimizationfinal20150708

http://www.slideshare.net/AmazonWebServices/creating-a-culture-of-cost-management-in-your-organization-50364904

DevOps

http://www.slideshare.net/AmazonWebServices/nyc-room1-accelerating-devops-pipelines-with-awskoswilms

http://www.slideshare.net/AmazonWebServices/devops-at-amazon-a-look-at-our-tools-and-processes-50364582

AWS EC2 Contianers (DOCKER)

http://www.slideshare.net/AmazonWebServices/amazon-ec2-container-service-manage-dockerenabled-apps-in-ec2-50366981

Introduction to EC2

http://www.slideshare.net/AmazonWebServices/intro-to-aws-amazon-ec2-and-compute-services-50366686

Scaling

http://www.slideshare.net/AmazonWebServices/deep-dive-scaling-up-to-your-first-10-million-users-50366610

VPC

http://www.slideshare.net/AmazonWebServices/deep-dive-amazon-virtual-private-cloud-50365029

http://www.slideshare.net/AmazonWebServices/deep-dive-amazon-virtual-private-cloud-50365085

AWS Elasticache

http://www.slideshare.net/AmazonWebServices/intro-to-aws-database-services-50364961

AWS Lambda

http://www.slideshare.net/AmazonWebServices/aws-lambda-eventdriven-code-in-the-cloud-50364719

AWS EBS

http://www.slideshare.net/AmazonWebServices/deep-dive-maximizing-amazon-ec2-and-amazon-elastic-block-storeperformance

Microservices update

https://blog.yourkarma.com/building-microservices-at-karma

http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/tutorial-spot-instances-java.html

http://www.javaworld.com/article/2940528/developer-tools-ide/eclipses-latest-release-train-carries-docker-java-technologies.html?phint=newt%3Dinfoworld_java&phint=idg_eid%3Dd207dd9989acf6b7ba24c1afc4a835a2#tk.IFWNLE_ifw_java_2015-06-26

http://nginx.com/blog/building-microservices-using-an-api-gateway/

https://medium.com/aws-activate-startup-blog/upgrades-without-tears-part-1-introduction-to-blue-green-deployment-on-aws-e5bcf90eb60b

https://medium.com/aws-activate-startup-blog/upgrades-without-tears-part-2-blue-green-deployment-step-by-step-on-aws-29c0ffe99c60

http://martinfowler.com/articles/refactoring-pipelines.html

http://www.oracle.com/technetwork/articles/java/horstmann-1958988.html

http://blog.codacy.com/2015/06/26/why-we-chose-scala/

http://www.infoq.com/presentations/How-We-Mostly-Moved-from-Java-to-Scala

http://radar.oreilly.com/2015/03/3-simple-reasons-why-you-need-to-learn-scala.html

NOSQL (MongoDB) Injection

https://www.owasp.org/index.php/Testing_for_NoSQL_injection

http://blog.websecurify.com/2014/08/hacking-nodejs-and-mongodb.html

http://www.nosqlmap.net/

https://media.blackhat.com/bh-us-11/Sullivan/BH_US_11_Sullivan_Server_Side_WP.pdf

http://2012.zeronights.org/includes/docs/Firstov%20-%20Attacking%20MongoDB.pdf

http://ieee-security.org/TC/SPW2015/W2SP/papers/W2SP_2015_submission_11.pdf

http://tinple.io/tech/mongo-security-part-two

http://blog.websecurify.com/2014/08/attacks-nodejs-and-mongodb-part-to.html

Using https://en.wikipedia.org/wiki/Rainbow_table

http://www.reddit.com/r/netsec/

https://thecodebarbarian.wordpress.com/2014/09/04/defending-against-query-selector-injection-attacks/

http://docs.mongodb.org/manual/administration/security-checklist/

http://sakurity.com/blog/2015/06/04/mongo_ruby_regexp.html

http://software-talk.org/blog/2015/02/mongodb-nosql-injection-security/

https://github.com/shirishp/NoSQLInjectionDemo

https://blogs.adobe.com/security/files/2011/04/NoSQL-But-Even-Less-Security.pdf

http://www.slideshare.net/44Con/pentesting-nosql-dbs-with-nosql-exploitation-framework

Streaming Large JSON Files with Java 8

As expected, the main options are the two big guys in JSON parsing,  GSON from Google and FasterXML Jackson 2.   Both are very solid and fast, but there’s also a couple of other libraries worth trying.

If you use Jackson, use the latest, FasterXML Jackson 2.  Not Codehaus.

Spring Cloud Configuration

Monday Cool Links

Monitoring and Metrics

https://github.com/nerdalert/cloud-bandwidth

https://www.pagerduty.com/blog/best-metrics-devops-culture/

http://www.slideshare.net/melaniemj/monitoring-is-never-done

https://speakerdeck.com/chrissiebrodigan/measuring-hard-to-measure-things

Culture

http://www.thoughtworks.com/insights/blog/5-tips-being-effective-tech-lead

Tools

https://github.com/EverythingMe/redash

http://githubengineering.com/brubeck/

Servers and Services

https://github.com/CiscoCloud/mesos-consul

DevOps Techniques, Tools and Processes

http://www.daniellesucher.com/presentations/gamedays/#/

http://www.slideshare.net/brendangregg/monitorama-2015-netflix-instance-analysis

Microservices

http://www.slideshare.net/dbryant_uk/devoxxuk-2015-the-seven-deadly-sins-of-microservices-full-version

Reactive

http://saulmm.github.io/when-Iron-Man-becomes-Reactive-Avengers2/

http://www.philosophicalhacker.com/2015/06/19/introduction-to-rxjava-for-android-pt-2/

Big Data

http://blog.acolyer.org/2015/06/18/spinning-fast-iterative-dataflows/

http://vision.cloudera.com/apache-kafka-a-platform-for-real-time-data-streams-part-2/

http://www.slideshare.net/julienledem/how-to-use-parquet-hadoopsummitsanjose2015

Microservices Top 20 Links – 2015

 

Why 12 Factor Application Patterns, Microservices and CloudFoundry Matter? Part 2 – What to change and how.

I first described a difficult scenario that I faced a few years ago.   This article is my recommendations to the current custodians of that project on what to change and how.

With the help of open source frameworks like Spring Cloud and open source platforms like Cloudfoundry, you aren’t forced into having a fragile, manual SDLC.   The first step is to embrace change and join a vibrant community that is succeeding in software development.

 

Overview

  • Increase agility through process, tools and culture
  • Examine the code and depedencies, determine modules based on business domain.
  • Refactor the monolithic EAR into microservices living in JARs guided by the 12 Factor Application patterns and microservices recommendations.
  • 12FA – III – Store configuration in the environment (or even better use a configuration server)
  • Change the Development Process, Frameworks, Libraries and Tools.
  • Change the Build Process and Tools.  Embrace Gradle, Maven, JDK 8.
  • Change the Delivery Process.   Enact Continuous delivery.
  • Change the Database modifications and migration Process and Tools.
  • Change the run-time platform from legacy application server to a PaaS.
  • Centralize the logging.    Using PCF Loggregator and tools like ELK and PaperTrail.
  • Embrace industry standard open source tools, libraries and frameworks
  • Good code fails when you don’t have good process and a platform to help you.
  • Good teams fail when you don’t have a good culture that embraces DevOps, microservices and not giant monoliths.

 

So how could we have improved our process?   The first step is to admin you have a problem and seek help.   By looking to the community, open source and successful startups that have faced similar struggles with monolithic J2EE code bases (Ebay, Netflix), we can determine some functional patterns.

 

Patterns and Principles for Change

  • Use Jenkins to deploy your app with no downtime to CloudFoundry.
  • Use CloudFoundry deployments to do A/B testing with no downtime or difficulty.
  • Bind to database, using the same process in development, test, Q/A and production.   No manual configuration or configuration changes.   Operators make available the correct database settings through the marketplace.  Same manifest and bindings will point to different databases in different spaces.
  • To migrate database changes use flywaydb or liquibase.   These are very well integrated into Spring Boot.
  • Look at NoSQL for part of your database workload, polyglot persistence makes sense in many cases.   For MongoDB development, you handle change management with Mongeez, which is automatically done with JHipster.
  • Smoke tests and automated tests tied to Jenkins.
  • Test against CloudFoundry development for local development, fast deployments, run unit and integration tests locally.
  • Use Maven or Gradle for builds, not ANT.
  • Use Circuit breakers in your web calls to avoid breaking systems and fail safely.
  • Use APM and JMX for deep checks using Pivotal Ops Metrics for CloudFoundry.
  • Have automated scripts check one log stream.  Use tools like ELK (ElasticSearch+Logstash+Kibana) to examine logs.
  • Use CloudFoundry containers that don’t make you SSH to many machines, removing a big manual step that could be a security issue.
  • Move to using smaller, lighterweight Spring Boot Jars and Wars; not giant EAR files.
  • Use lightweight web containers like Jetty, Tomcat, tcServer, or Undertow.
  • Use lightweight frameworks, remember YAGNI and KISS.
  • Read and embrace:  Release It!
  • Break up the apps into smaller, logical components that model real business functionality.
  • Refactor existing code guided by tests, enhancing and adding more tests as the code evolves.  Remembering to use code coverage tools like Jacoco.
  • Design clean RESTful APIs guided by SRP (Single Responsibility Principle).
  • Use smart, modern opinionated frameworks for development like Spring Boot, DropWizard and RatPack.
  • Install GVM and use it to install SpringBoot, Gradle, Groovy, LazyBones and other great tools.  example:   gvm install springboot
  • Use Spring Cloud Connectors, Spring Cloud Netflix projects for Service Discovery and other useful services to enable microservices orchestration and development.
  • Use a very helpful application generator like JHipster.
  • Use Domain Driven Design.
  • Keep to the basics of OOD for existing code and Functional Reactive Programming for new code.
  • Document your API with Spring REST Docs or Swagger.  There is a great presentation on that here.
  • Start your green field projects with one button click or use the Spring CLI (spring init -d=web,data-jpa,actuator,data-rest –build=maven newappdir/).

 

References

Service Discovery

Scala and more… Links

http://techblog.realestate.com.au/java-to-scala-cheatsheet/

http://danielwestheide.com/scala/neophytes.html

http://stackoverflow.com/tags/scala/info

http://www.codecommit.com/blog/scala/roundup-scala-for-java-refugees

http://www.scala-lang.org/docu/files/ScalaByExample.pdf

https://speakerdeck.com/agemooij/between-zero-and-hero-scala-tips-and-tricks-for-the-intermediate-scala-developer

http://twitter.github.io/effectivescala/

http://twitter.github.io/scala_school/basics.html

http://www.artima.com/scalazine

Scala + Mongo

http://www.slideshare.net/search/slideshow?searchfrom=header&q=scala+mongo

Scala + redis

http://www.slideshare.net/luksow/microservices-playworkshopiteratorswarsjawa2014?qid=aa0fd58f-c9c5-4f57-925c-dcbe9c6c35b1&v=default&b=&from_search=2

Scala + Postgresql

Akka

http://www.slideshare.net/ktoso/akka-persistence-event-sourcing-in-30-minutes?qid=d2a6270f-ffad-425f-a15f-e1e3123e275d&v=default&b=&from_search=2

http://www.slideshare.net/bantonsson/akka-persistencescaladays2014

http://www.slideshare.net/patriknw/akka-persistence-webinar?qid=d2a6270f-ffad-425f-a15f-e1e3123e275d&v=default&b=&from_search=5

http://www.slideshare.net/jboner/akka-simpler-scalability-faulttolerance-concurrency-remoting-through-actors?qid=d2a6270f-ffad-425f-a15f-e1e3123e275d&v=default&b=&from_search=6

http://www.slideshare.net/NLJUG/eventsourced-architectures-with-akka-sander-mak

http://www.slideshare.net/romantimushev/akka-patterns

http://www.slideshare.net/RoyRusso1/introduction-to-akka-atlanta-java-users-group?qid=d2a6270f-ffad-425f-a15f-e1e3123e275d&v=default&b=&from_search=9

http://www.slideshare.net/matyjas/scaling-web-apps-with-akka?qid=d2a6270f-ffad-425f-a15f-e1e3123e275d&v=default&b=&from_search=10

http://www.slideshare.net/shinolajla/real-world-akka-recepies-v3

http://www.slideshare.net/NLJUG/akka-in-practice-age-mooij-and-raymond-roestenburg

Spark

Rx-Netty, Netflix Karyon 2

http://www.javacodegeeks.com/2015/06/rx-netty-and-karyon2-based-cloud-ready-microservice.html

https://github.com/Netflix/karyon

https://github.com/Netflix/karyon/tree/master/karyon2-examples

https://github.com/ReactiveX/RxNetty

https://github.com/ReactiveX/RxNetty/blob/0.x/rxnetty-examples/src/main/java/io/reactivex/netty/examples/http/helloworld/HelloWorldServer.java

https://github.com/ReactiveX/RxNetty/blob/0.x/rxnetty-examples/src/test/java/io/reactivex/netty/examples/http/helloworld/HelloWorldTest.java

https://github.com/Netflix/karyon/wiki

https://github.com/bijukunjummen/sample-ping-pong-netflixoss/tree/master/sample-pong

Slides from 2015 NE Scala

http://www.nescala.org/

http://spray.io/nescala2015/#/

http://www.slideshare.net/tobym/a-sane-approach-to-microservices

https://www.dropbox.com/s/9pjla37wg3imnvg/Interpreter.pdf

http://plastic-idolatry.com/erik/nescala2015.pdf

http://rapture.io/talks/inference/boston.html

https://speakerdeck.com/tixxit/speed-correctness-or-simplicity-choose-3

https://docs.google.com/presentation/d/1hBGqRHfOrBMnVxuCcb20oaFv_wkjdPBGush9FpFbzgs/pub?slide=id.i0

https://www.dropbox.com/sh/vt9u9s4p7mprst6/AAC9Xc-Xzn5UXOHmXhWuuzzla?dl=0

http://www.meetup.com/nescala/

https://speakerdeck.com/tixxit/speed-correctness-or-simplicity-choose-3

https://twitter.com/nescalas

http://www.meetup.com/ny-scala/

https://www.parleys.com/channel/scala-days-san-francisco-2015

http://www.meetup.com/scala-phase

http://phillyemergingtech.com/

Hot Links

SecurityScorecard Partners with Sequoia in 12.5 Million Series A Funding Round

Tools for Crushing High Availability and Scalability, Part I

One tip that seems obvious, look at what the Internet innovators, large scale startups are doing.   They have open sourced many of their tools.   Square, Netflix, Google, Twitter, Facebook, LinkedIn,

I.  Data in Memory

Persistent Key-Value Store for Java from the excellent Java Advent calendar for 2014.

NoSQL Key-Value stores that run in-memory like Redis are incredibly helpful for scalability.   Memcached is also an option.   Gemfire is insanely powerful and scales across WANS, it runs some huge transaction sites and is awesome with Java.   India Railways is an incredibly interesting example of scaling on in-memory data grids.

II.  Microservices / 12 Factor Apps on a PaaS

It’s hard to scale a lumbering beast, easier when you have a swarm of agile services.    With each service having an API that can be shared internally or externally you easily open your architecture to extension and usage from outside sources which is key in growing them.   This has worked well for Uber, Google, Facebook, Twitter and a host of others.

The Platform to Enable Microservices:   An Open PaaS.   With the Linux Foundation running it, CloudFoundry is the open choice, it’s the Tomcat of the PaaS.  Extensible, Standard, Fast, Flexible, Elastic and Open — CloudFoundry Rocks.

III.  Reactive Programming

Using one of the reactive frameworks and following the Reactive Manifesto really help drive your scalable apps.  Take a look at:

 

Part II – Draft

IV.  Rapid Data Ingest

A key piece of the HA puzzle is having the data you need instantly available and

V.  Functional

Whether it’s Scala, Map Reduce, Apache Spark, Groovy or Java 8 with Lambdas – functional programming is bringing new ways of increasing performance and solving big data and real-time programming issues.

VI.   Message Driven

Disconnected services and running asynchronously greatly improves scalability and keeps one weak link from breaking your data chain.

VII.  Netflix Architecture / Spring Cloud Netflix

Internet pioneer Netflix has created a number of amazing tools that keep applications scaling, failing fast and recovering.   These tools have been augmented with Spring and are coming to the PaaS.   These have with critical portions like Circuit Breakers and discovery.   These are very important to manage all the microservices in your architecture.   There are also great tools from running on AWS.

VIII.  DevOps

VIV.  Containerization

X.  Continuous Delivery

Having a tool that builds your applications from Git and runs automated tests and static analysis is very critical.

Canary Deploys

Blue-Green Deploys

A/B Testing

Circuit Breaker for Inter-Service Communication and External Service Access

Reactive Streams / Asynchronous Streams

XI.  Responsive Front-Ends / Single Page Applications

WebSockets with SockJS, Stomp.  HTML5.  AngularJS / Backbone / Ember / …

XII.  Polyglot Programming

Play, MEAN, Spring Boot, DropWizard, Ratpack, Sinatra, Rails.   There are many different frameworks for building modern web applications.

XIII.  Front-End Tooling

Gulp, Grunt, Bower, …

XIV.  Clustering

Yarn, CloudFoundry, Kubernetes.

XV.  Native Applications

IoS and Android applications have more sensors, better user experience and superior look and feel.   There are awesome tools to enable doing this development faster and cleaner.

XVI.  Using Netty

XVIV.  API Documentation with Swagger

 

Critical Tools

There’s a ton of great tools I recommend for all developers to install.   Here is a sampling of ones that get frequent usage:   Java, Groovy, Typesafe Activator, CF CLI, Spring Boot CLI, Maven, Gradle, GVM, Watch, HTML2Text, Boot2Docker, VirtualBox, CURL, WGET, BREW, Vagrant, SOAPUI, IntelliJ, NetBeans, Android Studio, Redis Desktop Manager, SQuirrel SQL, Sublime, pgAdmin 3, git, and JMeter.

CF CLI – A Command Line Tool for working with CloudFoundry, Pivotal CF and Pivotal PWS.   See some more information at CloudFoundry Rocks.

HTML2Text – convert HTML dumps to Text for reading/piping into logs and easy command line viewing.  Works well with Curl and WGET.

Watch – cool UNIX/MacOSX command line tool for checking on an app, great with cf app <MYAPP>.

Spring Boot CLI – A Command Line Tool for working/running Spring Boot.    This is installed by the excellent GVM.

Maven – Default build tool.

Gradle – The other awesome build tool.

GVM Tool – great tool for installing and managing Groovy, Gradle, Vert.x, LazyBones, SpringBoot and more.

gvm current
Using:
crash: 1.3.0
gradle: 2.2.1
grails: 2.4.3
groovy: 2.3.8
lazybones: 0.7.1
springboot: 1.2.0.RELEASE






Using Spring-XD to Load Files into GemFire XD

Spring XD Scripts

My General Setup Script (I save it in setup.xd and load it via  script –file setup.xd)

had config fs –namenode hdfs://pivhdsne:8020
admin config server http://localhost:9393
hadoop fs ls /
stream list

The Script for Loading a File into GemFireXD via Spring-XD

stream create --name fileload --definition "file --dir=/tmp/xd/input/load --outputType=text/plain |  jdbc --tableName=APP.filetest --columns=id,name" --deploy

 

Spring XD Configuration for GemFire XD

Copy the GemFire XD JDBC Driver to Spring-XD (might need tools.jar as well)

cp /usr/lib/gphd/Pivotal_GemFireXD_10/lib/gemfirexd-client.jar /opt/pivotal/spring-xd/xd/lib/

Modify the Sink’s JDBC properties to point to your Gemfire XD, if you are using the Pivotal HD VM and install Spring-XD with Yum (sudo yum update spring-xd), this is the location:

/opt/pivotal/spring-xd/xd/config/modules/sink/jdbc/jdbc.properties
url = jdbc:gemfirexd://localhost:1527
username = gfxd
password = gfxd
driverClassName = com.pivotal.gemfirexd.jdbc.ClientDriver

For Peer Client Driver you need more files from GemFireXD Lib (the .so binaries), linking is probably a good idea.

 

GemFire XD Setup

gfxd
connect client 'localhost:1527';

create table filetest (id int, name varchar(100)) REPLICATE PERSISTENT;
select id, kind, netservers from sys.members; 
select * from filetest;

Spring XD Commands

stream list

show your jobs

 

Reference:

 

Quick Look: Spring XD

 

Spring XD:  A really quick way to batch process data from an easy to run shell.   It’s very easy to setup to run a one node version of XD and use it on Windows, Mac or Linux.   Looks like a great tool.

 

 

 

Quick Loop: JHipster and Spring Boot Tools

Install Yeoman and other JavaScript Tools

npm install -g yo
npm install -g bower
npm install -g grunt-cli
npm install -g gulp
npm install -g karma
npm install jshint
npm install -g ngmin

Install JHipster

npm install -g generator-jhipster

Update your version of JHipster with:

npm update -g generator-jhipster

And then you can update your project when you run again.

yo jhipster
yo jhipster:entity foo
yo jhipster:service bar
grunt server
bower install
bower update
grunt build
java -jar jhipster-0.1-SNAPSHOT.war --spring.profiles.active=prod
mvn -Pprod package
-javaagent:spring_loaded/springloaded-jhipster.jar -noverify -Dspringloaded=plugins=io.github.jhipster.loaded.instrument.JHipsterLoadtimeInstrumentationPlugin
mvn -Pprod spring-boot:run
mvn spring-boot:run

The application will be available on http://localhost:8080.

Quick Look: Mocking Options

JMock is cool, because of this awesome book!

JMockIt

can test private and static
doesn’t need to worry about injections, works through class loader
mocks statics, 3rd party library, …

 

 

 

Quick Tip: Spring REST Utility for Current HTTP Request

Utility Method for Spring REST

 public static HttpServletRequest getCurrentRequest() {
     RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
     Assert.state(requestAttributes != null, "Could not find current request via RequestContextHolder");
     Assert.isInstanceOf(ServletRequestAttributes.class, requestAttributes);
     HttpServletRequest servletRequest = ((ServletRequestAttributes) requestAttributes).getRequest();
     Assert.state(servletRequest != null, "Could not find current HttpServletRequest");
     return servletRequest;
 }

Sometimes it’s easier to get the underlying Servlet request to get some headers or variables.

 final String userIpAddress = getCurrentRequest().getRemoteAddr();
 final String userAgent = getCurrentRequest().getHeader("user-agent");

This is used in the simple REST service using HTTP Post verb @ the awesome CloudFoundry:

(Source)

Tool for Creating Your Test JSON.

Spring Boot Documentation

 

Quick Tip: Maven Cleaning

Purge Cache

Or you can manually delete all or some of the directories under your .m2 directory.

We find if anything majorly changes in a few related modules, this is the safest course of action.   Delete all directories, delete .m2 directories, fresh clone from Git, mvn clean and enjoy.

Quick Links: Modern Tools for Modern Big Data Applications

Modern Front-End Tools (Front-End Build Wars)

A ton of great tools for running tons of tasks and building modern front-ends.   These are to the front what maven and gradle are to the back.
Build Wars: Gulp vs Grunt
Spring-cleaning Unused CSS With Grunt, Gulp, Broccoli or Brunch
Yeoman – Modern workflows for modern webapps
Environment-specific Builds With Grunt, Gulp or Broccoli
Gulp, Grunt, Whatever – Pony Foo
Brunch | ultra-fast HTML5 build tool
Modern Web Apps (Java 8 + AngularJS + Spring 4 + Gradle)
trackr: An AngularJS app with a Java 8 backend – Part I | techdev Solutions
trackr: An AngularJS app with a Java 8 backend – Part II | techdev Solutions
Pagination with Spring Data and HATEOAS in an AngularJS app | Patrick Grimard’s Java Blog
Modern Rapid Development and Production Deployment Tools (Spring Boot, Spring 4)
joshlong/bookmarks
joshlong/boot-examples
joshlong/boot-it-up
RestController in Spring 4.0
Spring 4 Tutorials
Spring Transaction Management
Spring Framework 4 on Java 8 // Speaker Deck
Pivotal presentations channel
Big Data (Spring with Hadoop)
SpringOne2GX 2013 Replay: Real Time Analytics with Spring
SpringOne2GX 2013 Replay: Hadoop – Just the Basics for Big Data Rookies
dzone.com – Seven Databases in Seven Weeks: Hbase, Day 2
Apache Solr real-time live index updates at scale with Apache Hadoop | Java Code Geeks
Modern Cloud Development and Hosting (Cloud Foundry)
Run Your Java Code on Cloud Foundry – Andy Piper (Pivotal)
clds.sdsc.edu/sites/clds.sdsc.edu/files/Pivotal_DS_supercomputing2013.pdf
Run the site on Cloud Foundry · spring-io/sagan Wiki
Pivotal Resources 
A real-time architecture using Hadoop and Storm @ JAX London
Spring Boot with Groovy and Friends
HyperLogLog – Wikipedia, the free encyclopedia
The lost outpost | a weblog by Andy Piper about technology, photography, and life
Installing a Hadoop Cluster with three Commands | codecentric Blogcodecentric Blog
Using Ambari Blueprints to automatically provision and install the Lambda Architecture | codecentric Blogcodecentric Blog
3 lessons in database design from the team behind Twitter’s Manhattan — Tech News and Analysis
Bloom filter – Wikipedia, the free encyclopedia
Hadoop Tips: Bloom Filters in HBase and Chrome
Enterprise-ready production-ready Java batch applications powered by Spring Boot | codecentric Blogcodecentric Blog
MapReduce Introduction – Tutorial
Scaling SQL with Redis – David Cramer’s Blog
HBase – Apache HBase™ Home
Work with Hadoop and NoSQL Databases with Toad for Cloud – ReadWrite
Google Research Publication: MapReduce
Overview | Postgres-XL
headissue/cache2k-benchmark
In 45 Min, Set Up Hadoop (Pivotal HD) on a Multi-VM Cluster & Run Test Data | Pivotal P.O.V.
BOSH Components | Cloud Foundry Docs
Pivotal Open Source Hub (San Francisco, CA) – Meetup
WebScaleSQL | “We’re Gonna Need A Bigger Database”
Eight Terminal Utilities Every OS X Command Line User Should Know · mitchchn.me
Report: NoSQL Databases – Providing Extreme Scale and Flexibility — Gigaom Research
HDFS Architecture
PostgreSQL: PostgreSQL 9.4 Beta 1 Released
Using Redis at Pinterest for Billions of Relationships | Pivotal P.O.V.
Replication, Clustering, and Connection Pooling – PostgreSQL wiki
Hadoop Content on InfoQ
dzone.com – JSON on Hadoop Example for Extending HAWQ Data Formats Using Pivotal eXtension Framework (PXF)
When should I use Greenplum Database versus HAWQ? | PivotalGuru
dzone.com – In 45 Min, Set Up Hadoop (Pivotal HD) on a Multi-VM Cluster & Run Test Data
PostgreSQL: Documentation: 9.3: High Availability, Load Balancing, and Replication
PostgreSQL – Wikipedia, the free encyclopedia
The Hadoop Ecosystem Table
Pivotal Hadoop Distribution and HAWQ Realtime Query Engine | Architects Zone
momjian.us/main/writings/pgsql/replication.pdf
dzone.com – EMC World 2014: Pivotal and Isilon Take Hadoop Prime Time in the Enterprise
dzone.com – Pivotal ship Hadoop distro complete with ‘world’s fastest’ SQL query engine
dzone.com – Pivotal Hadoop Distribution and HAWQ Realtime Query Engine
HAWQ | Pivotal P.O.V.
Cloud Foundry Eclipse Plugin | Pivotal Docs
dzone.com – Transform Your Skills: Simple Steps to Set Up SQL on Hadoop
dzone.com – What Makes Hadoop So Important & How To Gain Business Value From It
Search Results For: hadoop pivotal
Cloud Foundry Environment Variables | Cloud Foundry Docs
PCC Installation Checklist | Pivotal Docs
Pivotal Web Services Documentation | Pivotal CF Docs
Hadoop Tutorials from Hortonworks
Tips for Java Developers | Cloud Foundry Docs
Spring for Apache Hadoop
Spring Framework Reference Documentation
16. Web MVC framework
cloudfoundry/java-test-applications
Getting Started with Pivotal Web Services | Pivotal CF Docs
6 Easy Steps: Deploy Pivotal’s Hadoop on Docker | Pivotal P.O.V.
cloudfoundry/java-buildpack-dependency-builder
Pivotal-Field-Engineering/checkgreenplum
Pivotal-Field-Engineering/groovy-sqlfire
OpenTSDB – A Distributed, Scalable Monitoring System
Pivotal-Field-Engineering/pxf-field
Pivotal-Field-Engineering/tcollector
Pivotal-Field-Engineering/pmr-common
Pivotal-Field-Engineering/cf-scale-boot
Pivotal-Field-Engineering/gemfire-bosh-release
Big Data Benchmark
vFabric/vFabricReferenceArchitecture
vFabric
Pivotal-Field-Engineering/benchmark
Pivotal-Field-Engineering/retail-demo-xd
gopivotal/spring-travel-app
gopivotal/SpringTraderHD
gopivotal/pivotal-samples
Pivotal Web Services