Skip to content

Instantly share code, notes, and snippets.

@xandout
xandout / README.md
Last active October 17, 2024 07:54
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

@wudi
wudi / dynamic_router.go
Last active February 8, 2023 16:53
Dynamic Router for Gin
package main
import (
"net/http"
"sync"
"time"
"github.com/gin-gonic/gin"
)
@arthurk
arthurk / gist:ab9ced56ce78bb8309599ccc62fa2576
Created June 1, 2020 03:50
fetch list images from GCR via service account
#!/usr/bin/env bash
set -euo pipefail
######################
# Script that fetches a list of all images from GCR
# uses 3 different users in GCR
######################
keyfile="gcr-svc-acc-keyfile.json"
projectName="example-project"
@L04DB4L4NC3R
L04DB4L4NC3R / arch_std_install.md
Created May 16, 2020 13:10
ArchLinux Standard Installation

Installing Arch the Standard Way


Create a bootable pendrive

Run lsblk to see what is your pendrive

dd if= of=/dev/sd status="progress"
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@dkhode
dkhode / jenkins-set-system-message.groovy
Created May 7, 2020 03:45
Jenkins - Set Jenkins system message via groovy script - #jenkins #groovy #system #message #html
#!groovy
// imports
import jenkins.model.Jenkins
// parameters
def systemMessage = '''
<h1><span style="background-color: #ff0000">Scheduled maintanence: Jenkins won't be available for use tonight @7pm CST</span></h1>
'''
@bric3
bric3 / SSLPoke.java
Created February 10, 2020 07:17
The famous SSLPoke from Atlassian : establish a TLS connection but support http proxy and updated to Java 11
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
@cormullion
cormullion / hilbert-animation.jl
Created January 31, 2020 09:04
hilbert animation
using Luxor, Colors
function hilbert(pointslist::Array{Point, 1},
start::Point, unitx::Point, unity::Point, depth)
if depth <= 0
push!(
pointslist,
Point(start.x + (unitx.x + unity.x)/2, start.y + (unitx.y + unity.y)/2))
else
hilbert(pointslist, start,
@IanColdwater
IanColdwater / twittermute.txt
Last active March 8, 2026 00:11
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@aarongorka
aarongorka / gitlab_dag_diagram.py
Last active April 30, 2021 12:33
Prints a PlantUML diagram that shows the DAG of the GitLab pipeline
#!/usr/bin/env python3
"""Prints a PlantUML diagram that shows the DAG of the GitLab pipeline"""
import sys
import yaml
from pprint import pprint
def merge(user, default):
if isinstance(user,dict) and isinstance(default,dict):
for k,v in default.items():