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 / bash_clean_code.sh
Created March 4, 2024 01:27 — forked from polyakovin/bash_clean_code.sh
Clean code example using Bash language
#!/bin/bash
function process_script_request {
if [[ $# -eq 0 ]]; then
show_help
else
case $1 in
help) show_help;;
back) serve_backend;;
back:prod) serve_backend_production;;
front) update_and_watch_assets;;
@thimslugga
thimslugga / setup-fedora-silverblue-xps-9310.sh
Last active March 3, 2024 18:24
Setup Fedora Silverblue 39 on Dell XPS 9310
#!/bin/bash
### WARNING: This is a WIP ###
### ISO ###
#
# https://www.balena.io/etcher/
# https://www.ventoy.net/en/index.html
#
# Take a look at ublue-os/isogenerator on GitHub, which is an action
@thimslugga
thimslugga / install-soft-serve.sh
Last active March 2, 2024 18:06
Setup soft-serve on Linux
#!/bin/bash
# https://charm.sh/blog/self-hosted-soft-serve/
# https://github.com/charmbracelet/soft-serve/blob/main/README.md
# https://github.com/charmbracelet/soft-serve
# https://github.com/charmbracelet/soft-serve-action
sudo dnf install -y curl git git-lfs
# Fedora/RHEL
@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 September 12, 2025 18:44
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 18, 2025 03:18
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;
}
});