Skip to content

Instantly share code, notes, and snippets.

View iversond's full-sized avatar

Dan Iverson iversond

View GitHub Profile
@iversond
iversond / enableRubyGems.ps1
Last active January 17, 2022 16:34
For DPK installations on Windows, this script will fix the RubyGems CA issue and add the Puppet-based RubyGems location to `PATH`
# Enable RubyGems
#
# The RubyGems included with the DPK can't download from RubyGems.org due to an oudated SSL Certificate
#
# invoke-webrequest https://gist.githubusercontent.com/iversond/e56e608cf8fa65f7160416f4c434da57/raw/43902b10b23efac88c58a78c0be66f701cdec4b1/enableRubyGems.ps1; . $env:TEMP\enableRubyGems.ps1
#
$puppetGemFolder = Resolve-Path 'C:\Program Files\Puppet Labs\Puppet\sys\ruby\lib\ruby\*\rubygems\ssl_certs\'
#Invoke-WebRequest https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem -OutFile $puppetGemFolder\RubyGemsCA.pem
Invoke-WebRequest https://github.com/rubygems/rubygems/blob/270f8f9f2ea39d2e35cb1063b88dcee26cfaf070/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem -OutFile $puppetGemFolder\RubyGemsCA.pem
@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 / psft_customizations.yaml
Last active November 21, 2021 01:01
Enable the WSL and PeopleCode Debugger services when building a PeopleSoft Image.
---
appserver_domain_list:
"%{hiera('appserver_domain_name')}":
os_user: "%{hiera('domain_user')}"
ps_cfg_home_dir: "%{hiera('ps_config_home')}"
template_type: small
db_settings:
db_name: "%{hiera('db_name')}"
db_name: PSFTDB
db_user: PS
db_user_pwd: PS
db_connect_id: people
db_connect_pwd: peop1e
pia_webprofile_name: DEV
pia_host_name: "%{::ec2_hostname}"
db_host_name: "%{::ec2_hostname}"
@iversond
iversond / domains.yaml
Last active November 21, 2021 00:57
Default domain configuration for the DPK. Used with Hiera Hashing to allow environments to overrride/add to the defaults
---
# TNSnames.ora
tns_admin_list:
"%{hiera('db_name')}":
db_host: "%{hiera('db_server')}"
db_port: "%{hiera('db_port')}"
db_protocol: TCP
db_service_name: "%{hiera('db_name')}.psadmin.io"
# Application Servers
@iversond
iversond / loadcache.pp
Last active November 21, 2021 00:55
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.
$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 / fixdpkbug.pp
Last active July 9, 2021 17:15
Fix a DPK bug that prevents non-ACM app engines from running. This manifest expects the puppetlabs-powershell modules to be installed.
$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 / 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 / x-OPPRIDLogField
Last active April 1, 2021 20:27
WebLogic HTTP Header to log OPRID for PeopleSoft pages to the access log (from @ripleymj).
import weblogic.servlet.logging.CustomELFLogger;
import weblogic.servlet.logging.FormatStringBuffer;
import weblogic.servlet.logging.HttpAccountingInfo;
import java.lang.reflect.Method;
public class OPRIDLogField implements CustomELFLogger
{
public void logField(HttpAccountingInfo metrics, FormatStringBuffer buff)
{
@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.
#
#===============================================================================