hakk

software development, devops, and other drivel
Tree lined path

Docs

HTML templating in Go

Within the Go Standard library HTML package there’s a template package which enables generating HTML page from a rich templating engine with the output safe against code injection. This means there is no need to worry about XSS attacks as Go parses the HTML template and escapes all inputs before displaying it to the browser. Let’s take a look at a simple example. This example will use a couple of structs to store data about some people and then display that data in an HTML table. Read more...

Python date string to date object

If you have a date string and need to convert it into a date object, how can it be converted to a date object using Python? Python includes within the datetime package a strptime function, here’s an example usage: >>> import datetime >>> datetime.datetime.strptime('2022-10-30T14:32:41Z', "%Y-%m-%dT%H:%M:%S%z") datetime.datetime(2022, 10, 30, 14, 32, 41, tzinfo=datetime.timezone.utc) Now that it’s a date object and can be manipulated as needed. If the date string you have doesn’t match this format, check out the format codes table to find the necessary directives. Read more...

Download a file from the web using PowerShell

The Invoke-WebRequest command in PowerShell is very powerful and can be used to do much more then downloading a file. Check out the Invoke-WebRequest documentation page to learn more. Download a file from the web (http, https) Invoke-WebRequest -Uri "http://192.168.100.123:3000/myzipfile.zip" -OutFile "C:\Documents\myzipfile.zip" The above command well download a file from the web (in this case a local ip address) and save if under your Documents folder. Need to Extract a zip file? Read more...

How to unzip a file in PowerShell?

Have a .zip file and need to extract its entire contents using Powershell? No problem, it’s built in! Since PowerShell version 5+, there is an Expand-Archive command built in: Expand-Archive -Path myzipfile.zip -DestinationPath C:\extract\to\here Not sure which version of PowerShell you have? $PSVersionTable.PSVersion Find more information: man Expand-Archive Need to Create a zip file? Check out Compress-Archive in PowerShell

How to zip file(s) in PowerShell?

Have some files and need to create a zip archive using Powershell? No problem, it’s built in! Since PowerShell version 5+, there is an Compress-Archive command built in: Compress-Archive running in PowerShell Compress-Archive -Path file.txt, file2.txt -CompressionLevel Fastest -DestinationPath C:\compress\to\here\myzipfile.zip Note: There’s a 2 GB max file size limit due to a limitation of the underlying API. Not sure which version of PowerShell you have? $PSVersionTable.PSVersion Use Splatting As seen in the example these lines can get long! Read more...

How to list files in a directory using Go [2023]

In Go there are a couple of options to list the files of a directory using the standard library. In this article you will find a list of three different methods. Note: Be aware that ioutil.ReadDir is deprecated since Go 1.16. Instead os.ReadDir should be used (shown in this article). os.ReadDir os.ReadDir is included in the standard library in the os package. Check out the documentation for more information. It’s a drop in replacement from ioutil. Read more...

Change PTWEBSERVER Password

When creating a new PeopleSoft webserver domain, PTWEBSERVER is the user id set by default. In order to avoid issues this id should only be used for the webserver domain configuration. If the password for this user id gets changed it may cause the webserver to not boot up. If the PTWEBSERVER password ever needs to be changed, follow the below steps: Change the online password for PTWEBSERVER: This can be done by navigating to Read more...

PeopleTools Object Version Tables

PeopleTools Object Versions Record Description PSLOCK This table is used for version control PSOPTIONS This table is used to turn the change control enabling feature on or off. PSVERSION This table holds the version number details

PeopleTools Process Scheduler Tables

PeopleTools Process Type Details Record Description PS_PRCSDEFN Contains process type and process names PSPRCSLOCK Contains a single record, this gets updated when a process is submitted PeopleTools Process Status Record Description PSPRCSQUE Holds the process request details and should be in sync with PSPRCSRQST. PSPRCSRQST This table holds the process submitted details PS_CDM_LIST Contains the process instance details. Should be in sync with PS_CDM_AUTH PS_CDM_AUTH Contains the process instance details PeopleTools Report Node Details Record Description PS_CDM_DIST_NODE This table holds the report node information which contains the report repository details PS_CDM_DISTSTATUS Contains the definition of report status PeopleTools Batch Server Details Record Description PS_SERVERDEFN Contains the server definitions PSSERVERSTAT Gives information about the batch server status

PeopleTools Security Tables

Page Nav User Tables Roles Permission Lists PeopleSoft Login Details and Authorization Query Security Tree Example SQL Queries Security is a very important part of any PeopleSoft application. It determines what pages users can see all the way down to which rows. It may seem overwhelming at first but don’t worry; it’s pretty straightforward once you learn all the pieces and how they’re connected. Below you will find a list of the Main PeopleTools Security Records along with a brief summary of their purpose. Read more...