Skip to content

Instantly share code, notes, and snippets.

View b13n1u's full-sized avatar

b13n1u

  • ebay-kleinanzeigen.de | eBay Inc.
View GitHub Profile
@b13n1u
b13n1u / restore_rancher2_agents.md
Created November 14, 2024 10:09 — forked from superseb/restore_rancher2_agents.md
Restore Rancher 2 cluster/node agents on clusters

Restore Rancher 2 cluster/node agents on clusters

This is an unsupported scenario, see rancher/rancher#14731 when there is an official solution.

When cattle-cluster-agent and/or cattle-node-agent are accidentally deleted, or when server-url/cacerts are changed.

Generate definitions

  • Generate API token in the UI (user -> API & Keys) and save the Bearer token
  • Find the clusterid in the Rancher UI (format is c-xxxxx), its in the address bar when the cluster is selected
@b13n1u
b13n1u / getESP8266HeapStats.c
Created April 4, 2021 20:35
Get ESP8266 memory stats
void loop()
{
static uint32_t lastmin=65536;
static uint32_t myfree;
static uint16_t mymax;
static uint8_t myfrag;
ESP.getHeapStats(&myfree, &mymax, &myfrag);
Serial.printf("(%d) -> free: %5d - max: %5d - frag: %3d%% <- \n", millis(), myfree, mymax, myfrag);
@b13n1u
b13n1u / check_port.md
Last active August 13, 2020 13:35
Various ways to check a port.

telnet of course :)

netcat

nc -zv -w 5 127.0.0.1 22

range:
nc -zv 127.0.0.1 22-23
@b13n1u
b13n1u / kafka_mirrormaker_generic_jmx.conf
Created October 5, 2018 11:51
Not so perfect collectd genericjmx plugin config for kafka mirrormaker.
# Not so perfect collectd generic jmx plugin config for kafka mirrormaker
# You need to enable JMX for mirrormaker first.
# Documentation:
# https://collectd.org/wiki/index.php/Plugin:Java
<Plugin java>
<Plugin "GenericJMX">
<MBean "classes">
ObjectName "java.lang:type=ClassLoading"
[color]
ui = true
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
st = status
co = checkout
reload = !git fetch --all && git checkout master && git reset --hard origin/master && git submodule update --init
rev = push origin HEAD:refs/for/master
@b13n1u
b13n1u / termin.rb
Last active August 29, 2015 14:21
Hmmm... so you need to go to Burgeramt ?
#!/usr/bin/ruby
require 'open-uri'
require 'nokogiri'
require 'uri'
require 'pushover'
require 'google_url_shortener'
#not really needed
Google::UrlShortener::Base.api_key = "API_KEY" #your google url shortener api
@b13n1u
b13n1u / whisper_resize_all
Created March 29, 2015 17:01
Resize all wsp data files in whisper dir.
find /var/lib/graphite/whisper -type f -name "*.wsp" -exec whisper-resize {} 10s:1d 1m:7d 5m:30d 15m:3y \;
@b13n1u
b13n1u / gitlg
Last active August 29, 2015 14:14
#nice log output
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
#enable color
git config --global color.ui true
@b13n1u
b13n1u / tmux.conf
Last active March 15, 2016 10:02
my basic tmux.conf
# use UTF8
set -g utf8
set-window-option -g utf8 on
set-option -g status-utf8 on
#display things in 256 colors
set -g default-terminal "screen-256color"
#scrollback history to 10000 lines
set -g history-limit 10000