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 / abp-foreignpolicy.com.txt
Last active December 29, 2015 02:39
adblock plus: remove forced login on foreignpolicy.com
foreignpolicy.com###TB_iframeContent
foreignpolicy.com###TB_overlay
foreignpolicy.com##.TB_overlayBG
@maltejk
maltejk / package_setup.sh
Last active August 29, 2015 13:56
package_setup.sh – für einfaches benutzen von /package/host/localhost gedöns, wie bei uberspace üblich
# lizenz: cc-by-sa @maltejk https://maltejk.de/
#
# zur benutzung:
# mkdir ~/.bash_profile.d ; cd ~/.bash_profile.d ; git clone https://gist.github.com/8981665.git
# und in der .bash_profile
#
# export _bash_profile_gist_pull=true
# source ~/.bash_profile.d/8981665/package_setup.sh
#
# einfügen.
@maltejk
maltejk / abp-whotofollow-hide.txt
Last active August 29, 2015 14:04
Leute aus "who to follow" verschwinden lassen für ABP
twitter.com##div[data-screen-name="maltejk"].account.js-actionable-user.js-profile-popup-actionable
@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"
@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"
APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
@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:

@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()
{
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
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";
};