Skip to content

Instantly share code, notes, and snippets.

@blachniet
blachniet / k8s-deploy-exec.yml
Created August 12, 2023 13:13
Execute command in Kubernetes Deployment with Ansible
---
# This playbook queries Kubernetes to find a pod within a playbook and then
# runs a commnad within one of those pods. This is essentially the Ansible
# way to perform the following kubectl command:
#
# kubectl exec -n keycloak deploy/postgres -- psql -U postgres -c '\l'
#
- hosts: localhost
tasks:
package main
import (
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"os"

Linode Notes

Tasks

Create non-root user

Create a non-root user in a brand-new Linode. This assumes that you want to use the same SSH key to login with the new user, and that you want that user to have sudo power.

ssh root@
@blachniet
blachniet / k8s.conf
Created May 21, 2020 03:52
Ansible playbook to install Minikube on a VM with the "none" driver. Add your inventory in a file named `hosts`, then execute the playbook with `ansible-playbook --ask-become-pass -i hosts ./playbook.yml`
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
using System;
using System.Collections.Generic;
using System.Threading;
using k8s;
using k8s.Models;
namespace k8s_job_launcher
{
class Program
{
@blachniet
blachniet / Dockerfile
Created February 15, 2020 12:57
Build libogg and liboggz in Docker containers
FROM golang:buster AS oggzit-build
WORKDIR /go/src/oggzit
COPY . .
RUN go install -v ./...
FROM debian:buster AS oggz-install
WORKDIR /root
RUN apt-get update && apt-get install -y \
@blachniet
blachniet / ConfluentKafkaProducerHangsOnFlush.cs
Last active October 21, 2019 19:59
The Confluent.Kafka C# producer hangs indefinitely when the target partition has no leader. See https://github.com/confluentinc/confluent-kafka-dotnet/issues/1027
using System;
using System.Threading.Tasks;
using Confluent.Kafka;
namespace my_producer
{
class Program
{
static void Main(string[] args)
{