Skip to content

Instantly share code, notes, and snippets.

View mmaia's full-sized avatar
🎯
Focusing

Marcos mmaia

🎯
Focusing
  • Bitvavo
  • Netherlands
View GitHub Profile
@mmaia
mmaia / Very quick localhost kubernetes start
Last active April 4, 2024 15:22
Quick start guide to running Kubernetes localhost for development. A.K.A. -> No BS guide to local Kubernetes.
# Install the following on your machine
1. [Docker](https://docs.docker.com/get-docker/)
- Test with `docker version`
2. [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
- Test with: `kubectl version`
3. [kind](https://kubernetes.io/docs/tasks/tools/#kind)
- Test with: `kind version`
@mmaia
mmaia / kafka_ref.md
Last active May 25, 2019 12:38
tips, tricks and common errors with kafka and spring-kafka

Schema registry console-consumer exception

  • When using ./usr/bin/kafka-avro-console-consumer an exception happens with trace like:
ERROR Unknown error when running consumer:  (kafka.tools.ConsoleConsumer$)
org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id 2
Caused by: java.net.ConnectException: Connection refused (Connection refused)

@mmaia
mmaia / Springboot quick tips.md
Last active April 15, 2019 21:22
Spring boot tricks

Programatically get a spring bean

package io.stockgeeks.metrics;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
@mmaia
mmaia / SQL.md
Last active October 3, 2018 13:58
@mmaia
mmaia / certificates.md
Last active July 9, 2018 12:29
convert certificates between different formats using openssl

PEM Format

The PEM format is the most common format that Certificate Authorities issue certificates in. PEM certificates usually have extentions such as .pem, .crt, .cer, and .key. They are Base64 encoded ASCII files and contain "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" statements. Server certificates, intermediate certificates, and private keys can all be put into the PEM format.

Apache and other similar servers use PEM format certificates. Several PEM certificates, and even the private key, can be included in one file, one below the other, but most platforms, such as Apache, expect the certificates and private key to be in separate files.

@mmaia
mmaia / Aforisms.md
Last active May 21, 2019 21:59
Collection of aforisms I like

Everything we hear is an opinion, not a fact. Everything we see is a perspective, not the truth.

Marcus Aurelius

Nothing will bring you peace, you must bring yourself to it.

Gant Laborde

The Greatest enemy of knowledge is not ignorance, it is the illusion of knowledge.

Stephen Hawking

A business that makes nothing but money is a poor business.

@mmaia
mmaia / sync_with_upstream.md
Last active May 30, 2018 11:10
Force local forked repo to be exactly like upstream

WARNING: This will override any local custom changes made to the repository and replace it's contents to be exactly like the upstream repo, use git remote -v to check the origin and upstream repos, the origin will be replaced to be identical with the upstream.

git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force

Initially to set the upstream the following command was used:

@mmaia
mmaia / local-config.yml
Last active March 18, 2018 10:13
ansible-playbook to configure local workstation when Ubuntu linux is installed(tested with 16.04 LTS desktop). Run with: `ansible-playbook local-config.yml --extra-vars "ansible_sudo_pass=$SUDO_PWD`"
---
- name: configure local machine sudo
hosts: localhost
sudo: yes
tasks:
- name: ensure up to date O.S
command: apt -y update
- name: install base packages
@mmaia
mmaia / zshcustom_file.zsh
Last active May 31, 2022 07:47
my generic zsh custom file
#!/bin/zsh
echo "--------------- Loading mmaia.zsh functions----------------"
function idea() {
find ~/.local/share/JetBrains/Toolbox/apps/IDEA-U -name "idea.sh" -exec chmod +x {} \; -exec {} $1 \; >/dev/null 2>&1 &
}
function reload() {
source ~/.zshrc
}