Skip to content

Instantly share code, notes, and snippets.

View thimslugga's full-sized avatar
👋

Adam Kaminski thimslugga

👋
View GitHub Profile
@thimslugga
thimslugga / Containerfile
Last active March 2, 2024 16:36
Setup conda, mamba and micromamba
FROM debian:stable-slim
SHELL ["/bin/bash", "-c"]
ENV BASH_ENV ~/.bashrc
RUN apt-get update && \
apt-get install -y ca-certificates wget bash bzip2 && \
wget -qO- https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba --strip-components=1 && \
./micromamba shell init -s bash -p ~/micromamba && \
apt-get clean autoremove --yes && \
@thimslugga
thimslugga / 01-ec2-mac-tuning.sh
Last active May 8, 2025 16:33
EC2 Mac Tuning Tips
#!/bin/bash
#set -euo pipefail
#IFS=$'\n\t'
# https://stream.lib.utah.edu/index.php?c=browse&m=results&q=Mac+Admins&sort=newest
# https://macos-defaults.com/
# https://ss64.com/mac/defaults.html
# https://real-world-systems.com/docs/defaults.1.html
#
# https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/
@thimslugga
thimslugga / 00-cisco-2960x-basic-config.txt
Last active May 4, 2024 15:49
Config Snippets for Cisco 2960-X Switches
parser config cache interface
no service pad
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
@thimslugga
thimslugga / aws-ec2-nat-intance-al2.sh
Last active May 3, 2025 02:29
Setup EC2 NAT Instance with Amazon Linux 2
#!/bin/bash
# https://github.com/1debit/alternat
# https://serverfault.com/questions/1137692/aws-nat-instance-setup
# https://www.redhat.com/en/blog/using-iptables-nft-hybrid-linux-firewall
# https://www.frozentux.net/iptables-tutorial/iptables-tutorial.html
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-configuring_nat_using_nftables
# https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)
# https://home.regit.org/netfilter-en/nftables-quick-howto/
# https://unix.stackexchange.com/questions/283275/how-to-do-masquerading-with-nftables
@thimslugga
thimslugga / gist:c0532d8e0475b8c9a636aa41969376a3
Created January 16, 2024 18:46 — forked from rcaetano/gist:5999184
Configure Amazon Linux EC2

Steps

  • Build tools:

      sudo yum groupinstall "Development Tools"
      sudo yum install openssl openssl-devel
      sudo yum install git-core
    
  • Dependencies:

@thimslugga
thimslugga / fmovies-9anime.user.js
Last active November 25, 2023 02:55 — forked from MaxySpark/fmovies-9anime.user.js
User Script to Get Direct Download Link of Movie Series and Anime from http://fmovies.to and http://9anime.to . First install "TAMPERMONKEY" OR "GREASEMONKEY" extention/plugin in your browser
// ==UserScript==
// @name Direct Download From fmovies
// @namespace http://maxyspark.com/
// @version 0.1
// @description Direct Download From fmovies
// @author MaxySpark
// @match http://fmovies.to/*
// @match https://fmovies.to/*
// @match http://9anime.to/*
// @match https://aniwave.to/*
@thimslugga
thimslugga / gist:53509c721682bdd1f30a07ea149fd58e
Created November 22, 2023 15:23 — forked from radupotop/gist:4013294
PolKit rules to allow mounting, rebooting and network management without a password
// /etc/polkit-1/rules.d/10-rules.rules
// PolKit rules to allow mounting, rebooting and network management without a password.
// User needs to be in storage, power and network groups.
polkit.addRule(function(action, subject) {
if (action.id.match("org.freedesktop.udisks2.") && subject.isInGroup("storage")) {
return polkit.Result.YES;
}
});
@thimslugga
thimslugga / monitor_diskspace_usage.sh
Created November 21, 2023 11:53
Get notification for diskspace usage via Uptime Kuma
#!/usr/bin/env bash
# https://gist.github.com/Eising/8620880440016b9227bc31abeca8b1ac
push_url="https://my.uptime.kuma.server/api/push/PUSHURL"
disk="/dev/sda1" # replace with the disk that you are monitoring
threshold="80" # 80% seems reasonable, but YMMV
percentage=$(df -hl --total ${disk} | tail -1 | awk '{printf $5}')
number=${percentage%\%*}
@thimslugga
thimslugga / adguardhome-allowlist.txt
Last active June 8, 2024 23:21
AdGuard Home Allowlist
# Resources for creating filters
#
# https://adguard.com/kb/general/ad-filtering/create-own-filters/
# https://help.adblockplus.org/hc/en-us/articles/360062733293
# https://datatracker.ietf.org/doc/html/rfc5234
# Other already existing allow lists
#
# https://discourse.pi-hole.net/t/commonly-whitelisted-domains/212
# https://github.com/anudeepND/whitelist
@thimslugga
thimslugga / setup-docker-al2023.md
Last active May 13, 2025 07:26
Setup Docker on Amazon Linux 2023

Setup Docker on Amazon Linux 2023

The following guide is for setting up Docker with docker-compose v2 on Amazon Linux 2023. The steps are intendend for AL2023 on EC2 but should mostly work for the AL2023 VMs running on other hypervisors.

Overview of Updating Amazon Linux 2023

Check for new updates

Get the hosts current Amazon Linux 2023 release: