Skip to content

Instantly share code, notes, and snippets.

@juanromanf
juanromanf / RedisConfig.java
Created May 25, 2023 20:26
Spring Boot Redis Cache Serialization Configurarion
private RedisCacheConfiguration redisCacheConfigurationTemplate(long ttlInSecs) {
StringRedisSerializer keysSerializer = new StringRedisSerializer();
RedisSerializer<Object> valuesSerializer = new JdkSerializationRedisSerializer();
Duration ttl = Duration.ofSeconds(ttlInSecs);
return RedisCacheConfiguration.defaultCacheConfig()
.disableCachingNullValues()
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(keysSerializer))
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(valuesSerializer))
{
"basics": {
"name": "Juan Román",
"label": "Senior Software Engineer | Software Architect",
"image": "https://registry.jsonresume.org/juanromanf.qr.png",
"summary": "I’m a software engineer working on IT since 2008 with hands-on experience across a few industries like fintech, travel, freight transport and health care, mostly with architectures based on Java + Spring technologies.\n Advocate of good practices on software development, strong knowledge on all software development life cycle (SDLC), also with well founded skills in designing, building, deploying and supporting complex mission critical backend systems based on microservices architectures using containers, service orchestrators, queues, api gateways, SQL databases and NoSQL databases.",
"location": {
"countryCode": "CO",
"address": "Bogotá DC"
},
@juanromanf
juanromanf / TcpClientFactory.java
Created December 7, 2020 14:49
Spring Boot WebClient Factory and Request/Response Logs
package com.iatai.core.auth.rest.infrastructure;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOption;
import io.netty.handler.logging.LoggingHandler;
import io.netty.handler.timeout.ReadTimeoutHandler;
import io.netty.handler.timeout.WriteTimeoutHandler;
import reactor.netty.channel.BootstrapHandlers;
import reactor.netty.http.client.HttpClient;

Installing docker

Set up the repository

Install packages to allow apt to use a repository over HTTPS:

  $ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
@juanromanf
juanromanf / ubuntu-docker-install.sh
Created December 7, 2018 15:13
This script install docker and docker compose on ubuntu using the edge channel.
# Environment variables you need to set so you don't have to edit the script below.
export DOCKER_CHANNEL=edge
export DOCKER_COMPOSE_VERSION=1.23.2
# Update the apt package index.
sudo apt-get update
# Install packages to allow apt to use a repository over HTTPS.
sudo apt-get install -y \
apt-transport-https \
@juanromanf
juanromanf / nginx.conf
Created March 19, 2018 14:24 — forked from mjurincic/nginx.conf
Setup NodeJS Production with PM2, Nginx on AWS Ubuntu 16.04 server
proxy_http_version 1.1;
proxy_set_header Connection "";
https://gist.github.com/miguelmota/6912559
# The upstream module is the link between Node.js and Nginx.
# Upstream is used for proxying requests to other servers.
# All requests for / get distributed between any of the servers listed.
upstream helloworld {
# Set up multiple Node.js webservers for load balancing.
# max_fails refers to number of failed attempts
# before server is considered inactive.
# Autor de commits en los repositorios
$ git config --global user.name "Your Name"
$ git config --global user.email "your@email.com"
# Repositorio remoto
$ git clone <ruta al repositorio> # Clonar y hacer checkout del HEAD de la rama actual
$ git pull # Recibir los cambios desde el repositorio
#Es equivalente a:
$ git fetch # Trae los cambios