Skip to content

Instantly share code, notes, and snippets.

@iversond
iversond / convertToLookup.ps1
Created Jun 3, 2021
Convert Hiera to Lookup for the DPK
View convertToLookup.ps1
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 Oct 27, 2020
Rundeck script to patch GitLab
View patchGitlab.sh
#!/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.
#
#===============================================================================
View IOGatewayServiceURLs.peoplecode
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
.conf 2020 user provisioning script
View user_data.ps1
# 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 Dec 17, 2019
Disable Process Scheduler Push Notifications
View disable_prcs_pn.sql
-- 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 Dec 9, 2019
Cloud Manager profile
View .bashrc
# 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
@iversond
iversond / fixdpkbug.pp
Last active Jul 9, 2021
Fix a DPK bug that prevents non-ACM app engines from running. This manifest expects the puppetlabs-powershell modules to be installed.
View fixdpkbug.pp
$dpk_location = hiera('dpk_location')
case $::osfamily {
'windows': {
exec { 'fix-dpk-bug':
command => "(gc ${dpk_location}/puppet/production/modules/pt_config/lib/puppet/provider/psae.rb) | %{ \$_ -replace \"ae_program_name=`\"PTEM_CONFIG`\"\", \"ae_program_name=resource[:program_id]\" } | set-content ${dpk_location}/puppet/production/modules/pt_config/lib/puppet/provider/psae.rb",
provider => powershell,
}
}
'RedHat', 'linux': {
@iversond
iversond / loadcache.pp
Last active Sep 18, 2020
This manifest can be used to run the LOADCACHE job on a fresh PeopleSoft Image. In your `psft_customizations.yaml` file, add `Cache Settings/ServerCacheMode: 1` to the app server `config_settings` section. This manifest expects the puppetlabs-powershell modules to be installed.
View loadcache.pp
$ps_home_dir = hiera('ps_home_location')
$oracle_home_location = hiera('oracle_server_location')
$tns_dir = hiera('tns_dir')
case $::osfamily {
'windows': {
$gem_home = 'c:/program files/puppet labs/puppet/bin'
exec { 'install-psadmin_plus':
command => "${gem_home}/gem install psadmin_plus",
provider => 'powershell'
@iversond
iversond / shell_template.sh
Last active Sep 5, 2019
Shell script template to use when creating new scripts. Borrows work from JR Bing's provision.sh in ps-vagabond
View shell_template.sh
#!/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: shell_template.sh
#
# USAGE: ./shell_template.sh
#
@iversond
iversond / slack_history.py
Created Aug 11, 2019 — forked from minniel/slack_history.py
Download Slack Channel/PrivateChannel/DirectMessage History
View slack_history.py
from slacker import Slacker
import json
import argparse
import os
import shutil
import copy
from datetime import datetime
# This script finds all channels, private channels and direct messages
# that your user participates in, downloads the complete history for