hakk

software development, devops, and other drivel
Tree lined path

Docs

PeopleTools Update User Password DataMover

Useful for when the main user id gets locked out. First log into Datamover in bootstrap mode. Then using the script below update the users password. Note: the script will vary depending on the peopletools version. I forget what the version is exactly, 8.54 I believe. For earlier versions of PeopleTools: update PSOPRDEFN set OPERPSWD = 'password', ENCRYPTED = 0 where OPRID = 'OPRID'; -- to encrypt the password encrypt_password OPRID; For later versions of PeopleTools Read more...

PeopleTools Version Details Tables

PeopleTools Version Details Record Description PSRELEASE This table holds the application release details PSSTATUS This table gives the peopletools information

Start Data Mover Bootstrap Mode

If the PS password has been lost or otherwise hosed, use bootstrap mode to make things right again. In order to start Datamover in bootstrap mode, use the system access ID and access password. For example by default it’s SYSADM. Learn how to update a user password including the PS password if needed.

User Security Join Table (SJT) Jobs

All of the SJT (Security Join Tables) jobs that that joins security information from other tables in the database into a temporary table on the application server for use in business rules. SJT_OPR_CLS: Contains the User IDs with their data permission lists. SJT_CLASS_ALL: Contains the data permission information for all the data permission lists that are given data access on the ‘Security by Dept Tree’ page or ‘Security by Permission List’ page. Read more...

Golang Convert from Int to Hex

Converting from an Integer to hex is easy in Golang. Since a hex is really just an Integer literal, you can ask the fmt package for a string representation of that integer, using fmt.Sprintf(), and the %x or %X format. package main import ( "fmt" ) func main() { for i := 1; i < 20; i++ { h := fmt.Sprintf("0x%x", i) fmt.Println(h) } } Golang Play Output: 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10 0x11 0x12 0x13 Convert back to int package main import ( "fmt" "strconv" ) var hex = []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "10", "11", "12", "13"} func main() { for _, h := range hex { i, _ := strconv. Read more...

Golang Split Host Port to Separate Variables

Getting just the host or port from the “host:port” form is easy using the SplitHostPort function from the net package. Below are some example uses of the function. As seen below, IPv6 addresses in hostport must be enclosed in square brackets. package main import ( "fmt" "net" ) func main() { // IPv4 host, port, err := net.SplitHostPort("172.217.7.14:443") if err != nil { fmt.Println(err) } fmt.Println(host, port) // IPv6 host, port, err = net. Read more...

Golang Convert File Size to a human friendly format

Get file size in human-readable units like kilobytes (KB), Megabytes (MB) or GigaBytes (GB) 1 KilloByte == 1024 Bytes 1 Megabyte == 1024*1024 Bytes 1 GigaByte == 102410241024 Bytes package main import ( "fmt" "log" "math" "os" "strconv" ) var ( suffixes [5]string ) func Round(val float64, roundOn float64, places int ) (newVal float64) { var round float64 pow := math.Pow(10, float64(places)) digit := pow * val _, div := math. Read more...

Golang Listing Directory Contents and Sorting by File Modified Time

In this example we will be listing the contents of a directory in go and sorting by date. To get the list of files we will use the os.ReadDir function from the os package. This function returns a slice sorted by file name which contains elements of os.FileInfo type which will enable us to get the last modified time. To sort the files we will use the modification time with the sort package along with the After and Before functions from the time package. Read more...

Golang Listing Directory Contents and Sorting by File Name

Listing the contents of a directory in go and sorting by filename. To get the list of file we will use the ReadDir function from the os package. To sort the files we will use the sort package to arrange the filenames alphabetically ascending or descending. package main import ( "fmt" "io/fs" "log" "os" "sort" ) func checkErr(err error) { if err != nil { log.Fatal(err) } } // this is the default sort order of golang ReadDir func SortFileNameAscend(files []fs. Read more...

Golang Listing Directory Contents and Sorting by File Size

Listing the contents of a directory in go and sorting by file size. To get the list of file we will use the ReadDir function from os package. To sort the files we will use the sort package and compare the file sizes to arrange them in ascending or descending order. package main import ( "fmt" "io/ioutil" "log" "os" "sort" ) func SortFileSizeAscend(files []os.FileInfo) { sort.Slice(files, func(i, j int) bool { return files[i]. Read more...