Skip to content

Instantly share code, notes, and snippets.

View stefanprodan's full-sized avatar
🎯
Hacking on @fluxcd and timoni.sh

Stefan Prodan stefanprodan

🎯
Hacking on @fluxcd and timoni.sh
View GitHub Profile
@fragolinux
fragolinux / k3d_local_git.sh
Last active April 18, 2023 14:47
complete setup of a local k3d cluster on macos with flux enabled on local git server
#!/usr/bin/env bash
set -m # enable job control
## run with "-d" command line switch to debug each step, script will wait for keypress to go on
## integrated mods by KingdonB in his fork: https://gist.github.com/kingdonb/dec74f3b74ffbb83b54d53d5c033e508
## added proper coredns patching via "coredns-custom" configmap
## added automatic /etc/hosts file modification if needed, sudo password will be asked in case
## added (commented out) lines to add Flux extra controllers to the setup
## deployed podinfo as in Flux Get Started guide
@sylr
sylr / deployment.yaml
Created November 4, 2020 16:10
kustomize-controller
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "8"
creationTimestamp: "2020-11-02T14:42:53Z"
generation: 8
labels:
app.kubernetes.io/instance: flux
app.kubernetes.io/version: latest
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@mtchavez
mtchavez / disk-check.json
Last active September 27, 2020 17:56
Consul Nagios Example Checks
{
"check": {
"id": "check-disk",
"name": "check-disk",
"script": "/usr/lib/nagios/plugins/check_disk -w 30% -c 5%",
"interval": "1m"
}
}
@dyoung522
dyoung522 / add_static_route.sh
Created January 8, 2015 19:01
Add a permanent static route to OS X 10.10
#!/bin/bash
sudo /sbin/route add -net x.x.x.0/24 xxx.xxx.xxx.xxx
# Save this file somewhere and make it executable (chmod a+x <file>)
# Then run 'sudo defaults write com.apple.loginwindow LoginHook /Path/To/Your/Script'
@tonymtz
tonymtz / gist:d75101d9bdf764c890ef
Last active May 7, 2024 13:07
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@lalyos
lalyos / README.md
Last active February 28, 2023 03:38
proxy docker /var/run/docker.sock to port 2375 with socat

The new Docker daemon uses port: 2376 with TLS enable by default. Sometimes I want to play with curl on the old plain http port 2375. The trick is: use socat in a container to proxy the unix socket to a real port.

docker run -d \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --name docker-http \
  deb socat -d -d TCP-L:2375,fork UNIX:/var/run/docker.sock
@ekristen
ekristen / check_docker_container.sh
Last active January 16, 2024 16:15
Bash Script for Nagios to Check Status of Docker Container
#!/bin/bash
# Author: Erik Kristensen
# Email: erik@erikkristensen.com
# License: MIT
# Nagios Usage: check_nrpe!check_docker_container!_container_id_
# Usage: ./check_docker_container.sh _container_id_
#
# Depending on your docker configuration, root might be required. If your nrpe user has rights
# to talk to the docker daemon, then root is not required. This is why root privileges are not
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
namespace Bleroy.Helpers {
public static class NotNull {
public static TProp Get<TSource, TProp>(this TSource source, Expression<Func<TSource, TProp>> property) where TSource : class {
if (source == null) return default(TProp);
var current = property.Body;