Skip to content

Instantly share code, notes, and snippets.

View FlorianHeigl's full-sized avatar

Florian Heigl FlorianHeigl

View GitHub Profile
@FlorianHeigl
FlorianHeigl / xm_dmesg_ismp.txt
Created April 16, 2018 21:32
ISMP 645 Xen 2.0.4
ERROR: cannot use unconfigured serial port COM1
__ __ ____ ___ _ _
\ \/ /___ _ __ |___ \ / _ \| || |
\ // _ \ '_ \ __) || | | | || |_
/ \ __/ | | | / __/ | |_| |__ _|
/_/\_\___|_| |_| |_____(_)___(_) |_|
http://www.cl.cam.ac.uk/netos/xen
University of Cambridge Computer Laboratory
@FlorianHeigl
FlorianHeigl / controller_status
Last active April 23, 2018 21:31
bugfix for check_mk infortrend checks
#!/usr/bin/python
def inventory_controller_status(info):
inventory = []
inventory.append(("Status",None))
return inventory
def check_controller_status(item, params, info):
status = int(info[0][0])
if status == 18:
@FlorianHeigl
FlorianHeigl / htmlgen.sh
Last active January 22, 2019 23:10
pandoc pdf script
#!/bin/bash -u
# you can find the css here:
# https://gist.githubusercontent.com/killercup/5917178/raw/40840de5352083adb2693dc742e9f75dbb18650f/pandoc.css
## html creation via pandoc and LaTex
generate_html() {
# this generates more valid html but gives us a big fat h1 title
# no idea how to get the %title defined in markdown
#pandoc ${1} --metadata=title="based on file $(basename $2)" -s -t html5 --css="$(dirname $0)/pandoc.css" -o ${2}
@FlorianHeigl
FlorianHeigl / ipmi-setup.sh
Last active October 3, 2020 14:59
script for ipmi setup
#!/usr/bin/env bash
# Base ipmi access setup script to be run from BMC
set -u
tgtip=xxx.xxx.xxx.xxx
tgtnet=$(echo $tgtip | cut -f1-3 -d\.)
# intel S2600: 2
# supermicro: 0
@FlorianHeigl
FlorianHeigl / audit.rules
Created July 19, 2018 13:15 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
#
# Linux Audit Daemon - Best Practice Configuration
# /etc/audit/audit.rules
#
# Compiled by Florian Roth
#!/bin/bash -u
# lock down remote end? via:
# https://learninginlinux.wordpress.com/2009/05/07/rsync-fixed-server-side-options/
STOREDIR=/srv/blah/contents
NICE="ionice -c3 nice -n 19"
run_rsync()
{
"type": "ncf_technique",
"version": 1,
"data": {
"bundle_args": [],
"bundle_name": "Star_Wars",
"description": "",
"name": "Star Wars",
"version": "1.0",
"parameter": [],
@FlorianHeigl
FlorianHeigl / smart_freebsd
Created September 15, 2018 13:07
check_mk local check for smart on freeebsd (from elsewhere, limited functionality, better than none)
#!/usr/local/bin/bash
# https://github.com/zmielna/smart_diskinfo
# Backblaze chaps have 40k disks and they care about SMART 187 mainly
# see https://www.backblaze.com/blog/hard-drive-smart-stats/
# This is Check_mk local check script for FreeBSD based NAS like NAS4FREE
# Drop a copy to /usr/lib/check_mk_agent/local/
# you can "telnet nas4free.domain.com 6556" from your OMD server to see if it works.
#
# SMART 5 \u2013 Reallocated_Sector_Count.
# SMART 187 \u2013 Reported_Uncorrectable_Errors.
@FlorianHeigl
FlorianHeigl / git-clearHistory
Last active December 25, 2019 01:04 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
## Remove the history from
rm -rf .git
## recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
## push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:deepthinkag/curl2bash.git
@FlorianHeigl
FlorianHeigl / convwebm.sh
Last active November 18, 2018 15:39
most simple webm to mp4 converter for itunes, deletes original after conversion
#!/usr/bin/env bash
DELETE=y
fullfile="${1}"
filename=$(basename -- "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"