Skip to content

Instantly share code, notes, and snippets.

View albertoaflores's full-sized avatar
💭
Hacking some Open Source

Alberto Flores albertoaflores

💭
Hacking some Open Source
View GitHub Profile
@albertoaflores
albertoaflores / activemq.xml
Created December 3, 2019 23:48
Custom ActiveMQ configuration
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@albertoaflores
albertoaflores / PayloadGeneratorConfiguration.java
Created November 30, 2019 12:37
Generates a TaskExecutor to control the threads used in a given @async
@Bean(name = "myThreadPoolTaskExecutor")
public TaskExecutor threadPoolTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(4);
executor.setMaxPoolSize(4);
executor.setThreadNamePrefix("executor");
executor.initialize();
return executor;
}
@albertoaflores
albertoaflores / PayloadGenerator.java
Created November 30, 2019 12:30
Using Async to force multiple threads to create payloads.
@Async("myThreadPoolTaskExecutor")
public Object createPayload() {
// return payload pojo
}
@albertoaflores
albertoaflores / .bash_profile
Created February 17, 2019 02:37
Sample PS1 Configuration
function get_emoji() {
if [ $? -eq 0 ]; then
echo '👍🏻'
else
echo '👎🏻'
fi
}
# get current branch in git repo
function parse_git_branch() {
@albertoaflores
albertoaflores / 0006-add-mailchimp-as-default-contact-me-page-provider.md
Last active April 28, 2017 10:22
Sample page that supercedes another ADR
@albertoaflores
albertoaflores / bootstrap.yml
Last active April 22, 2017 15:05
Sample bootstrap.yml file for Spring Boot application that decrypts properties in the client side.
spring:
application:
name: survey-service
cloud:
config:
uri: http://localhost:8888
label: 1.0.0
encrypt:
keyStore:
@albertoaflores
albertoaflores / config-server-application.yml
Created April 21, 2017 20:50
Sample Config Server (boot) configuration in YML format.
server:
port: 8888
spring:
cloud:
config:
server:
encrypt:
enabled: false
git:
uri: ${HOME}/workspace/configuration/sample-boot-demo-configuration
@albertoaflores
albertoaflores / create-sample-key-file.sh
Created April 21, 2017 20:44
Creates a key using JDK's keytool. It's used to encrypt/decrypt values.
ALIAS_NAME="mytestkey"
KEYSTORE_SECRET="changeme"
KEYSTORE_PASSWORD="letmein"
VALIDITY_TIME=365
echo "Creating server key, valid for $VALIDITY_TIME days"
keytool -genkeypair -alias $ALIAS_NAME -keyalg RSA \
-dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=US" \
-keypass $KEYSTORE_SECRET -keystore server.jks -storepass $KEYSTORE_PASSWORD \
-validity $VALIDITY_TIME
@albertoaflores
albertoaflores / ConfigServerApplication.java
Created April 21, 2017 20:30
Sample Spring Cloud Config Server
package io.cybertech.boot.sample;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@SpringBootApplication
@EnableConfigServer
public class ConfigServerApplication {