Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
:octocat:

Adam Kaminski thimslugga

:octocat:
View GitHub Profile
@thimslugga
thimslugga / lambda_function.py
Created September 8, 2022 12:55 — forked from thomasmichaelwallace/lambda_function.py
Lambda function to launch an ec2-instance
""" Lambda to launch ec2-instances """
import boto3
REGION = 'eu-central-1' # region to launch instance.
AMI = 'ami-24bd1b4b'
# matching region/setup amazon linux ami, as per:
# https://aws.amazon.com/amazon-linux-ami/
INSTANCE_TYPE = 'm3.medium' # instance type to launch.
EC2 = boto3.client('ec2', region_name=REGION)
@thimslugga
thimslugga / custom_silverblue_iso.md
Created August 3, 2022 16:39 — forked from JayDoubleu/custom_silverblue_iso.md
Scripts to create custom fedora silverblue iso
mkdir isobuild && cd isobuild
sudo dnf install rpm-ostree lorax -y
git clone -b f33 https://pagure.io/workstation-ostree-config
git clone -b f33 https://pagure.io/fedora-lorax-templates.git
mkdir repo
ostree init --repo=repo
rpm-ostree compose tree --repo=$(pwd)/repo \
	$(pwd)/workstation-ostree-config/fedora-silverblue.yaml
@thimslugga
thimslugga / snapd-regain-sanity.patch
Created March 26, 2022 16:01 — forked from alyandon/snapd-regain-sanity.patch
Give users control over snapd autorefresh mechanism - apply patch over offiical repo and build binaries
diff --git a/cmd/snapd/main.go b/cmd/snapd/main.go
index 741d998404..55d06d2d9c 100644
--- a/cmd/snapd/main.go
+++ b/cmd/snapd/main.go
@@ -52,6 +52,10 @@ func init() {
}
func main() {
+ if _, found := os.LookupEnv("SNAPD_DISABLE_AUTOREFRESH"); found {
+ logger.Noticef("AutoRefresh disabled due to SNAPD_DISABLE_AUTOREFRESH environment variable being set")
@thimslugga
thimslugga / gamebuntu.sh
Last active December 23, 2021 21:05 — forked from RudraSwat/gamebuntu.sh
A simple script to transform an Ubuntu install into a complete game-ready (!) setup.
#!/bin/bash
# Gamebuntu, a simple script to transform an Ubuntu install into a complete game-ready (!) setup
set -e
cd "$(mktemp -d -t gamebuntu-XXXXXXXXXXXX)"
# start info
cat <<EOF
@thimslugga
thimslugga / pcs-crmsh cheatsheet.md
Created October 24, 2021 23:17 — forked from beekhof/pcs-crmsh cheatsheet.md
Transition guide for common crmsh commands

Display the configuration

crmsh # crm configure show
pcs   # pcs cluster cib

Display the current status

crmsh # crm_mon -1
pcs   # pcs status
@thimslugga
thimslugga / lxc-sync-config
Created July 11, 2021 23:46 — forked from usrflo/lxc-sync-README
lxc copy --refresh workaround: efficient incremental ZFS snapshot sync with send/receive
LXCBIN=/snap/bin/lxc
LXDBIN=/snap/bin/lxd
ZFSBIN=/sbin/zfs
SYNCSNAPNAME=bsync
LASTSYNCSNAPNAME=bsync-last
ZFSROOT=tank/containers/
MOUNTROOT=/var/snap/lxd/common/lxd/storage-pools/
@thimslugga
thimslugga / tcc-reset.py
Created December 29, 2020 22:25 — forked from haircut/tcc-reset.py
Completely reset TCC services database in macOS
#!/usr/bin/python
"""
Completely reset TCC services database in macOS
Note: Both the system and individual users have TCC databases; run the script as both
a user and as root to completely reset TCC decisions at all levels.
2018-08-15: Resetting the 'Location' service fails; unknown cause
2018-08-16: Confirmed the 'All' service does not really reset _all_
services, so individual calls to each service is necessary.
@thimslugga
thimslugga / compile_newest_stable_kernel_with_acso_patch.sh
Created September 25, 2020 12:41 — forked from mdPlusPlus/compile_newest_stable_kernel_with_acso_patch.sh
Download, patch, compile and install the newest stable Linux kernel with the ACS override patch (Ubuntu / Debian)
#!/bin/bash
function install_dependencies() {
echo "Installing dependencies..."
sudo apt -qq update
sudo apt -qq install -y curl git wget
sudo apt -qq install -y bison flex kernel-package libelf-dev libssl-dev
}
function init() {
@thimslugga
thimslugga / docker-nftables.conf
Created June 4, 2020 16:52 — forked from dearing/docker-nftables.conf
nftables with docker
# /etc/systemd/system/docker.service.d/docker-nftables.conf
# disable iptables in docker, allowing nftables to do work
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --iptables=false
@thimslugga
thimslugga / requests_api.py
Created March 6, 2020 22:36 — forked from stefansundin/requests_api.py
Reusable class for Python requests library.
# http://docs.python-requests.org/en/master/api/
import requests
class RequestsApi:
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.session = requests.Session()
for arg in kwargs:
if isinstance(kwargs[arg], dict):
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg])