Skip to content

Instantly share code, notes, and snippets.

View kriipke's full-sized avatar

||||||||||||||||||||||||||||||||||||||||||| kriipke

View GitHub Profile

Libarary of Shell Scripts

In order to make the list the script must:

  1. do a relatively wide-array of tasks, e.g. not just download a bunch of packages with a package manager but, modify files, set environment variables, asses the state of the host, etc.

  2. be organized in a way that is exceptional and allows easy maintance and readability by others

  3. run flawless on a wide array of hosts in a wide array of circumstances

@kriipke
kriipke / conntests.ps1
Last active March 27, 2023 19:12
Network Connectivity Troubleshooting Script - PowerShell
$FQDN = "google.com"
$IPAddresses = @()
function Test-HTTP ($Protocol, $FQDN) {
$Protocol = $($Protocol.toUpper())
try {
$URL = "$($Protocol.toLower())://$FQDN"
$HTTPResponse = $(Invoke-WebRequest -Uri $URL -UseBasicParsing | Select-Object -Property StatusCode, StatusDescription)
Write-Host "$Protocol Request (${URL}): " -NoNewLine
if (200 -lt $HTTPResponse.StatusCode -lt 299) {
@kriipke
kriipke / add_local_ansible_user.sh
Last active January 15, 2023 06:50
create an ansible user on a machine you want to manage remotely later via ansible.
#!/bin/sh
# Spencer Smolen <[email protected]>, updated 2023
#
# Create an ansible user that will require no password
# locally, and only accepts SSH akeypair authentication
# when attempting to authenticate remotely.
#
# Modify the SSH public keys and other variables,
# below to create your ansible user as needed.
@kriipke
kriipke / portable_app_utils.ps1
Created October 18, 2022 05:24
PowerShell script for maintaining a directory of portable Windows applications
#
# This file contains functions for maintaining a directory of
# user-installed application files in Windows, similar to the
# organization / methods that are used to maintain the
# /opt directory in GNU/Linux and other UNIX-based systems.
#
# Downloads and extracts an archive of the current release
# of the application given in the function args to the
# following directory:
@kriipke
kriipke / el8_packer_bootstrapper.sh
Last active October 18, 2022 05:34
bootstraps fresh EL8 install to be a Packer host
#!/bin/sh
# Bootstraps fresh EL8 install to be a Packer host
# [may be needed] subscription-manager register
set -e
dnf install -y git
git clone https://github.com/xtalcloud/system-image
@kriipke
kriipke / el8_raspi_bootstrapper.sh
Last active October 17, 2022 23:57
bootstrap raspberry pi with rocky linux installed
#!/bin/sh
# Raspbery Pi (4) Rocky Linux 8.4 Boostrap Script.
# Specer Smolen <[email protected]>
# October 31, 2021
#
# !!! UNTESTED !!!! (somewhat notes on how to provision, clean up)
#
# IMAGE ON WHICH THIS SCRIPT IS MMEANNT TO BE RUN:
# https://download.rockylinux.org/pub/rocky/8/rockyrpi/aarch64/images/
@kriipke
kriipke / mirror_iso.sh
Last active July 20, 2022 06:51
mirror an ISO locally! (using rsync)
#!/bin/sh
set -e
ISO_PATH=/mnt/store/ISO/rhel-baseos-9.0-x86_64-dvd.iso
ISO_MOUNT_PATH=/media/iso
EL_MAJOR_RELEASE=9
EL_SHORT_NAME=rhel9
@kriipke
kriipke / ipmi-fans.service
Last active October 26, 2022 19:16
sets fan speed on local R410 using ipmitool, includes shell script & functionally identical systemd unit file (which runs the command @ boot)
# /etc/systemd/system/ipmifans.service
[Unit]
Description=This unit change the fan speed speed to decrease noise
After=basic.target
Wants=default.target
[Service]
Type=oneshot
ExecStart=/usr/bin/ipmitool -U root raw 0x30 0x30 0x02 0xff 0x1e
ExecStartPre=/usr/bin/ipmitool -U root raw 0x30 0x30 0x01 0x00
// turn into a function that takes a:
// 1. selector (dom)
// 2. { cssparam: cssvalue } (obj whose value is a string)
function cssMod(css_selector,css_attribute,css_value){
const els = document.querySelectorAll(css_selector);
for (let el of els) {
!function(n) {
var i = {};
function a(t) {
if (i[t])
return i[t].exports;
var e = i[t] = {
i: t,
l: !1,
exports: {}
};