Skip to content

Instantly share code, notes, and snippets.

View PI-Victor's full-sized avatar
🐕
Life is sad without a Yorkie

Victor Palade PI-Victor

🐕
Life is sad without a Yorkie
View GitHub Profile
@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

@PI-Victor
PI-Victor / ks.cfg
Created May 2, 2018 00:24 — forked from aberranthacker/ks.cfg
CentOS 7.2 kickstart file
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Perform the kickstart installation in text mode
text
# X will not be configured
skipx
# Don't run the Setup Agent on first boot
firstboot --disable
@PI-Victor
PI-Victor / command mapping
Last active April 14, 2019 14:51
command to function mapping in go
package main
import (
"context"
"fmt"
)
type ErrCommandNotFound struct {
command string
}

Keybase proof

I hereby claim:

  • I am pi-victor on github.
  • I am pivictor (https://keybase.io/pivictor) on keybase.
  • I have a public key whose fingerprint is 55ED 0FDA 39A2 678C 1DC4 8C5F 8CB3 1C72 BA2F 7028

To claim this, I am signing this object:

node {
// https://registry.hub.docker.com/_/maven/
def maven32 = docker.image('maven:3.2-jdk-7-onbuild');
stage 'Mirror'
// First make sure the slave has this image.
// (If you could set your registry below to mirror Docker Hub,
// this would be unnecessary as maven32.inside would pull the image.)
maven32.pull()
// We are pushing to a private secure docker registry in this demo.

Keybase proof

I hereby claim:

  • I am pi-victor on github.
  • I am codeflavor (https://keybase.io/codeflavor) on keybase.
  • I have a public key ASDoBe20-YVhr2Yrq-y1C0zuXsGJnAce5AwjprNZ5SazAQo

To claim this, I am signing this object: