Skip to content

Instantly share code, notes, and snippets.

View AfroThundr3007730's full-sized avatar
🔧
Hacking all the things...

Eddie Carswell AfroThundr3007730

🔧
Hacking all the things...
View GitHub Profile
@AfroThundr3007730
AfroThundr3007730 / Rocky_9_STIG_notes.md
Created April 11, 2024 19:15
Notes on getting Rocky 9 compliant with DISA STIGs

Rocky 9 STIG notes

RHEL-09-211045: Red Hat Enterprise Linux 9 Security Technical Implementation Guide :: Version 1, Release: 2 Benchmark Date: 24 Jan 2024

Updated on 2024-04-05

Utilities

All fix and check commands must be run as root.

@AfroThundr3007730
AfroThundr3007730 / note_on_licensing.md
Last active March 30, 2024 23:37
A note on licensing

A note on licensing

Unless otherwise specified, any public code, document, snippet, or file posted on my GitHub profile or Gists page, is released under the GNU GPL, Version 3.0 or later.

I'm not going to necessarily remember to tag all of my files with a license. So in the absense of one, the above statement holds true.

@AfroThundr3007730
AfroThundr3007730 / utils.common.sh
Last active April 12, 2024 23:40
Collection of utility functions for bash scripts
#!/bin/bash
# Collection of utility functions for bash scripts
# Version 0.6.4 modified 2024-04-12 by AfroThundr
# SPDX-License-Identifier: GPL-3.0-or-later
#
# For issues or updated versions of this script, browse to the following URL:
# https://gist.github.com/AfroThundr3007730/b761bd1a6b2f32a2e97727c7e049e354
# Take caution sourcing this file in your shell, as it uses strict mode.
#----------------------------------------------------------------------#
@AfroThundr3007730
AfroThundr3007730 / dce-dload.sh
Last active March 30, 2024 23:18
Wrapper around DiscordChatExporter for automatic channel media archiving
#!/bin/bash
# Wrapper around DiscordChatExporter for automatic channel media archiving
# SPDX-License-Identifier: GPL-3.0-or-later
dce.set_globals() {
AUTHOR='AfroThundr'
BASENAME="${0##*/}"
MODIFIED='20240304'
VERSION='0.3.1'
@AfroThundr3007730
AfroThundr3007730 / ddclient.service
Last active March 30, 2024 23:19
Dynamic DNS update wrapper for nsupdate
# /etc/systemd/system/ddclient.service
[Unit]
Description=Dynamic DNS update wrapper for nsupdate
[Service]
Type=simple
Restart=no
ExecStart=/usr/local/sbin/my-ddclient
@AfroThundr3007730
AfroThundr3007730 / Hide-ConsoleWindow.ps1
Last active March 2, 2024 03:13
Hides a console window (even the new WindowsTerminal.exe)
# Adapted from https://stackoverflow.com/a/74976541/4087397
function Hide-ConsoleWindow() {
# Import 'ShowWindowAsync' method to properly hide windows
Add-Type -Name User32 -Namespace Win32 -MemberDefinition `
'[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);'
# Mangle the window title to ensure it's unique and allow us to find it
$Host.UI.RawUI.WindowTitle = [Guid]::NewGuid()
# Find our process by the mangled window title and hide it
[Win32.User32]::ShowWindowAsync(
(Get-Process).where{ $_.MainWindowTitle -eq $Host.UI.RawUI.WindowTitle }.MainWindowHandle, 0)
@AfroThundr3007730
AfroThundr3007730 / Install-PythonRelease.ps1
Last active January 8, 2024 23:12
Install the Python language interpreter
Set-StrictMode -Version Latest
#Requires -Version 7
function Install-PythonRelease {
<# .SYNOPSIS
Install the Python language interpreter #>
param(
# Install for all users (requires admin)
[Switch]$AllUsers,
# Use beta build instead of latest stable
@AfroThundr3007730
AfroThundr3007730 / Get-GHRepoList.ps1
Created October 9, 2023 20:41
Gets a list of repositories of a GitHub user
function Get-GHRepoList {
<# .SYNOPSIS
Gets a list of repositories of a GitHub user. #>
Param(
# User to enumerate
[string]$User,
# Page size to request
[int]$Size = 100
)
@AfroThundr3007730
AfroThundr3007730 / Update-LocalNugetRepository.ps1
Created June 27, 2023 20:23
Update a local Nuget repo from a remote repo
Set-StrictMode -Version Latest
# Inspired by: https://weblogs.asp.net/jongalloway/downloading-a-local-nuget-repository-with-powershell
function Update-LocalNugetRepository {
<# .SYNOPSIS
Update a local Nuget repo from a remote repo #>
Param(
# Remote repository feed URL
[Uri]$FeedURLBase = 'https://aka.ms/sme-extension-feed',
# Local repository directory
@AfroThundr3007730
AfroThundr3007730 / Get-GHRepoList.ps1
Last active March 31, 2024 18:24
Gets a list of repositories of a GitHub user
Set-StrictMode -Version Latest
function Get-GHRepoList {
<# .SYNOPSIS
Gets a list of repositories of a GitHub user. #>
Param(
# User to enumerate
[string]$User,
# Page size to request
[int]$Size = 100