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
All fix and check commands must be run as root.
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.
#!/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. | |
#----------------------------------------------------------------------# |
#!/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' |
# /etc/systemd/system/ddclient.service | |
[Unit] | |
Description=Dynamic DNS update wrapper for nsupdate | |
[Service] | |
Type=simple | |
Restart=no | |
ExecStart=/usr/local/sbin/my-ddclient |
# 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) |
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 |
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 | |
) |
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 |
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 |