Skip to content

Instantly share code, notes, and snippets.

View TJuberg's full-sized avatar

Thomas Juberg TJuberg

  • Bane NOR SF
  • Trondheim, Norway
  • 10:10 (UTC +02:00)
View GitHub Profile
@TJuberg
TJuberg / README.md
Created April 16, 2025 14:31 — forked from GrabbenD/README.md
org.freedesktop.secrets

Setup org.freedesktop.secrets the easy way with KeepassXC in Github Desktop

Overview

You might want to quickly authenticate with your Github Account to avoid having to manually configure GIT.

Although if you're using a lightweight distribution you might discover that you have to manually find a provider for org.freedesktop.secrets.

I encountered this problem and wanted to share my thoughts and general pointers from what I've learned!

@TJuberg
TJuberg / log-http-headers.md
Created February 19, 2025 14:45 — forked from kaichao/log-http-headers.md
nginx: Log complete request/response with all headers

1. switch nginx image to openresty/openresty

2. add the following to server/location (/etc/nginx/conf.d/default.conf)

   set $req_header "";
   set $resp_header "";
   header_filter_by_lua_block{ 
      local h = ngx.req.get_headers();
      for k, v in pairs(h) do
         ngx.var.req_header = ngx.var.req_header .. k.."="..v.." ";
@TJuberg
TJuberg / create-ansible-playbook.sh
Created December 24, 2024 13:55 — forked from Hobadee/create-ansible-playbook.sh
script to create ansible playbook structure
#!/usr/bin/env bash
# Script to create ansible playbook directories
# With thanks to https://gist.github.com/skamithi/11200462 for giving me the idea
# We attempt to lay everything out according to Ansible best practices:
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#playbooks-best-practices#directory-layout
gitinit(){
# Start with sensible .gitignore defaults
@TJuberg
TJuberg / gist:0969bbb3e04b7be6a6fe0f6005fc4f98
Created March 15, 2024 11:12 — forked from technoweenie/gist:1072829
.netrc file so you can push/pull to https git repos without entering your creds all the time
machine github.com
login technoweenie
password SECRET
machine api.github.com
login technoweenie
password SECRET
@TJuberg
TJuberg / export-awx-inventory.py
Created March 11, 2024 18:40 — forked from afreller-1wa/export-awx-inventory.py
Updated python script to export ansible inventory from awx | ansible tower server.
#!/usr/bin/python3
import requests
import argparse
import sys
# add terms to this list which will be ignored for ini file generation.
# eg. every host var that contains ther term remote_tower will be ignored
exclude_host_vars = [ 'remote_tower']
parser = argparse.ArgumentParser(description='Convert Ansible AWX/Tower Inventory to standard inventory')
@TJuberg
TJuberg / ipa-import-dns-zone.sh
Created March 3, 2023 12:27 — forked from lucashalbert/ipa-import-dns-zone.sh
Script to import an existing BIND DNS zone to IPA
#!/bin/bash
print_version() {
cat <<EOF
####################################################################################
#
# Author: Lucas Halbert <[email protected]>
# Date: 10/14/2019
# Last Edited: 10/14/2019
# Version: 2019.10.14
# Description: Parse a BIND DNS zone (minus the SOA) and import directly to IPA
@TJuberg
TJuberg / resize_disk.sh
Created October 21, 2022 23:24 — forked from CHERTS/resize_disk.sh
Resize LVM disk and partitions
#!/bin/bash
#
# Program: Resize LVM disk and partition <resize_disk.sh>
#
# Author: Mikhail Grigorev <sleuthhound at gmail dot com>
#
# Current Version: 1.0.1
#
# License:
@TJuberg
TJuberg / zabbix_selinux_centos8_config.txt
Created October 21, 2022 23:23 — forked from CHERTS/zabbix_selinux_centos8_config.txt
Zabbix on CentOS 8 with SELinux
If you're running the Zabbix on CentOS 8 with SELinux enabled on it, then you must do all command on this section.
Install SELinux utilities using the dnf command below.
dnf install policycoreutils checkpolicy setroubleshoot-server
Once the installation is complete, create a new directory '~/zabbix-linux' and go into it.
mkdir -p ~/zabbix-selinux
cd ~/zabbix-selinux/

Using Other Window Managers with Plasma 5.21 and systemd Startup

KDE Plasma on X offers the option to use a differnt window manager than the default KWin. This way one can use many of the integrations KDE offers, but with for example the i3 window manager to have proper tiling support. This only works on X, not on Wayland.

With Plasma 5.21 it is now possible to "boot" KDE using systemd user services; that is, KDE Plasma provides a bunch of unit files that get started atfer you login in your graphical user session. Inidividual components, such as KWin, have individual unit files, and dependencies are specified using the usual systemd relationships between units. Among other things this allows for better ressource control using automatically created CGroups.

More details here: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/47

Sadly this breaks the way one could change the window manager, that was used until now. I noticed af

@TJuberg
TJuberg / qip_provision_ip.py
Created March 3, 2020 21:20 — forked from ryancurrah/qip_provision_ip.py
Allocate an IP Address using VitalQIP SOAP API
#!/usr/bin/env python
import argparse
import re
import uuid
import sys
from xml.dom import minidom
from xml.parsers.expat import ExpatError
try: