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 / 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
@b13n1u
b13n1u / imscp_migration
Last active February 13, 2018 17:45
I-MSCP migration from old server to a new one.
#Migrate i-mscp to a new server
#the new imscp is already installed and does have a different IP than the old one
#1. Dump the DB and copy the i-MSCP backup to new server:
rsync -rave "ssh -l root" /var/www/imscp/backups 10.0.0.3:/var/tmp/imscp_old_backups
#2.Install the old config DB
#3. Copy all customer data:
rsync -rave "ssh -l root " /var/www/virtual/ 10.0.0.3:/var/www/virtual