This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prints objects into json pretty output | |
func PrettyStruct(data interface{}) (string, error) { | |
val, err := json.MarshalIndent(data, "", " ") | |
if err != nil { | |
return "", err | |
} | |
return string(val), nil | |
} | |
// pretty print coded byte in json format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# writte by David "marvin" Nölte - 2022 | |
# this script reads a file with a list of ip subnets/cirds and outputs it to a ip list | |
# input file can be a list of subnets/one per line | |
# check "./cidr2list.py -h" | |
import os | |
import ipaddress | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list | |
sudo apt update | |
sudo apt install mono-devel gtk-sharp2 libappindicator0.1-cil libmono-2.0-1 -y | |
sudo apt install apt-transport-https nano git-core software-properties-common dirmngr -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxmox upgrade from 5.4 to 7 without CEPH | |
## 5to6 | |
systemctl stop pve-ha-lrm | |
systemctl stop pve-ha-crm | |
echo "deb http://download.proxmox.com/debian/corosync-3/ stretch main" > /etc/apt/sources.list.d/corosync3.list | |
apt update | |
apt dist-upgrade --download-only | |
apt dist-upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# uses gambling+porn from https://github.com/StevenBlack/hosts | |
# can be ran via cron | |
cd ~ | |
wget https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling-porn/hosts -O /tmp/hosts | |
sudo sed -i '/#DELETE/Q' /etc/hosts | |
echo '#DELETE' | sudo tee -a /etc/hosts | |
cat /tmp/hosts |sudo tee -a /etc/hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install under /etc/systemd/system/zabbix_agent2.service | |
[Unit] | |
Description=Zabbix Agent 2 | |
After=syslog.target | |
After=network.target | |
[Service] | |
Environment="CONFFILE=/etc/zabbix/zabbix_agentd.conf" | |
EnvironmentFile=-/etc/sysconfig/zabbix-agent | |
Type=simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# _ __ _ | |
# ((-)).--.((-)) | |
# / '' \ | |
# ( \______/ ) | |
# \ ( ) / | |
# / /~~~~~~~~\ \ | |
# /~~\/ / \ \/~~\ | |
# ( ( ( ) ) ) | |
# \ \ \ \ / / / / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nixos config for camus thinkpad T430s Laptop | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/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 |
NewerOlder