Skip to content

Instantly share code, notes, and snippets.

@accasey
accasey / process_monitor.js
Created April 4, 2019 14:00
Boomarklet from navigating to the Process Monitor
// credit to David Wiggins from http://jjmpsj.blogspot.com/2019/03/do-i-have-to-use-navigator.html
javascript:var a=window.frames.location.pathname.match(/^\/ps[pc]\/(.+?\/)(.+?\/)(.+?\/)/),b=a[1];-1<b.indexOf("_")&&(b=b.substr(0,b.indexOf("_"))+"/");void window.open("/psp/"+b+"_newwin/"+a[2]+a[3]+"c/PROCESSMONITOR.PROCESSMONITOR.GBL","","");
CREATE USER "PEOPLE" PROFILE "MY_SERVICE_PROFILE" IDENTIFIED BY "password" DEFAULT TABLESPACE "PSDEFAULT"
TEMPORARY TABLESPACE "PSTEMP" ACCOUNT UNLOCK;
GRANT CREATE SESSION TO "PEOPLE";
GRANT SELECT ON "SYSADM"."PSACCESSPRFL" TO "PEOPLE";
GRANT SELECT ON "SYSADM"."PSOPRDEFN" TO "PEOPLE";
GRANT SELECT ON "SYSADM"."PSSTATUS" TO "PEOPLE";
GRANT SELECT ON "SYSADM"."PSACCESSPROFILE" TO "PEOPLE";
GRANT "CONNECT" TO "PEOPLE";
@accasey
accasey / reset_pinned_tiles_url.sql
Created November 2, 2018 15:05
Reset the URLs for the pinned tiles
-- MSSQL
UPDATE PS_PT_PORTAL_PINTO
SET PORTAL_URLTEXT = REPLACE(PORTAL_URLTEXT,'old_path','new_path')
/
-- ORACLE
UPDATE PS_PT_PORTAL_PINTO
SET PORTAL_URLTEXT = REGEXP_REPLACE(PORTAL_URLTEXT,'old_path','new_path')
/
@accasey
accasey / bip_output.pcode
Created October 15, 2018 08:58
Generate the file in the Process Monitor secondary page
Local string &path;
SQLExec("SELECT PRCSOUTPUTDIR FROM PS_CDM_LIST WHERE PRCSINSTANCE = :1", &processInstance, &path);
%This.ReportDefn.OutDestination = &path;
%This.ReportDefn.ProcessReport(%This.TemplateId, %Language_User, %Date, %This.OutputFormat);
/* publish */
If %OutDestType = 6 Then /* Web */
%This.ReportDefn.Publish("", "", "", &processInstance);
Else;
If %OutDestType = 3 Then /* Printer */
%This.ReportDefn.PrintOutput(%FilePath);
@accasey
accasey / get-windows-service.ps1
Created October 9, 2018 13:44
Get and delete a windows service
# Use to get Windows service, and delete it
$foo= Get-WmiObject -Class Win32_Service -Filter "Name='<insert_service_name>'"
$foo.delete()
@accasey
accasey / appserver_win_service.rb
Last active October 9, 2018 13:43
Create an Application Server service which uses ruby
LOG_FILE = "d:\\psoft\\config\\appserv\\CMAUAT03\\appserver_win_service.log"
begin
require 'rubygems'
require 'win32\\daemon'
include Win32
class AppServerDomainCMAUAT03Daemon < Daemon
@accasey
accasey / install.ps1
Created October 8, 2018 08:47
Bootstrap code for the DPK
# Network filesystem variables
$network_software_base = "\\MSFSSHARED\BIS\Software\ServerSoftware\PeopleSoft CMA"
$network_peopletools_base = Join-Path $network_software_base "PeopleTools_8.56"
$network_puppet_base = Join-Path $network_peopletools_base "utils\puppet"
$network_archive_base = Join-Path $network_peopletools_base "archives"
# Local filesystem variables.
$local_dpk_base = "d:\psoft"
$local_software_base = "d:\software"
$local_temp_base = "d:\temp"
@accasey
accasey / run_puppet.bat
Created June 28, 2018 09:23
Puppet manifests
cd /d d:\psoft\dpk\puppet\production\manifests
rem like this:
"C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" apply --confdir=d:\psoft\dpk\puppet --environment=CMADEV02 setWinServiceUser.pp --modulepath d:\psoft\dpk\puppet\production\modules --debug --trace
rem or like this:
"C:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" apply -e "include ::pt_profile::pt_tools_preboot_config" --environment=CMASBX90 --modulepath d:\psoft\dpk\puppet\production\modules --confdir=d:\psoft\dpk\puppet site.pp --debug --trace
@accasey
accasey / hiera.yaml
Created June 28, 2018 09:11
Hiera hierarchy
---
:backends:
- eyaml
- yaml
:hierarchy:
- "%{::environment}/%{::environment}"
- "%{::region}/%{::region}"
- "%{::database_class}/%{::database_class}"
- "common/acm"
@accasey
accasey / unzip.pcode
Created May 19, 2018 10:28
Unzip a file in PeopleCode using Java
Function unzip(&inputZipFile, &targetDir);
Local JavaObject &zipFileInputStream = CreateJavaObject("java.io.FileInputStream", &inputZipFile);
Local JavaObject &zipInputStream = CreateJavaObject("java.util.zip.ZipInputStream", &zipFileInputStream);
Local JavaObject &zipEntry = &zipInputStream.getNextEntry();
Local JavaObject &buf = CreateJavaArray("byte[]", 1024);
Local number &byteCount;
While &zipEntry <> Null;
If (&zipEntry.isDirectory()) Then;
REM ** do nothing;