Wednesday, December 27, 2023

Fix for error- Failed to validate certificate; Oracle Apps java

 


If there is an error with using OCSP. You can reconfigured Java to use CRL only, and the application comes up normally. 

Wednesday, December 20, 2023

PowerShell script to update screen resolution on logon Windows Server;

 # PowerShell script to change screen resolution


# Define desired resolution

$Width = 1920

$Height = 1080


# Get the current video controller's configuration

$Display = Get-WmiObject -Namespace root\\wmi -Class WmiMonitorBasicDisplayParams


# Filter the configurations to the desired resolution

$Config = Get-WmiObject -Class Win32_VideoController | ForEach-Object {

    $_.SupportedDisplayModes | Where-Object {

        $_.VideoModeDescription -eq "$Width x $Height"

    }

}


# If the desired resolution is supported, set it

if ($Config) {

    $Config | ForEach-Object {

        $_.PSScriptRoot.SetDisplayMode($Width, $Height, 60)

    }

} else {

    Write-Host "The desired resolution is not supported."

}



Steps to use this script:

  • Modify the Resolution: Change the $Width and $Height variables to your desired screen resolution.
  • Save the Script: Save the script as a .ps1 file, for example, Set-Resolution.ps1.
  • Set Execution Policy: You might need to set the execution policy to allow the script to run. Open PowerShell as an administrator and run Set-ExecutionPolicy RemoteSigned.
  • Schedule the Script: Use the Task Scheduler to run the script at logon. Create a new task that triggers at logon and runs the script.
  • Test the Script: Test the script by running it manually in PowerShell or by logging out and back in to see if it triggers.

Important Notes:

  • Compatibility: This script may not work on all systems, as it depends on the compatibility of WMI with your hardware.
  • Permissions: Running this script might require administrative privileges.
  • Testing: Always test scripts in a controlled environment before deploying them broadly.

This script is a basic example and may need to be adapted for specific use cases or hardware configurations.

Friday, December 15, 2023

Print quotes to Log; VB.NET

 


Prints ->
if(IsNothing(CurrentRow("Deductions")),"",CurrentRow("Deductions").ToString)

Thursday, September 14, 2023

Replace the text before the second occurrence of "-"

 To replace the text before the second "-" in Notepad++, you can use the following regular expression:


Find: `^.*?-(.*?)-`


Replace with: `Your Replacement Text-`


Explanation:


- `^` : Matches the start of the line.

- `.*?` : Matches any characters lazily (non-greedy) before the first "-".

- `-(.*?)-` : Matches the first "-" followed by any characters lazily (non-greedy) until the second "-", capturing the characters in between.


The replace expression replaces the matched text with the desired replacement followed by a "-". 


Make sure to enable the "Regular expression" search mode in Notepad++ before using this expression.

Friday, September 8, 2023

PGP Encryption for Files

 PGP (Pretty Good Privacy) is a popular program that encrypts and decrypts email and files. It also authenticates messages with digital signatures. PGP is a widely used standard for protecting sensitive information and verifying the sender of files.


https://pgptool.github.io/








Friday, September 1, 2023

AWS Apps; Create Listener to be called from external network

 EC2->Load balancer->links

Cloud Watch for logs

Client Secrets -> To get DB credentials

Lambda ->Make sure right Data Center is selected

Add Listener for Lambda to be called from external network.