Skip to content

Instantly share code, notes, and snippets.

View iversond's full-sized avatar

Dan Iverson iversond

View GitHub Profile
@iversond
iversond / profile.ps1
Created August 2, 2016 19:42
PS Admin Workstation Profile for PowerShell
# Create symlink for Puppet Gold folder to c:\puppetGold
Invoke-Expression -Command "cmd.exe /c mklink /D puppetGold `"\\long\network\share\path\to\the\puppet\gold\folder\`""
function pg {set-location -path "c:\puppetGold"}
Write-Host "Enter your Domain credentials to automate PowerShell authentication" -Foreground White -Background Red
$dba_credential = Get-Credential
Write-Host "`t [Function] pg changes directory to Puppet Gold Directory `n`t`t'c:\puppetGold'" -Foreground Green
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=https://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=https://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
@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 / appConfig.pp
Created December 7, 2016 20:08
Puppet manifest to update App Server config file from psft_customizations.yaml config_settings: section
$ensure = hiera('ensure')
$appserver_domain_list = hiera('appserver_domain_list')
$appserver_domain_list.each |$domain_name, $appserver_domain_info| {
notice("Configuration for AppServer domain ${domain_name}")
$cfgFile = "${appserver_domain_info['ps_cfg_home_dir']}\\appserv\\${domain_name}\\psappsrv.cfg"
$config_settings = $appserver_domain_info['config_settings']
$config_settings.each |$setting, $config_info| {
@iversond
iversond / app_dynamic_cfg.pp
Created December 30, 2016 03:44
Uses a custom `dynamic_config:` hash in `psft_customizations.yaml` to update dynamic changes in `psappsrv.cfg`
$ensure = hiera('ensure')
$base = hiera('peoplesoft_base')
$appserver_domain_list = hiera('appserver_domain_list')
$appserver_domain_list.each | $domain_name, $appserver_domain_info | {
$cfg_file = "${appserver_domain_info['ps_cfg_home_dir']}/appserv/${domain_name}/psappsrv.cfg"
$dynamic_config = $appserver_domain_info['dynamic_config']
$dynamic_config.each | $setting, $config_value | {
host {'localapp':
ensure => present,
host => 'localapp',
ip => "${::ipaddress}",
}
$pia_domain_list = hiera('pia_domain_list')
$pia_domain_list.each | $domain_name, $pia_domain_info | {
$ps_cfg_home_dir = $pia_domain_info['ps_cfg_home_dir']
@iversond
iversond / touch-icons.pp
Last active March 23, 2017 15:05
Deploy a favicon.zip file to PORTAL.war and signin.html to each site. Uses the PowerShell 4+ command 'Expand-Archive'.
$share_path = "//lm-d1/temp"
$pia_domain_list = hiera('pia_domain_list')
$pia_domain_list.each | $domain_name, $pia_domain_info | {
$cfg_home = $pia_domain_info['ps_cfg_home_dir']
$baseWebPath = "${cfg_home}/webserv/${domain_name}/applications/peoplesoft/PORTAL.war"
file {"io-favicons-zip-${domain_name}":
ensure => $ensure,
@iversond
iversond / processJSON.pcode
Created March 29, 2017 17:47
Process inbound JSON. Not very dynamic, but using some basic JSON types in PeopleCode to parse the message data.
method Process
/+ &_str as String +/
/+ Returns Boolean +/
/* Try using the JsonObject */
Local JsonParser &parser = CreateJsonParser();
Local boolean &status = &parser.Parse(&_str);
Local JsonObject &jo = &parser.GetRootObject();
Local JsonArray &jArray = &jo.GetJsonArray("Updates");
Local Record &m_email_stg = CreateRecord(Record.M_EMAIL_STG);
@iversond
iversond / psft_customizations.yaml
Last active May 8, 2020 08:11
Sample psft_customizations.yaml File
---
region: DEV
application: HR
server_type: webApp
ensure: present
env_type: midtier
tools_version: 8.55.13
domain_type: all
peoplesoft_base: e:/psoft
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}"