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
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.6.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
// 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

@pedes
pedes / Linux-Commands-Cheatsheet.md
Last active February 17, 2023 12:15
Most common and useful Linux commands
Command Description
uname -a Shows the current kernel and OS information
sudo Executes the command as root (Administrator)

Performance Benchmark test for Mule App over HTTPS

Specs

  • Simple PUT request with a JSON payload with 2 strings
  • 1 Flow
  • HTTPS with p12 Keystore using a RSA public certificate 2048 bits key
  • Running on MacBook Pro (16-inch, 2019), 2,4 GHz 8-Core Intel Core i9, 64 GB 2667 MHz DDR4
  • Java 8 openjdk version 1.8.0_312
  • Using ab apache benchmark, more details at https://httpd.apache.org/docs/2.4/programs/ab.html
  • data: ```{
{
"keys" : ["type", "source", "openFlightsAirportId"]
}