Skip to content

Instantly share code, notes, and snippets.

View rm3l's full-sized avatar
💭
I may be slow to respond.

Armel Soro rm3l

💭
I may be slow to respond.
View GitHub Profile
@jerieljan
jerieljan / How I Do PlantUML.md
Last active January 1, 2024 06:23
PlantUML with Style -- How I do PlantUML

I use PlantUML a lot. It's what I use for drawing all sorts of diagrams and it's handy because of its easy markup (once you get used to it) while making things easy to maintain as projects grow (thanks to version control)

This gist explains how I do my PlantUML workspace in a project.

  • The idea is to keep a globals directory for all diagrams to follow (like the "stylesheet" below) to keep things consistent.
  • I use a stylesheet.iuml file that keeps the use of colors consistent through use of basic FOREGROUND, BACKGROUND and ACCENT colors.
  • The style-presets.iuml file defines these colors so you can make "presets" or "themes" out of them.
  • As stated in the stylesheet.iuml, you'll need the Roboto Condensed and Inconsolata fonts for these to work properly.
  • You can choose to either run the PlantUML jar over your file/s, or use an IDE like VSCode with the PlantUML extension. Here's a preview of example-sequence.puml for example: https://imgur.com/Klk3w2F
import org.junit.contrib.java.lang.system.internal.CheckExitCalled;
import org.junit.contrib.java.lang.system.internal.NoExitSecurityManager;
import org.junit.jupiter.api.extension.*;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
import org.junit.jupiter.api.extension.ExtensionContext.Store;
import org.junit.platform.commons.support.ReflectionSupport;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@carlosedp
carlosedp / gist:5040f4a1b2c97c1fa260a3409b5f14f9
Created February 19, 2018 20:01
Reset Kubernetes cluster with Weave
# Drain and delete the nodes (for each node you have)
kubectl drain kubenode1 --delete-local-data --force --ignore-daemonsets
kubectl delete node kubenode1
# Reset the deployment
sudo kubeadm reset
# On each node
## Reset the nodes and weave
@ipan
ipan / diff-jq.md
Created January 16, 2018 04:47
compare two JSONs with jq #json #jq
cd k8s-specs
git pull
minikube start --vm-driver=virtualbox
kubectl config current-context
cat svc/go-demo-2-rs.yml
minikube start --vm-driver=virtualbox
kubectl config current-context
cd k8s-specs
git pull
cat rs/go-demo-2.yml
# Source: https://gist.github.com/d860631d0dd3158c32740e9260c7add0
minikube start --vm-driver=virtualbox
kubectl get nodes
git clone https://github.com/vfarcic/k8s-specs.git
cd k8s-specs
#################
# Only if MacOS #
#################
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/darwin/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
@pditommaso
pditommaso / sync.groovy
Created August 2, 2017 23:18
Prevent multiple JVM to access concurrently the same file
import java.nio.channels.FileLock
final file = new RandomAccessFile(new File("foo.lock"), "rw")
println "<Entering in critical section>"
try {
/*
* wait to acquire a lock
*/
def secs = 0
FileLock lock
@meirbon
meirbon / Dell XPS 15 9560 Manjaro Setup instructions
Last active March 31, 2024 01:21
Small, quick guide to set up Manjaro on the XPS 15 9560
# 1. First of all of course get Manjaro:
https://manjaro.org/get-manjaro/
# I recommend using Etcher to copy the image to your USB:
https://etcher.io/
# 2. Before installing make sure:
# - Secure boot is disabled in BIOS
# - Your SSD, HDD or NVME drive is set to AHCI instead of RAID
# - Fastboot should be on Auto or minimal, but this shouldn't matter to much