Skip to content

Instantly share code, notes, and snippets.

How to SSH into server:
ssh [email protected]
#Password: admin
@archisgore
archisgore / yum-downgrade-all.sh
Last active June 2, 2021 17:35
Downgrades all packages on a yum/redhat based system to oldest possible versions.
#!/bin/bash
install_version() {
# This would be: NetworkManager.x86_64 1:1.14.0-14.el8 rhel-8-baseos-rhui-rpms
version_entry="$1"
echo " Attempting to install version entry: $version_entry"
# This would be: NetworkManager.x86_64
package_arch="$(echo $version_entry | awk -F" " '{print $1}')"
# This would be: NetworkManager (we remove the .x86_64 or any architecture)
@archisgore
archisgore / yum-make-everything-old.sh
Last active June 5, 2021 16:15
Make everything old and install more oldest-possible-packages and start all services.
#!/bin/bash
install_version() {
# This would be: NetworkManager.x86_64 1:1.14.0-14.el8 rhel-8-baseos-rhui-rpms
local -r version_entry="$1"
# What yum operation do you want?
local -r operation="$2"
echo " Attempting to install version entry: $version_entry"
@archisgore
archisgore / cloc_github_org.sh
Last active May 30, 2024 18:43
Count Lines of code in entire github org
#!/bin/bash
# This command clones all repos in a GitHub org and counts lines of code in each
# It can be re-run to collect new repos and pull the latest changes
set -euo pipefail
USAGE="Usage: $0 <user|org> [depth]"
@archisgore
archisgore / gist:6471ea7b89ba93ab95082948a3e19307
Created December 23, 2021 04:32
Extracting license info from Rust crate dependencies
cargo license --json | jq -r '.[] | "Zerotect,\"" + .name + "\",\"" + .version + "\",\"https://crates.io/crates/" + .name + "\",\"" + .license + "\",\"" + .repository + "/blob/master/LICENSE\",\"" + .description + "\",Production (Distributed),Static link,No,No,No"' > dependencies.csv