This file contains hidden or 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
| #!/bin/bash | |
| CMOD_HOST="http://vfcmod105.mydom.com:9085" | |
| ACCESS_KEY="odrestapi1-R____2A" | |
| SECRET_KEY="iH_____pQS" | |
| # ── CMODSharedKey (V1 - includes server URL) ────────────── | |
| cmod_curl_v1() { | |
| local METHOD="$1" URI="$2" BODY="${3:-}" | |
| local DATE=$(date -u "+%Y-%m-%dT%H:%M:%SZ") | |
| local STS=$(printf '%s\n%s\n%s\n%s\n%s' \ |
This file contains hidden or 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
| # ----------------------------- | |
| # VARIABLES | |
| # ----------------------------- | |
| $myName = "myAppCert48" | |
| $certName = "CN=$myName" | |
| $certValidity = 48 # months | |
| $certPath = "Cert:\CurrentUser\My" | |
| $pfxOutput = "C:\temp\$myName.pfx" | |
| $cerOutput = "C:\temp\$myName.cer" | |
| $pfxPassword = Read-Host "Enter PFX password" -AsSecureString |
This file contains hidden or 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
| #in bash run this for env | |
| #source my-venv/bin/activate | |
| #python | |
| from datetime import datetime | |
| import os | |
| from plexapi.server import PlexServer | |
| baseurl = 'https://50-____removed____2a1922.plex.direct:32400' | |
| token = 'X---removed---Kb' | |
| plex = PlexServer(baseurl, token) |
This file contains hidden or 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
| #### create Folder | |
| # Generate timestamp | |
| $myDate = get-date -uformat "%Y-%m-%d_%s" | |
| $folderName = "tilo_folder_$myDate" | |
| # Define URL and credentials | |
| $url = "http://99.99.97.146:8077/cmis/browser/Y8/root" | |
| $pair = "admin:mypass" | |
| $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair)) | |
| $basicAuthValue = "Basic $encodedCreds" |
This file contains hidden or 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
| <Configuration status="info" packages="org.apache.chemistry.opencmis.workbench"> | |
| <Appenders> | |
| <ClientWriterAppender name="logframe"> | |
| <PatternLayout pattern="> %d{HH:mm:ss} %5.5p %40.40c: %m%n%throwable{50}" /> | |
| </ClientWriterAppender> | |
| <!-- Console appender --> | |
| <Console name="Console" target="SYSTEM_OUT"> | |
| <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c - %m%n"/> | |
| </Console> | |
| </Appenders> |
This file contains hidden or 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
| goaccess -f u_ex150629.log --log-format "$(cat u_ex150629.log | ./goiisformat.sh)" --date-format '%Y-%m-%d' --time-format '%H:%M:%S' |
This file contains hidden or 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
| ### test on k8s | |
| #kubectl run tilotmptest --image=registry.access.redhat.com/ubi8/openjdk-8-runtime --wait --restart=Never --command dd if=/dev/zero of=/tmp/testfile bs=500k count=1024 | |
| #kubectl logs tilotmptest && kubectl delete pod tilotmptest | |
| # 1 GB | |
| kubectl run tilotmptest --image=registry.access.redhat.com/ubi8/openjdk-8-runtime --attach --rm --restart=Never --command dd if=/dev/zero of=/tmp/testfile bs=1000k count=1024 | |
| # 5 GB | |
| kubectl run tilotmptest --image=registry.access.redhat.com/ubi8/openjdk-8-runtime --attach --rm --restart=Never --command dd if=/dev/zero of=/tmp/testfile bs=5000k count=1024 | |
| ##test on docker | |
| #100MB |
This file contains hidden or 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
| ## IBM Cloud Test upload curl style | |
| # make sure your endpoint is align with your S3 bucket otherwise you get "The specified bucket does not exist" | |
| # seems that IBM want AWS Sign V4 (AWS Signature Version 4) | |
| # curl feature --aws-sigv4 (requires newer curl like 8.x) consider using container if your local curl is not new enough | |
| # docker run -ti curlimages/curl sh | |
| date=`date +%Fat%s` | |
| fileName="test-tilo-${date}.txt" | |
| echo "test tilo here at $date" > $fileName | |
| s3Bucket="my-icos-bucket-mon01" |
This file contains hidden or 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
| subs=( | |
| 52zzzzzzzzzzzzzzzzzzzzzzzzzzzzz9b6dd | |
| a2zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz480d | |
| 1azzzzzzzzzzzzzzzzzzzzzzzzzzzzzz9a1e | |
| ) | |
| ##now run | |
| for sub in ${subs[@]} | |
| do | |
| echo "$(date -Is) Now work on $sub" |
This file contains hidden or 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
| ### Call like this. | |
| ### .\XMLconvert.ps1 <<Folder with XML to convert>> <<your-template.xsl>> << output folder >> | |
| ### .\XMLconvert.ps1 C:\temp\test-pretty-print C:\temp\test-pretty-print\gcd-prettyprint-template.xsl C:\temp\test-pretty-print\out | |
| param ($xml, $xsl, $output) | |
| if (-not $xml -or -not $xsl -or -not $output) | |
| { | |
| Write-Host "& .\xslt.ps1 [-xml-folder] xml-input-folder [-xsl] xsl-input [-output-folder] transform-output-folder" | |
| exit; |
NewerOlder