Skip to content

Instantly share code, notes, and snippets.

package com.paulbrodner.buddy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
#!/usr/bin/env bash
# change region here
REGIONS=(eu-west-1 us-east-1)
for region in "${REGIONS[@]}"; do
echo "Resources with no tags in region: $region"
export AWS_DEFAULT_REGION=$region
aws resourcegroupstaggingapi get-resources | jq '.ResourceTagMappingList' | jq '.[] | select((.Tags|length) == 0) | {resource: .ResourceARN }'
done
@paulbrodner
paulbrodner / docker-compose.yml
Last active March 19, 2019 09:43
starting prometeus and graphana
version: '2'
services:
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
//setup
//hide
[source,cypher]
----
CREATE (neo:Database {name:'Neo4j'})
CREATE (neo)-[:SUPPORTS]->(:Language {name:'Cypher'})
----
@paulbrodner
paulbrodner / Makefile
Last active August 20, 2021 10:53
Makefile example
help: ## debian
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep
help: ## output this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##|[a-zA-Z_-]\.?+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
# transform image.jpg into base64
openssl base64 -in image.jpg -out base64.txt
<img src="data:image/jpeg;base64, base64.txt-content"/>
@paulbrodner
paulbrodner / tas-example.java
Created January 10, 2019 16:05
Example of T.A.S DSL used for writing tests
// https://paulbrodner.github.io/2019/tas
public class CmisWorkshopDemo extends CmisTest
{
/**
* As an engineer I want to create a new random test user
* I want to use that user to defined a new random site
* And using CMIS protocol, to create a folder
*
*/
@Test(groups="techTalk")
@paulbrodner
paulbrodner / cheat-sheets.md
Created December 21, 2018 08:39
cheat-sheets
@paulbrodner
paulbrodner / pom.xml
Last active December 18, 2018 09:29
get latest plugin versions available
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
@paulbrodner
paulbrodner / pom.xml
Created December 17, 2018 11:28
start docker-compose in pom.xml
<profile>
<id>acs-deployment</id>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.3.0</version><!-- 1.4.0 gives class not found issues with "CachedFileEntry": https://github.com/maven-download-plugin/maven-download-plugin/issues/80 -->
<executions>
<execution>