Skip to content

Instantly share code, notes, and snippets.

View kkappel's full-sized avatar
🏠
Working from home

Klaus Kappel kkappel

🏠
Working from home
View GitHub Profile
@kkappel
kkappel / clients.py
Last active October 15, 2019 13:51
#!/usr/bin/python3
# Read Clients from cients.conf
# Requires: ipaddress, freeradius
#
#
# (c) 2019 by Klaus Kappel <kkappel@jugendhilfe-wuemmetal.de>
import ipaddress
FN = '/etc/freeradius/3.0/clients.conf'
#!/bin/bash
# Filter unknown Mac-Adresses from daemon.log and display Manufacturer
# works with UNIVENTION 4
# depends on: oui.txt from https://linuxnet.ca/ieee/oui/
# (c) 2019 by Klaus Kappel
# Use under GPL3
txt=/var/www/unknown.txt
tmp=$(mktemp)
#!/bin/bash
# Create Plone Instance Server based on debian 9
#
# (c) 2018 by Klaus Kappel
apt install sudo zlib1g-dev libjpeg-dev
apt install python2.7 python2.7-dev python-setuptools python-dev build-essential libssl-dev libxml2-dev libxslt1-dev libbz2-dev
apt install libreadline-dev wv poppler-utils
wget https://launchpad.net/plone/5.1/5.1.2/+download/Plone-5.1.2-UnifiedInstaller.tgz
mkdir /syspart
mount /dev/sdaX /syspart [WICHTIG: "X" durch die jeweilige Nummer der System-Partition ersetzen, z.B. "/dev/sda2"]
mount -o bind /dev /syspart/dev
mount -o bind /proc /syspart/proc
mount -o bind /sys /syspart/sys
chroot /syspart
update-grub
grub-install /dev/sda
rmdir /syspart
exit
#!/bin/sh
# Install Docker on debian 9.1
#
# (c) 2017 by Klaus Kappel <kkappel@jugendhilfe-wuemmetal.de>
# No Warranty at all
# Best Parctice: take a brand new debian-netinstall out of the box
# be sure, that network is already running
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
#!/bin/bash
# Migrate from OwnCloud to NextCloud
# tested with: UBUNTU 16.04
# (c) 2017 by Klaus Kappel <kkappel@yahoo.de>
# UBUNTU 16.04, UBUNTU 14.04: apt-get
apt=apt
sudo -s
$apt remove owncloud-client
# Prepare OpenWrt for local developement of binaries
# for TP-Link WRT3600
# by Klaus Kappel <kkappel@yahoo.de>
# ABSOLUTELY NO WARRANTY FOR ANY DAMAGE TO YOUR ROUTER
sudo apt update
sudo apt install build-essential subversion libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext
sudo apt install quilt lzop libssl-dev
git clone git://git.openwrt.org/openwrt.git
cd openwrt
@kkappel
kkappel / nrpe-chkraid.py
Created August 10, 2017 21:12
Check HP Smart Array SATA RAID Controller by nrpe
#!/usr/bin/python
# -*- coding:utf-8 -*-
####
#
# NAME: check_smartarray.py
#
# AUTHOR: Christophe Robert - christophe °dot° robert °at° cocoche °dot° fr
#
# DESC: Check Hpacucli results for RAID status on Linux - hpacucli command line tool
def GetWeek(week_nr, year):
'''
Get start datetime and end datetime of calender week.
Beginning with Monday, ending with Sunday.
Needed for SQL-Queries.
'''
montag = str(week_nr) + "-" + str(year) + '-1'
monday = datetime.strptime(montag, '%W-%Y-%w')
sonntag = str(week_nr) + "-" + str(year) + '-0'
@kkappel
kkappel / jhwnotebook.sh
Last active July 28, 2022 07:48
Steps to get a brand new business notebook with openvpn running
#!/bin/bash
# Lokalisieren eines Juhiwue-Notebooks oder Desktops
#
# Usage: wget
# Für UBUNTU 16.04
# (c) 2017 by Klaus Kappel <kkappel@yahoo.de>
# Sind wir in Rehr?
INTERN=1