Skip to content

Instantly share code, notes, and snippets.

View tjuberg's full-sized avatar

Thomas Juberg tjuberg

  • Bane NOR SF
  • Trondheim, Norway
  • 18:19 (UTC +01:00)
View GitHub Profile
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@tjuberg
tjuberg / remove-obsolete-gpg-key-from-dnf.md
Created November 21, 2025 22:51 — forked from e7d/remove-obsolete-gpg-key-from-dnf.md
Remove obsolete GPG key from DNF (Fedora)
@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/