Step 1. Launch a docker container
$ docker run -it ubuntu /bin/bash
Step 2. Run the following INSIDE the container
$ export LOCATION="SFS in Denver"
$ sleep 1000
Step 3. Run outside the container in another window at the same time
public class Main { | |
private static final int PORT = 8085; | |
public static void main(String args[]){ | |
Tomcat server = new Tomcat(); | |
server.setPort(PORT); | |
Context ctx = server.addContext("/ctx0", new File(".").getAbsolutePath()); | |
Wrapper wrapper = Tomcat.addServlet(ctx, "MyAsyncServlet", new MyAsyncServlet()); |
Alternatively, if you need to find out more about the data context of a specific template fragment, you can also write a dedicated {{log}} helper: | |
Template.profile.helpers({ | |
log: function () { | |
console.log(this); | |
} | |
}); | |
And use it directly in your templates: | |
<template name="profile"> |
package io.github.derekbassett.exampledropwizard | |
import com.mongodb.MongoClient; | |
import io.dropwizard.Application; | |
import io.dropwizard.setup.Bootstrap; | |
import io.dropwizard.setup.Environment; | |
import org.glassfish.hk2.utilities.binding.AbstractBinder; |
/* | |
A Tour of Go: page 44 | |
http://tour.golang.org/#44 | |
Exercise: Loops and Functions | |
As a simple way to play with functions and loops, implement the square root function using Newton's method. | |
In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: z - (z*z - x) / (2 * z) |
<plugin> | |
<groupId>com.spotify</groupId> | |
<artifactId>dockerfile-maven-plugin</artifactId> | |
<configuration> | |
<repository>${docker.registry}/${docker.image}</repository> | |
<tag>${docker.tag}</tag> | |
<buildArgs> | |
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE> | |
</buildArgs> | |
<skip>${dockerfile.skip}</skip> |
Step 1. Launch a docker container
$ docker run -it ubuntu /bin/bash
Step 2. Run the following INSIDE the container
$ export LOCATION="SFS in Denver"
$ sleep 1000
Step 3. Run outside the container in another window at the same time
function straceall { | |
sudo strace -f $(pidof "${1}" | sed 's/\([0-9]*\)/-p \1/g') | |
} |