Skip to content

Instantly share code, notes, and snippets.

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

Malte Jan Kaffenberger maltejk

🏠
Working from home
View GitHub Profile
@maltejk
maltejk / openvas-automate.sh
Last active June 1, 2020 15:04 — forked from mgeeky/openvas-automate.sh
OpenVAS automation script.
#!/bin/bash
#
# OpenVAS automation script.
# Mariusz B. / mgeeky, '17
# v0.2
#
trap ctrl_c INT
# --- CONFIGURATION ---
#!/bin/sh
sudo apt-get update
sudo apt-get -y install fuse-overlayfs docker.io
sudo systemctl enable --now docker
#!/usr/bin/env bash
_file_abspath="$(echo "$1" | ruby -e 'puts File.absolute_path(STDIN.read)')"
_file_volumename="$(diskutil info -plist / | plutil -convert json -o - - | ruby -rjson -e 'puts JSON.parse(STDIN.read)["VolumeName"]')"
_file_backup="${_file_abspath}.tmutil-backup"
_tmutil_latestbackup="$(tmutil latestbackup)"
mv "${_file_abspath}" "${_file_backup}"
tmutil restore -v "${_tmutil_latestbackup}/${_file_volumename}${_file_abspath}" "${_file_abspath}" || mv "${_file_backup}" "${_file_abspath}"
Unattended-Upgrade::Origins-Pattern {
// Codename based matching:
// This will follow the migration of a release through different
// archives (e.g. from testing to stable and later oldstable).
"o=Debian,n=${distro_codename}";
// "o=Debian,n=${distro_codename}-updates";
// "o=Debian,n=${distro_codename}-proposed-updates";
"o=Debian,codename=${distro_codename},label=Debian-Security";
};
server {
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
server_name hostname.tld;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # not possible to do exclusive
ssl_ciphers 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4';
add_header Strict-Transport-Security max-age=15768000; # six months
@maltejk
maltejk / 99-fail2ban
Created July 8, 2015 15:22
plugin for netfilter-persistent to restart fail2ban if needed
#!/bin/sh
# CC-BY-SA 2015 Malte Jan Kaffenberger <malte@maltejk.de>
set -e
rc=0
load_rules()
{
@maltejk
maltejk / keybase.md
Last active March 13, 2019 17:43
keybase.md

Keybase proof

I hereby claim:

  • I am maltejk on github.
  • I am maltejk (https://keybase.io/maltejk) on keybase.
  • I have a public key ASDt-SS_fNSPyVqp1d3-JJDN4Rm0bzQsdGy0vC5EiBMM2Ao

To claim this, I am signing this object:

APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
@maltejk
maltejk / DumpPreUserCmd.sh
Created January 24, 2015 20:35
BackupPC DumpPreUserCmd-Script für Solr Nodes. Erstellt Snapshots über die Replication-API und wartet bis diese fertig sind.
#!/bin/bash
_solr_collections="collection1 webgraph"
_solr_datapath="/home/solr/solr/example/solr"
# hier: multilog
_solr_logpath="/home/solr/.service/solr/log/main/current"
# nichts, was urlencoded werden muss
_solr_snapshot_suffix="-backuppc"
# faulheit ftw
_null="/dev/null"
@maltejk
maltejk / lxc-network-up.sh
Created December 22, 2014 22:18
lxc: set static route on host for container, serves as lxc.network.script.up
#!/bin/sh
# CC-BY-SA @maltejk 2014
# powered by De:Bug Podcast
# set static route on host for container, serves as lxc.network.script.up
# only works if lxc.network.ipv4 is set
# $@ is
# container (footainer) section (net) context (up) net-type (empty/veth/macvlan/phys) host-side-device (vethF0O0)
exec >> /var/lib/lxc/`basename $0`.log
export container_name="$1"
export container_netdev="$5"