Skip to content

Instantly share code, notes, and snippets.

View misTrasteos's full-sized avatar

Álvar Torres misTrasteos

  • Madrid, Spain
View GitHub Profile
@misTrasteos
misTrasteos / Dockefile
Created July 25, 2021 11:22
Redis distroless Docker image
ARG GCC_VERSION=11
FROM gcc:${GCC_VERSION} AS builder
ARG REDIS_VERSION=stable
# from https://redis.io/topics/quickstart
RUN wget https://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz && \
tar xvzf redis-${REDIS_VERSION}.tar.gz && \
cd redis-${REDIS_VERSION} && \
@misTrasteos
misTrasteos / Volumenes con Kubernetes y Kind.md
Last active October 7, 2023 22:30
PersistentVolume en Kubernetes con Kind

Volumenes con Kubernetes y Kind

Esto es una prueba de concepto de cómo funcionan los PersistentVolume en kubernetes. Creo un PersistentVolume y a partir de un PersistentVolumeClaim lo comparto entre dos contenedores. Un contenedor (aplicación java) escribe texto en el volumen. Mientras que el otro contenedor(un nginx) publica el contenido del volumen. He utilizado Kind.

Kind cluster

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
 extraMounts:
@misTrasteos
misTrasteos / README.md
Last active May 8, 2023 12:15
Self hosted Apache Maven repository, Reposilite, PoC

What is this ?

This is a PoC of running a self hosted Apache Maven Repository, Reposilite, and use it as a distribution management.

Just running the usual mvn clean deploy, but deploy the jar into Reposilite.

All Apache Maven commands will run inside the Apache Maven Docker image

Components

Docker Network

Building Maven containers needs to 'see' Reposilite ones. So we are going to create a network so as to all containers can see each other.

@misTrasteos
misTrasteos / git_cheat_sheet.md
Last active October 26, 2022 11:39
Git cheat sheet

git config

alias

git config --global alias.l 'log --oneline'

git commit

--amend Replace the tip of the current branch by creating a new commit

--allow-empty

-a, --all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

@misTrasteos
misTrasteos / README.md
Created October 8, 2022 19:48
remove password from [a lot of ]pdf files
  • I am using Ubuntu latest

docker run --rm --name pdfs -it -v /pdfs:/pdfs -w /pdfs ubuntu:latest

  • Install pdftk
apt-get update
apt-get upgrade
apt-get install pdftk
@misTrasteos
misTrasteos / playbook.yaml
Created April 27, 2022 19:21
Ansible dynamic inventory add_host example
# ansible-playbook -e new_machine_name=new_machine playbook.yaml
---
- name: "Provision machine"
hosts: "localhost"
tasks:
- name: "Create machine ..."
docker_container:
name: "{{ new_machine_name }}"
hostname: "{{ new_machine_name }}"
command: ["sleep", "infinity"]
@misTrasteos
misTrasteos / lichesAPI.md
Last active April 22, 2022 09:00
Lichess API

How to ...

... export games of a user

Official Docs

curl --location --request GET 'https://lichess.org/api/games/user/{USER}?max=1&analysed=true&clocks=true&evals=true&opening=true&literate=true' \
--header 'Authorization: Bearer {PAT}'

Install latest version

Ubuntu

sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git

commit

empty commits

@misTrasteos
misTrasteos / prometheus.yaml
Created April 4, 2022 15:45
Prometheus in k8s example
apiVersion: v1
kind: Service
metadata:
name: prometheus-service
spec:
ports:
- name: http
port: 9090
targetPort: 9090
selector:
@misTrasteos
misTrasteos / TwitterSerialExample.java
Created March 3, 2022 07:05
Twitter Serial example
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17
//DEPS com.twitter.serial:serial:0.1.6
/// https://github.com/twitter/Serial
import java.io.IOException;