$ git clone https://github.com/sdevarapalli1/aws-cli.git
# cd aws-cli
$ docker build -t sdevarapalli/aws-cli:latest -t sdevarapalli/aws-cli:0.2 .
Successfully built ec15aa2e51a2
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sdevarapalli/aws-cli latest ec15aa2e51a2 2 minutes ago 699.6 MB
Log in and Publish Image to Docker Hub
docker@boot2docker:~$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
docker@boot2docker:~$ docker push sdevarapalli/aws-cli:latest
The push refers to a repository [docker.io/sdevarapalli/aws-cli]
latest: digest: sha256:9e50b198a8909febe940b7fd702c7f92d9ff353e941140be06c7a9b9d38fd67a size: 1583
Boot2docker is officially deprecated. Use Docker for Mac if Mac OS X version is 10.10.3 or newer running on a 2010 or newer Mac, with Intel’s hardware support for MMU virtualization; use Docker Toolbox if software or hardware requirements are not met.
Carl’s excellent post describes how to set up Screen with ssh-agent so that when a new screen session is started, windows with names were set up and logged onto different servers automatically. It was not clear how to create the configuration file .screenrc_escP to me initially, but after a bit of trying the following steps worked:
open ~/.screenrc_escP in vi
type string “escape”
press tab key
press ctrl-v: holding the control key press the v key
press ctrl-p: holding the control key press the p key
type character p
In my terminal window character ctrl-p is in bold:
The escape sequence for the outer screen is ctrl-p instead of ctrl-a– to see the windows created in the outer screen type ctrl-p + ” — holding the control key press p, release the control key, press double quotes:
I use ctrl-p at bash prompt to go to the previous command, so I chose ctrl-y as my escape character for the outer screen. After setting up config files and ssh-agent, starting a screen session created different windows and ssh connections opened to different servers.
Consider a Spring MVC application deployed in Tomcat servlet container. For each request, the following sequence of steps occur:
Tomcat gets the request and executes the configured chain of servlet filters
Spring Dispatcher Servlet receives the input request — assuming the request URL is configured to map to dispatcher servlet
Dispatcher Servlet maps the request URL to a handler using handler mapping– in other words, dispatcher servlet maps the request to an execution chain comprising a chain of Handler Interceptors and Controller. SpringUrlHandlerMapping can be used to map different URL patterns to different execution chains. For example, URL pattern /news/* could be mapped to interceptors AuthorizationHandlerInterceptor, RequestValidationHandlerInterceptor and NewsController.
View Resolver is used to resolve the view name returned by the controller and the view rendered
Below picture depicts the sequence of steps:
Let’s say that request processing logic for URL patterns /news/* and /premiumnews/* is exactly the same except that /premiumnews/* is accessible only for users with premium subscription. Logic to check if user is signed in and if user has premium subscription can be abstracted in PremiumSubscriptionValidatorHandlerInterceptor and included only in execution chain returned for /premiumnews/*.
Note that both the URL patterns are mapped to newsController and premiumSubscriptionValidatorHandlerInterceptor is included only in the mapping for /premiumnews/*
Another example: say that there are both web and mobile versions for news content, and web version displays modules “Popular on Facebook” and “News Pulse” — content for these modules are obtained by querying a web service. Since these modules are displayed on web version only, logic to query the web service can be abstracted into an interceptor and included in execution chain returned only for web requests.
Hope you understood how to decouple business logic using handler interceptors!
Log4j Version 1.3 has a ConfigurationServlet which can be used to view/modify the current log4j logger settings for a web application. Per the information on Log4j website version 1.3 has been abandoned:
Openutils-log4j includes the configuration servlet that provides a simple web interface for changing the log4j levels:
A seemingly simple XPath expression to modify some nodes in web.xml during maven build process using XMLTask from oops consultancy didn’t work. Article Little Back Corners nailed the issue — namespace declarations in xml file. I have used local-name() function to workaround the issue. Below is an example: