Skip to content

Instantly share code, notes, and snippets.

View Frodox's full-sized avatar
🎯
Focusing

Vitaly Rybnikov Frodox

🎯
Focusing
View GitHub Profile
@innovia
innovia / kubernetes_add_service_account_kubeconfig.sh
Last active January 29, 2024 23:00
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@StevenACoffman
StevenACoffman / _MicroService Proxy Gateway Solutions.md
Last active July 15, 2024 05:12
Microservice Proxy/Gateway Solutions

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from March 2, 2019

Originally, I had included some other solution

@scriptum
scriptum / tumbler.rc
Created March 4, 2017 07:12
/etc/xdg/tumbler/tumbler.rc
###
# [TypeNameOfPlugin]
# Disabled: Set to true to avoid loading the plugin. By default all
# plugins are loaded.
# Priority: Priority of the plugin if more plugins support the same
# uri-scheme / mime-type combination.
# Locations: ;-separated path list the plugin will be used in. If the
# source file is not a child of one of the locations, the
# plugin won't be used and another plugin with a lower
# priority will be tried.
# bc with trigonometry and useful functions
bc() {
/usr/bin/bc -qli <(echo '
scale=32
pi=4*a(1)
e=e(1)
scale=20
define sin(x) {
return (s(x))
}
@mixja
mixja / Dockerfile
Last active September 17, 2019 11:06
Docker Health Check using Make
FROM nginx
HEALTHCHECK --interval=3s --retries=20 CMD curl -fs http://localhost:${HTTP_PORT:-8000}
class Plugin extends \Phile\Plugin\AbstractPlugin
{
protected $events = ['request_uri' => 'startup'];
public function startup($data)
{
if ($data['uri'] === 'foo') {
// matches URL
$this->doStuffOnFoo();
exit();
@scriptum
scriptum / tower.c
Created June 22, 2015 18:44
Towers
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
typedef struct { int *x, n; } tower;
tower *new_tower(int cap)
{
tower *t = calloc(1, sizeof(tower) + sizeof(int) * cap);
t->x = (int*)(t + 1);
return t;
@ThatRendle
ThatRendle / explanation.md
Last active July 3, 2022 07:56
Why I was previously not a fan of Apache Kafka

Update, September 2016

OK, you can pretty much ignore what I wrote below this update, because it doesn't really apply anymore.

I wrote this over a year ago, and at the time I had spent a couple of weeks trying to get Kafka 0.8 working with .NET and then Node.js with much frustration and very little success. I was rather angry. It keeps getting linked, though, and just popped up on Hacker News, so here's sort of an update, although I haven't used Kafka at all this year so I don't really have any new information.

In the end, we managed to get things working with a Node.js client, although we continued to have problems, both with our code and with managing a Kafka/Zookeeper cluster generally. What made it worse was that I did not then, and do not now, believe that Kafka was the correct solution for that particular problem at that particular company. What they were trying to achieve could have been done more simply with any number of other messaging systems, with a subscriber reading messages off and writing

@scriptum
scriptum / matrix.sh
Created December 16, 2014 11:36
Matrix
tr -c "[:alnum:]" " " < /dev/urandom | fold -w$COLUMNS | GREP_COLOR="1;32" grep --color .
@scriptum
scriptum / pdfoptimize.sh
Created November 25, 2014 14:20
PDF optimization script
for f in "$@"
do
TMP=$(mktemp)
SIZE_OLD=$(wc -c < "$f")
echo "Optimizing '$f' of size $SIZE_OLD"
/usr/bin/gs \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook \
-dNOPAUSE \