Skip to content

Instantly share code, notes, and snippets.

View rswrz's full-sized avatar
🚀
Automating reliability – one script at a time.

Roman Schwarz rswrz

🚀
Automating reliability – one script at a time.
View GitHub Profile
bindsym $mod1+$mod4+h focus left, split toggle, focus right, move left
bindsym $mod1+$mod4+j focus down, split toggle, focus up, move down
bindsym $mod1+$mod4+k focus up, split toggle, focus down, move up
bindsym $mod1+$mod4+l focus right, split toggle, focus left, move right
bindsym $mod1+m mode "Mark"
bindsym $mod1+grave mode "Goto"
mode "Mark" {
bindsym Return $default
bindsym Escape $default
bindsym 1 mark 1; $default
bindsym 2 mark 2; $default
bindsym 3 mark 3; $default
mode "DPMS" {
bindsym 1 exec --no-startup-id xset dpms 0 0 3600, $default
bindsym 3 exec --no-startup-id xset dpms 0 0 1800, $default
bindsym 5 exec --no-startup-id xset dpms 0 0 300, $default
bindsym 9 exec --no-startup-id xset dpms 0 0 90, $default
bindsym 0 exec --no-startup-id xset s off -dpms, $default
bindsym Return $default
bindsym Escape $default
}
@rswrz
rswrz / rootless-podman.sh
Created July 29, 2019 15:16
rootless podman on CentOS7/REHL7
# Source:
# https://www.redhat.com/en/blog/preview-running-containers-without-root-rhel-76
# https://copr.fedorainfracloud.org/coprs/vbatts/shadow-utils-newxidmap/
# https://www.scrivano.org/2018/10/12/rootless-podman-from-upstream-on-centos-7/
curl -o /etc/yum.repos.d/vbatts-shadow-utils-newxidmap-epel-7.repo \
https://copr.fedorainfracloud.org/coprs/vbatts/shadow-utils-newxidmap/repo/epel-7/vbatts-shadow-utils-newxidmap-epel-7.repo
yum install -y shadow-utils46-newxidmap slirp4netns
echo 10000 > /proc/sys/user/max_user_namespaces
groupadd -g 10000 podrunner
@rswrz
rswrz / send.py
Created December 23, 2019 06:42
HTML and plaintext multipart message with python
import smtplib, ssl
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
sender_email = "sender@example.org"
receiver_email = "receiver@example.org"
subject = "HTML test mail"
smtp_server = "smtp.example.org"
port = 25
@rswrz
rswrz / aws_search_resources.sh
Created April 21, 2021 11:51
A simple Bash function that allows the usage of formated JSON with aws resource-group search
#!/bin/bash
aws_search_resources() {
# First argument has to be the JSON string
json=${1:?}
# All other arguments will be passed to aws cli
# e.g.: --region eu-central-1
shift
@rswrz
rswrz / rabbitmqctl_rename_cluster_node.sh
Created December 8, 2021 07:21
This scripts starts a RabbitMQ cluster with the help of Docker to demonstrate RabbitMQ cluster node renaming with 'rabbitmqctl rename_cluster_node'
#!/bin/sh
set -ex
# Exit if 'clean' argument is given
if { [ "$1" = "clean" ]; } 2>/dev/null; then
# Remove existing resources
docker stop rabbit1 rabbit2 rabbit3 || { true; } 2>/dev/null
docker rm rabbit1 rabbit2 rabbit3 || { true; } 2>/dev/null
docker network remove rabbit || { true; } 2>/dev/null
docker volume remove rabbit || { true; } 2>/dev/null
@rswrz
rswrz / WSL_FEDORA.md
Created April 1, 2022 09:02
Import and configure a Fedora distribution in Windows Subsystem for Linux (WSL)

Fedora

The following document describes how to import and configure a Fedora 35 distribution in Windows Subsystem for Linux (WSL). All of the following code blocks can be copied in whole and pasted into a terminal.

Create WSL distribution

First set the WSL name to use in the $Fedora variable. This variable is used in several places in the below code snippets.

$Fedora='fedora'
# Fancy theming only for fancy terminals
if ($null -ne $env:TERM_PROGRAM) {
Import-Module oh-my-posh
Import-Module posh-git
Set-Theme Agnoster
$DefaultUser=$env:UserName
$ThemeSettings.Colors.SessionInfoBackgroundColor='DarkBlue'
$ThemeSettings.Colors.PromptBackgroundColor='Blue'
$ThemeSettings.Colors.AdminIconForegroundColor = 'Red'
@rswrz
rswrz / README.md
Last active October 12, 2022 08:24
Use this styelsheet for VSCode Markdown PDF extension to get great PDFs out of your Markdown files