This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################### | |
##login to source box account | |
boxaccesstoken=$(python /mnt/c/myscripts/box-admin-scripts/box-login-read-json-dynamic.py --jsonpath /mnt/c/myscripts/box-admin-scripts/box-demo-old.json) | |
##read and copy metadata template to other box account | |
myTemplateName="purchaseRequisition" | |
##get source metadata def. | |
sourceJson=$(curl -s -X GET "https://api.box.com/2.0/metadata_templates/enterprise/$myTemplateName/schema" \ | |
-H "Authorization: Bearer $boxaccesstoken") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SQLServer = "mysqlserver1232.westus2.cloudapp.azure.com" | |
$SQLDBName = "ABC_FNGCD" | |
$uid ="sa" | |
$pwd = "my-db-pass123" | |
##modify below query if you want specific GCD version | |
$SqlQuery = "select gcd_blob FROM FNGCD WHERE epoch_id = (select last_epoch_id from FNGCD where epoch_id = 0);" | |
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection | |
$SqlConnection.ConnectionString = "Server = $SQLServer; Database = $SQLDBName; User ID = $uid; Password = $pwd;" | |
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##some examples how to run PS direct command in win task scheduler | |
##run in admin shell | |
##simple style | |
$Trigger = New-ScheduledTaskTrigger -Daily -At "10:15pm" # Specify the trigger settings | |
$User = "NT AUTHORITY\SYSTEM" # Specify the account to run the script | |
$Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument '-Command Get-ChildItem C:\myapp\config\tmp -Recurse | Where LastWriteTime -lt (Get-Date).AddDays(-2) | Remove-Item -Recurse -Force 2>&1 > C:\myapp\logs\ps-script-out.log' # Specify what program to run and with its parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###just soem YQ examples | |
##working | |
yq e '.spec.template.spec.containers[]' keycloak.yaml | |
### | |
yq e '.spec.template.spec.containers[].env[] | select(.name == "KEYCLOAK_ADMIN_PASSWORD") | .value' keycloak.yaml | |
##update | |
yq -r '(.spec.template.spec.containers[].env[] | select(.name == "KEYCLOAK_ADMIN_PASSWORD") | .value) = "myNewPass"' keycloak.yaml | |
wget -q -O - https://raw.githubusercontent.com/keycloak/keycloak-quickstarts/latest/kubernetes/keycloak.yaml | \ | |
yq '(.spec.template.spec.containers[].env[] | select(.name == "KEYCLOAK_ADMIN_PASSWORD") | .value) = "myNewPass"' - | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paste in ACCE bulk operation (select only one item) | |
//works on older CPE 5.5.5 (tested on cpe version ears-5.5.5-2-146) | |
// FN CPE Used: Mozilla Rhino scripting engine check what version in Engine-liberty.ear APP-INF/lib/js.jar | |
importClass(java.lang.System); | |
function OnCustomProcess(CEObject) { | |
var objStore = CEObject.getObjectStore(); | |
objStore.refresh(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$basePath='C:\mini-webserver\' | |
mkdir -p "$basePath/web/.well-known/pki-validation/" | |
##paste the txt file to this location | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
##port 80 requires admin PS | |
$http.Prefixes.Add("http://+:80/") | |
# Start the Http Server | |
$http.Start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paste in ACCE bulk operation (select only one item) | |
//works on CPE 5.5.8 or newer (due to for loop); | |
//see comments below for loop with older version | |
importClass(java.lang.System); | |
function OnCustomProcess(CEObject) { | |
var objStore = CEObject.getObjectStore(); | |
objStore.refresh(); | |
var sapprops = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##based on https://github.com/12Knocksinna/Office365itpros/blob/master/ReportPermissionsApps.PS1 | |
# | |
# ReportPermissionsApps.PS1 | |
# A script using Azure Automation and a managed identity to scan for apps assigned high-priority permissions and report them | |
# for administrator review | |
##install graph PS | |
Install-Module Microsoft.Graph -Scope CurrentUser | |
#Connect-AzAccount -Identity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#PE Tools on container | |
# 1. Downlaod IBM FileNet Process Engine >> PE Java API from ACCE | |
# 2. also CE for jace.jar | |
#create jre or jdk pod | |
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: tilo-jdk-pod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##for PDF invoices with filename like ShawInvoice_01412345678_01Apr2022.pdf | |
for file in Shaw*.pdf | |
do | |
echo "$(date +"%F_%s") Start $file" | |
filedate=$(basename "$file" .pdf | tail -c 10) | |
outFdate=$(date -d $filedate +"%F") | |
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -sOutputFile=${outFdate}_${file} $file | |
echo "$(date +"%F_%s") Done $file" | |
done |
NewerOlder