Skip to content

Instantly share code, notes, and snippets.

View mjf's full-sized avatar

Matouš Jan Fialka mjf

View GitHub Profile
@mjf
mjf / kubectl-scaleall
Last active May 12, 2023 10:04
kubectl-scaleall - Scale most deployments and stateful sets up or down
#! /bin/sh
# kubectl-scaleall - Scale most deployments and stateful sets up or down
# Copyright (C) 2023 Matous Jan Fialka, <https://mjf.cz/>
# Released under the terms of the "MIT" license
PROGRAM="${0##*/}"
VERSION='0.1.4'
LICENSE='MIT'
AUTHORS='2022 Matous Jan Fialka, <https://mjf.cz/>'
@mjf
mjf / fstab-uuidify
Last active May 10, 2023 06:37
fstab-uuidify
#! /bin/sh
# fstab-uuidify - change /dev to UUID entries in fstab(5)
# Copyright (C) 2023 Matous Jan Fialka, <https://mjf.cz/>
# Released under the terms of the "MIT" license.
# Usage: fstab2uuid /etc/fstab |tee /etc/fstab.new
oprobe=
if [ $UID -eq 0 ]; then
@mjf
mjf / security-overview-services.md
Last active September 19, 2023 08:42
Security Overview Services (SOS)

Security Overview Services (SOS)

Service Website Email DNS Browser Connection Comments (*)
Internet NL excellent
SSL Labs reliable
Hardenize great
Security Headers perfect
Mail Hardener valuable
DNS Spy informative
@mjf
mjf / .inputrc
Created February 2, 2023 09:38
inputrc - Readline configuration
$if mode=emacs
$if term=screen.xterm
set show-mode-in-prompt on
set emacs-mode-string \1\eP\e[6\ q\e\\\2
$endif
$endif
$if mode=vi
$if term=screen.xterm
set show-mode-in-prompt on
@mjf
mjf / .lftprc
Last active January 31, 2023 12:10
lftp(1) configuration
set cmd:prompt '\U \S\n$ '
set ftp:port-range 21000-21999
set ftp:sync-mode off
set ssl:verify-certificate on
debug 4
alias ledit 'local edit'
alias lls 'local ls'
alias nocertverify 'set ssl:verify-certificate off'
@mjf
mjf / 💀.conf
Last active January 10, 2023 15:09
💀
#! /usr/sbin/nft -f
# 💀 aka "absolute" firewall for Linux
flush ruleset
table netdev netdev_rules {
chain netdev_filter_ingress_device_lo {
type filter hook ingress device lo priority 0
policy drop
@mjf
mjf / Add_Custom_Local_Parameters_for_Zimbra_Postfix_Configuration.md
Last active November 28, 2022 10:24
Add Custom Local Parameters for Zimbra Postfix Configuration

Add Custom Local Parameters for Zimbra Postfix Configuration

We will add two custom local parameters:

  • sender_bcc_maps
  • recipient_bcc_maps

so that we could define our own per-user Bcc: forwarding for all users in a domain (also see this Gist to know more generally about how to configure it for Postfix).

@mjf
mjf / Enable_BCC_Forwarding_For_All_Domain_Users.md
Created November 28, 2022 07:47
Enable BCC Forwarding For All Domain Users

Enable BCC Forwarding For All Domain Users

# /etc/postfix/main.cf
sender_bcc_maps    = pcre:/etc/postfix/domain_users_bcc_maps
recipient_bcc_maps = pcre:/etc/postfix/domain_users_bcc_maps
# /etc/postfix/domain_users_bcc_maps
@mjf
mjf / online-interface-rename-systemd-networkd-udevd.md
Last active November 28, 2022 10:09
Online rename interface with Systemd Networkd and Udevd

Online rename interface with Systemd Networkd

  1. create .link file in for the interface to rename it to a name of choice:

    [Match]
    OriginalName=*
    MACAddress=<mac-address>
    

[Link]