Skip to content

Instantly share code, notes, and snippets.

View iversond's full-sized avatar

Dan Iverson iversond

View GitHub Profile
@iversond
iversond / upgrade_acl.yaml
Created October 5, 2022 12:24
Rundeck ACL to allow access to the "Upgrade" folder
description: System-level read access
context:
application: rundeck
for:
project:
- allow: '.*' # allow view/admin of all projects
system:
- match:
name: '.*'
allow: [read,write,run,kill]
@iversond
iversond / remove_large_file.sh
Created October 4, 2022 17:29
Remove a large file that was added to the Git index
filename="terraform-provider-oci_v3.85.0_x4"
git filter-branch --prune-empty -d /tmp/scratch \
--index-filter "git rm --cached -f --ignore-unmatch $filename" \
--tag-name-filter cat -- --all
@iversond
iversond / oci_fss_snapshots.sh
Last active October 4, 2022 16:17
Merging scripts from https://reguchi.wordpress.com/2020/02/11/oci-file-storage-snapshot-management/ into one. Using with Rundeck to create snapshots.
#!/usr/bin/env bash
# shellcheck disable=2059,2154,2034,2155,2046,2086
#===============================================================================
# vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 spelllang=en ft=sh
#===============================================================================
#
# FILE: oci_fss_snapshots.sh
#
# USAGE: ./oci_fss_snapshots.sh
#
@iversond
iversond / scan_log4j.sh
Last active December 13, 2021 21:49
(Optional) Download GLIBC 2.14 and copy to a common location (http://ftp.gnu.org/gnu/glibc/glibc-2.14.tar.gz). Download the log4j-Scanner tool (https://github.com/logpresso/CVE-2021-44228-Scanner) to a common location. This script will use the scanner tool to identify and remove the vulnerable classes from the log4j libraries.
#!/usr/bin/env bash
# shellcheck disable=2059,2154,2034,2155,2046,2086
#===============================================================================
# vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 spelllang=en ft=sh
#===============================================================================
#
# Usage: scan_log4j.sh <Fix Y/N> <(Optional) Debug: true/false>
#
# Examples:
# Scan and Fix libraries
@iversond
iversond / convertToLookup.ps1
Created June 3, 2021 15:31
Convert Hiera to Lookup for the DPK
set-location e:\psoft\dpk\puppet
# pia_domain_list
(get-content -Path .\modules\pt_profile\manifests\pt_pia.pp) -replace "hiera\(\'pia_domain_list\'\)", "lookup('pia_domain_list', undef, undef, '')" | set-content -Path .\modules\pt_profile\manifests\pt_pia.pp
(get-content -Path .\modules\pt_profile\manifests\pt_domain_boot.pp) -replace "hiera\(\'pia_domain_list\'\)", "lookup('pia_domain_list', undef, undef, '')" | set-content -Path .\modules\pt_profile\manifests\pt_domain_boot.pp
# appserver_domain_list
(get-content -Path .\modules\pt_profile\manifests\pt_appserver.pp) -replace "hiera\(\'appserver_domain_list\'\)", "lookup('appserver_domain_list', undef, undef, '')" | set-content -Path .\modules\pt_profile\manifests\pt_appserver.pp
(get-content -Path .\modules\pt_profile\manifests\pt_domain_boot.pp) -replace "hiera\(\'appserver_domain_list\'\)", "lookup('appserver_domain_list', undef, undef, '')" | set-content -Path .\modules\pt_profile\manifests\pt_domain_boot.pp
@iversond
iversond / patchGitlab.sh
Created October 27, 2020 15:12
Rundeck script to patch GitLab
#!/usr/bin/env bash
# shellcheck disable=2059,2154,2034,2155,2046,2086
#===============================================================================
# vim: softtabstop=2 shiftwidth=2 expandtab fenc=utf-8 spelllang=en ft=sh
#===============================================================================
#
# DESCRIPTION: Apply security and bug fixes to GitLab.
#
#===============================================================================
import PT_PC_UTIL:StringMap;
import PTEM_CONFIG:IEMConfigurationPlugin;
import PTEM_CONFIG:PTEMHelpMessage;
import PTEM_CONFIG:PTEMVariableProperty;
import PTEM_CONFIG:EMConfigurationPlugin;
class IOGatewayServiceURLs extends PTEM_CONFIG:EMConfigurationPlugin
method getPluginHelpMessage() Returns PTEM_CONFIG:PTEMHelpMessage;
method getProperties() Returns array of PTEM_CONFIG:PTEMVariableProperty;
@iversond
iversond / user_data.ps1
Created May 6, 2020 14:19
.conf 2020 user provisioning script
# Escape any variables that are not passed by Terraform ($$)
$hostname = "${hostname}"
# Set NODENAME Env Var
[Environment]::SetEnvironmentVariable("NODENAME", $hostname)
[Environment]::SetEnvironmentVariable("NODENAME", $hostname, [System.EnvironmentVariableTarget]::Machine)
# Add hosts Entry
# This is needed so the pt_pia status checking works
# The cloned instance does not update hosts, so we do it ourselves
@iversond
iversond / disable_prcs_pn.sql
Created December 17, 2019 20:36
Disable Process Scheduler Push Notifications
-- Remove PRCS Request Submitted notifications
update sysadm.PSPTPNCOLLEVTS set event_name = ' ' where PTPNCOLLNAME = 'PRCSPTPNCOLLECTION';
commit;
-- Validation: Collection PRCSPTPNCOLLECTION should have no event_name set
select * from sysadm.PSPTPNCOLLEVTS where PTPNCOLLNAME = 'PRCSPTPNCOLLECTION';
@iversond
iversond / .bashrc
Created December 9, 2019 15:47
Cloud Manager profile
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
PATH=$PATH:/opt/puppetlabs/puppet/bin; export PATH
if tput setaf 1 &> /dev/null; then