Skip to content

Instantly share code, notes, and snippets.

@MaxiHafer
MaxiHafer / kubeconfig-merge.sh
Created November 13, 2023 13:21
kubeconfig runtime merging for kubectx & kubens
OIFS="$IFS"
IFS=$'\n'
KUBECONFIG_FILES=( $(find $HOME/.kube/ -type f -name 'kubeconfig.*.yaml') )
IFS=$OIFS
KUBECONFIG=$(echo ${KUBECONFIG_FILES[@]} | tr ' ' ':') kubectl config view --flatten > $HOME/.kube/config
chmod 600 $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config
@MaxiHafer
MaxiHafer / controller.lua
Last active January 9, 2023 20:50
CC-Controllers
local reactor = peripheral.find("fissionReactorLogicAdapter")
local turbine = peripheral.find("turbineValve")
local target_energy_percent = 0.9
data = {reactor = {}, turbine = {}}
data.print = function (self)
@MaxiHafer
MaxiHafer / pid.lua
Created January 8, 2023 00:31
PID-Controller for mekanism fission-reactor and steam turbine
local state, data, reactor, turbine, info_window, rules_window
local STATES = {
READY = 1, -- Reactor is off and can be started with the lever
RUNNING = 2, -- Reactor is running and all rules are met
ESTOP = 3, -- Reactor is stopped due to rule(s) being violated
UNKNOWN = 4, -- Reactor or turbine peripherals are missing
}
------------------------------------------------
@MaxiHafer
MaxiHafer / reactor.lua
Last active July 23, 2023 09:48 — forked from InternetUnexplorer/reactor.lua
ComputerCraft program to control a Mekanism fission reactor
local state, data, reactor, turbine, info_window, rules_window
local STATES = {
READY = 1, -- Reactor is off and can be started with the lever
RUNNING = 2, -- Reactor is running and all rules are met
ESTOP = 3, -- Reactor is stopped due to rule(s) being violated
UNKNOWN = 4, -- Reactor or turbine peripherals are missing
}
------------------------------------------------
print("starting mob slaughter...")
while true do
while redstone.getInput("front") do
turtle.attack();
sleep(0.5);
end
turtle.turnRight()
turtle.turnRight()