Skip to content

Instantly share code, notes, and snippets.

View camus_configuration.nix
# nixos config for camus thinkpad T430s Laptop
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
@marvin
marvin / kevin_configuration.nix
Last active Jan 18, 2020
nixos - kevin config (work pc)
View kevin_configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
View mikrotik_ddos_TCP.rsc
/ip firewall filter
add action=reject chain=forward comment="DROP DDOS-TCP ACCESS LIST" log-prefix=BLACKLIST reject-with=icmp-port-unreachable src-address-list=DDOSER-UDP
add action=add-src-to-address-list address-list=DDOSER-TCP address-list-timeout=1w chain=forward connection-limit=50,32 dst-address-list=MISAXNET protocol=tcp
add action=add-src-to-address-list address-list=DDOSER-TCP address-list-timeout=1h chain=forward dst-address-list=MISAXNET dst-limit=50,32,src-and-dst-addresses/1h \
protocol=tcp dst-port=587
@marvin
marvin / batmanclients.rb
Created Mar 18, 2017
batman clients counter for sending data to elasticsearch / logstash
View batmanclients.rb
#!/usr/bin/env ruby
require 'getoptlong'
# The name of the collectd plugin, something like apache, memory, mysql, interface, ...
PLUGIN_NAME = 'batmanclients'
def usage
puts("#{$0} -h <host_id> [-i <sampling_interval>]")
exit
end
@marvin
marvin / rename_latest.sh
Last active Aug 26, 2016
Script zum umbenennen der Webcam Files
View rename_latest.sh
#!/bin/sh
# Copyright David Noelte - 2016
# Freifunk Mittelsachsen
# für Sachsen-Webcam.de
# zur freien verwendung freigegeben!
# einfach den code auf dem server unter rename_latest.sh speicher
# dann einen cronjob anlegen wie folgt
# */1 * * * * sh /pfad/zum/script/rename_latest.sh
@marvin
marvin / gluon_auto_reboot.sh
Created Jul 15, 2016
gluon router automatisch neustarten
View gluon_auto_reboot.sh
# edit /etc/crontabs/root
#
# add the following line to reboot the router every night at 03:05
#
# 5 3 * * * /sbin/reboot > /dev/null
@marvin
marvin / throttle.sh
Created Jul 14, 2016
Freifunk Gluon Throttle Speed via Cron
View throttle.sh
#!/bin/ash
#
#Check if Mesh-VPN shall be limited
#
# 1. Edit DownloadRate and UploadRate
# 2. save via vi in /etc/throttle.sh
# 3. make executable "chmod a+x /etc/throttle.sh"
# 4. add to cron to check every 15min "*/15 * * * * /etc/throttle.sh >/dev/null 2>&1"
# 5. edit /etc/sysupgrade.conf to protect from sysupgrade
# add line "/etc/throttle.sh"
@marvin
marvin / check_vplan.sh
Created Jun 30, 2016
vertrettungsplan checker für Tim
View check_vplan.sh
#!/bin/bash
#
# Quick and Dirty Vplan Checker
#
# - checks for vplan on industrieschule.de
# - downloads the pdfs and checks if it contains a certain class
# + if it matches converts the pdf to png and sends an email to an email list
#
# requires:
# - linux :-)
@marvin
marvin / passthrough.sh
Created Jun 14, 2016
CPE/M2/M5 PoE Passthrough aktivieren gluon
View passthrough.sh
# add to /etc/rc.local
# Uncomment one of these three:
#GPIO=20 # TP-LINK CPE210/510
#GPIO=8 # Ubiquiti Nanostation M2/M5 (XM)
#GPIO=2 # Ubiquiti Nanostation M2/M5 (XW)
echo $GPIO > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$GPIO/direction
echo 1 > /sys/class/gpio/gpio$GPIO/value
@marvin
marvin / dd-to-disk.sh
Created Jun 14, 2016
DD iso to Disk/USB with progress bar (requires DD and PV)
View dd-to-disk.sh
dd if=debian-8.1.0-i386-netinst.iso | pv --eta --size 330301440 --progress --bytes --rate --wait > /dev/sdc