Skip to content

Instantly share code, notes, and snippets.

View PI-Victor's full-sized avatar
🌞
All that is gold does not glitter, Not all those who wander are lost

Victor Palade PI-Victor

🌞
All that is gold does not glitter, Not all those who wander are lost
View GitHub Profile

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@PI-Victor
PI-Victor / gist:b0b7337836859d4e3103a7ff70c713ca
Created June 3, 2020 11:14
remove gnome shit shortcuts
for i in {1..9}; do gsettings set "org.gnome.shell.keybindings" "switch-to-application-$i" "[]"; done
Ubuntu:
docker run -v $(pwd):/app -w /app -ti ubuntu:19.04 /bin/bash
clone https://github.com/davatorium/rofi/releases
clone and install https://github.com/libcheck/check/releases
apt-get update && apt-get install -y wget gcc make bison flex libxkbcommon-dev gir1.2-glib-2.0 libglib2.0-dev libx11-xcb1 libxcb-xinerama0-dev libxcb-xinerama0-dev libxcb-util-dev libxcb-randr0 libxcb-randr0-dev libxcb-xrm-dev libxkbcommon-x11-dev libxcb-ewmh-dev libxcb-icccm4-dev libpango1.0-dev libstartup-notification0-dev librsvg2-dev librsvg2-dev
./configure
@PI-Victor
PI-Victor / gist:2129291db55a766a804f44e7ee31de10
Created October 16, 2019 12:48
disable docker iptables for internet exposed interface
iptables -N DOCKER-USER
iptables -I FORWARD -j DOCKER-USER
iptables -A DOCKER-USER -j RETURN
iptables -I DOCKER-USER -i br0 ! -s 192.168.1.1 -j DROP
@PI-Victor
PI-Victor / override.conf
Created July 27, 2019 10:36
Override cgroup docker driver
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --exec-opt native.cgroupdriver=systemd
@PI-Victor
PI-Victor / gist:189a0b3d52f96d64d3fdf7829d99ded0
Created July 15, 2019 12:38 — forked from Vince-Cercury/gist:43c7afc1a6b0f580b0cb6fb27e650042
How to monitor an external secure etcd cluster with Prometheus Operator
# How to monitor a secure external etcd service with Prometheus Operator
This guide will help you monitor an external etcd cluster. When the etcd is not hosted inside Kubernetes.
This is often the case with the Kubernetes setup. This has been tested with kube-aws but same principals will apply to other tools.
# Step 1 - Make the etcd certificates available to Prometheus pod
Prometheus Operator (and Prometheus) allow us to specify a tlsConfig. This is required as most likely your etcd metrics end points is secure.
## a - Create the secrets in the namespace
Prometheus Operator allows us to mount secrets in the pod. By loading the secrets as files, they can be made available inside the Prometheus pod.
@PI-Victor
PI-Victor / gist:590c924d6cbc1f0491a64d2b17f79773
Created March 5, 2019 13:07
gtk minimize titlebar headers
original https://unix.stackexchange.com/questions/257163/reduce-title-bar-height-in-gnome-3-gtk-3
After Gnome 3.20, .header-bar.default-decoration doesn't work.
You can put follow content into ~/.config/gtk-3.0/gtk.css:
/* shrink headerbars (don't forget semicolons after each property) */
headerbar {

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@PI-Victor
PI-Victor / !readme.md
Created June 13, 2018 20:48 — forked from dougbtv/!readme.md
You had ONE JOB -- A Kubernetes job.

You had ONE JOB -- A Kubernetes job.

Let's take a look at how Kubernetes jobs are crafted. I had been jamming some kind of work-around shell scripts in the entrypoint* for some containers in the vnf-asterisk project that Leif and I have been working on. And that's not perfect when we can use Kubernetes jobs, or in their new parlance, "run to completion finite workloads" (I'll stick to calling them "jobs"). They're one-shot containers that do one thing, and then end (sort of like a "oneshot" of systemd units, at least how we'll use them today). I like the idea of using them to complete some service discovery for me when other pods are coming up. Today we'll fire up a pod, and spin up a job to discover that pod (by querying the API for info about it), and put info into etcd. Let's get the job done.

This post also exists as a [gist on github](https

@PI-Victor
PI-Victor / !readme.md
Created June 13, 2018 20:48 — forked from dougbtv/!readme.md
You had ONE JOB -- A Kubernetes job.

You had ONE JOB -- A Kubernetes job.

Let's take a look at how Kubernetes jobs are crafted. I had been jamming some kind of work-around shell scripts in the entrypoint* for some containers in the vnf-asterisk project that Leif and I have been working on. And that's not perfect when we can use Kubernetes jobs, or in their new parlance, "run to completion finite workloads" (I'll stick to calling them "jobs"). They're one-shot containers that do one thing, and then end (sort of like a "oneshot" of systemd units, at least how we'll use them today). I like the idea of using them to complete some service discovery for me when other pods are coming up. Today we'll fire up a pod, and spin up a job to discover that pod (by querying the API for info about it), and put info into etcd. Let's get the job done.

This post also exists as a [gist on github](https