Skip to content

Instantly share code, notes, and snippets.

View anderson-custodio's full-sized avatar

Anderson Custódio anderson-custodio

View GitHub Profile
# Install these packages (use your favorite AUR tool here)
yay -S minikube kubectl docker-machine-driver-kvm2 libvirt qemu-headless ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@anderson-custodio
anderson-custodio / conditional-image-repository.md
Last active May 31, 2019 16:16
Helm: Choose image conditionally

How to conditionally choose an image in Helm

If you want to choose an image based on a condition, you can do it with the following example:

values.yaml

image:
  repository: my-docker-repo/my-image
  tag: "latest"
  pullPolicy: Always
@anderson-custodio
anderson-custodio / profiling-jvm-kubernetes-visualvm.md
Last active January 23, 2024 13:41
Profiling JVM on Kubernetes using VisualVM

Profiling JVM on Kubernetes using VisualVM

Enable JMX server

Edit Dockerfile to enable JMX server and change the hostname with the IP where the container will run:

FROM openjdk:8-jre-alpine
ADD ./target/app.jar app.jar
EXPOSE 8080
ENTRYPOINT java -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=192.168.1.2 -jar app.jar

Linux useful commands

Print file with line number:

cat -n notes.sh

Write to file replacing all content:

echo "foo" > teste.txt

Write to file appending the content:

echo "foo" >> teste.txt

@anderson-custodio
anderson-custodio / python_virtualenv.md
Last active December 10, 2018 16:28
How to install virtualenv

1. How to install virtualenv:

1.1. Install pip

  sudo apt install python3-pip

1.2. Install virtualenv:

 pip3 install virtualenv