Skip to content

Instantly share code, notes, and snippets.

View pedes's full-sized avatar
:octocat:
I may be slow to respond.

Andres Cespedes Morales pedes

:octocat:
I may be slow to respond.
View GitHub Profile

What not to do during a presentation

  • good speakers come from persistence.
    • use bad presentations as learning experiences
  • there is always another country or conf
  • don't feel discouraged
  • if you really want to be a better speaker, be open to any and all feedback
  • watch your own talks, you can really improve
  • speaking will open the world up to you
  • you get to meet lots of people that open other opportunities
@pedes
pedes / log4j2.xml
Created August 21, 2019 14:49
Synchronous Logging Configuration
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<!-- Define custom levels before using them for filtering below. -->
<CustomLevels>
<CustomLevel name="DIAG" intLevel="350" />
<CustomLevel name="NOTICE" intLevel="450" />
<CustomLevel name="VERBOSE" intLevel="550" />
</CustomLevels>
<Appenders>
public class MemoryInfoComponent {
private static final long MB = 1048576L;
public static Map<String, String> getMemoryStats() throws Exception {
Runtime rt = Runtime.getRuntime();
MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
long usedMemory = rt.totalMemory() - rt.freeMemory();
Map<String, String> memoryStats = new HashMap<>();
memoryStats.put("JVM total memory", (rt.totalMemory() / 1048576L) + " MB");
memoryStats.put("JVM used memory", (usedMemory / 1048576L) + " MB");
<?xml version="1.0" encoding="utf-8"?>
<!-- DO NOT FORGET TO ADD THE PACKAGES ATTRIBUTE, AND REFERENCE THE SPLUNK PACKAGE -->
<!-- DO NOT FORGET TO ADD THE PACKAGES ATTRIBUTE, AND REFERENCE THE SPLUNK PACKAGE -->
<!-- DO NOT FORGET TO ADD THE PACKAGES ATTRIBUTE, AND REFERENCE THE SPLUNK PACKAGE -->
<Configuration packages="com.mulesoft.ch.logging.appender,com.splunk.logging,org.apache.logging.log4j">
<!--These are some of the loggers you can enable.
There are several more you can find in the documentation.
Besides this log4j configuration, you can also use Java VM environment variables
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>write-project-properties</goal>
</goals>
asyncapi: 2.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
servers:
development:
url: development.gigantic-server.com
description: Development server
protocol: amqp
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors/>
<proxies>
<proxy>
# Steps for executing the deployment against Cloudhub Anypoint Platform
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
// Comment for DW, how to extract the original HTTP error using until succesful
{
statusCode: error.exception.cause.cause.cause.errorMessage.attributes.statusCode,
reason: error.exception.cause.cause.cause.errorMessage.attributes.reasonPhrase,
message: error.exception.cause.cause.cause.errorMessage.typedValue,
service: error.exception.cause.cause.cause.detailMessage
}

maven-survival-guide

Code and walkthrough for the talk "Apache Maven survival guide “Bring it on! -Mode” #no-external-tools #only-standard-plugins"

Walkthrough

Level 0: verify the project

mvn verify

Level 1: add some tests and make them run