Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Hacking some Open Source

Alberto Flores albertoaflores

💭
Hacking some Open Source
View GitHub Profile
@albertoaflores
albertoaflores / activemq.xml
Created Dec 3, 2019
Custom ActiveMQ configuration
View activemq.xml
<!--
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 Nov 30, 2019
Generates a TaskExecutor to control the threads used in a given @async
View PayloadGeneratorConfiguration.java
@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 Nov 30, 2019
Using Async to force multiple threads to create payloads.
View PayloadGenerator.java
@Async("myThreadPoolTaskExecutor")
public Object createPayload() {
// return payload pojo
}
@albertoaflores
albertoaflores / .bash_profile
Created Feb 17, 2019
Sample PS1 Configuration
View .bash_profile
function get_emoji() {
if [ $? -eq 0 ]; then
echo '👍🏻'
else
echo '👎🏻'
fi
}
# get current branch in git repo
function parse_git_branch() {
View 0006-add-mailchimp-as-default-contact-me-page-provider.md
@albertoaflores
albertoaflores / bootstrap.yml
Last active Apr 22, 2017
Sample bootstrap.yml file for Spring Boot application that decrypts properties in the client side.
View bootstrap.yml
spring:
application:
name: survey-service
cloud:
config:
uri: http://localhost:8888
label: 1.0.0
encrypt:
keyStore:
@albertoaflores
albertoaflores / config-server-application.yml
Created Apr 21, 2017
Sample Config Server (boot) configuration in YML format.
View config-server-application.yml
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 Apr 21, 2017
Creates a key using JDK's keytool. It's used to encrypt/decrypt values.
View create-sample-key-file.sh
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 Apr 21, 2017
Sample Spring Cloud Config Server
View ConfigServerApplication.java
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 {