Skip to content

Instantly share code, notes, and snippets.

View chadmayfield's full-sized avatar

Chad Mayfield chadmayfield

View GitHub Profile
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active April 29, 2025 03:16
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@gabrielsson
gabrielsson / minecraft-on-raspberry-pi.md
Last active February 10, 2025 08:26
Minecraft on Raspberry Pi cluster with metrics

alt

Minecraft on Raspberry Pi cluster with metrics

Ever wanted to put your Rapsberry Pi cluster to great use? Our team is working remotely, so we started to play Minecraft. I decided I would host the Minecraft server on my Raspberry Pi cluster. This gist will guide you through the steps I took to get a k3s cluster up with k3sup and later installed Minecraft as well as metrics exporter and Prometheus Operator

Why?

Quoniam Possumus - Because we can

You'll need

@gillg
gillg / rrd_to_openmetrics.py
Last active December 16, 2024 11:56
Script to convert a set of RRD files (issued from collectd for example) to Open Metrics format (prometheus)
#!/usr/bin/env python
from __future__ import print_function
'''
Usage:
./rrd_to_openmetrics.py /path/rrd_directory/ > openmetrics.txt
'''
'''
Directory structure :
#!/usr/bin/env bash
CIPHERS='ALL:eNULL'
DELAY=${2:-0.1}
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]}
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}')
echo Using $(openssl version).
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites )
@blake
blake / k3s-helmchart-generate.py
Last active April 11, 2022 16:54
Helper script to generate HelmChart CRDs for use with the K3s Kubernetes
#!/usr/bin/env python3
# Copyright (c) 2019 Blake Covarrubias
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
"""Helper script to generate HelmChart CRDs for use with the K3s Kubernetes
This script creates HelmChart resource definitions for use on the K3s Kubernetes
distribution. The command line arguments closely resemble the behavior of
@chadmayfield
chadmayfield / network_interface_notes.md
Last active June 3, 2019 19:36
Notes on Network Interfaces in Linux/Unix systems

Network Interface Notes

Beginning in Systemd v197, network interfaces assigned by systemd/udev are "predicatble";

Names are now based on;

  • Index numbers for on-board devices (eno1)
  • PCI-ehotplug slot index numbers (ens1)
  • Physical/geographical location of hardware connector (enp2s0)
  • MAC address (enx78e7d1ea46da)
  • Classic, unpredictable kernel-native naming (eth0)

My Kuberentes Command Reference

This is my Kubernetes reference page. Most are commands that I don't want to forget, links to credits where due.

Get detailed cluster information

kubectl cluster-info dump

Get list of Kubernetes node IP addresses

kubectl get nodes -o jsonpath='{ $.items[*].status.addresses[?(@.type=="InternalIP")].address }'

@BigOokie
BigOokie / MacOS-Multi-Version-Go-With-Homebrew.md
Last active December 18, 2024 12:49
Manage multiple versins of Go on MacOS with Homebrew

This process would likely apply to other Homebrew formula also.

First search for your desired package:

brew search go

You should get a list of results that include the below. Not "go" is very unspecific so you may get a lot of results:

@wonderbeyond
wonderbeyond / vsc-settings.py
Created February 25, 2019 09:11
script to export vsc settings
#!/usr/bin/env python3
from os import path
import tempfile
import subprocess
import datetime as dt
import click
@click.group()
def cli():
@jgamblin
jgamblin / antiautosploit.py
Last active March 25, 2025 10:03
Blocks Shodan IPs From Scanning Your Servers.
#!/usr/bin/python3
import os
shodan = ["104.131.0.69", "104.236.198.48", "155.94.222.12","155.94.254.133", "155.94.254.143", "162.159.244.38", "185.181.102.18", "188.138.9.50", "198.20.69.74", "198.20.69.98", "198.20.70.114", "198.20.87.98", "198.20.99.130", "208.180.20.97", "209.126.110.38", "216.117.2.180", "66.240.192.138", "66.240.219.146", "66.240.236.119", "71.6.135.131", "71.6.146.185", "71.6.158.166", "71.6.165.200", "71.6.167.142", "82.221.105.6", "82.221.105.7", "85.25.103.50", "85.25.43.94", "93.120.27.62", "98.143.148.107", "98.143.148.135"]
for ip in shodan:
os.system("iptables -A INPUT -s {} -j DROP".format(ip))