Skip to content

Instantly share code, notes, and snippets.

View levi-turner's full-sized avatar

Levi Turner levi-turner

  • Qlik
  • Boston, MA
View GitHub Profile
#--------------------------------------------------------------------------------------------------------------------------------
#
# Script Name: qs-qrs-telemetry_task_fix.ps1
# Description: A PowerShell script to fix & schedule tasks for Telemetry Dashboard project
# Dependency: None
#
# Version Date Author Change Notes
# 0.1 2020-04-27 Levi Turner Initial Version
# Many thanks to:
# https://stackoverflow.com/questions/19741716/how-do-i-get-date-1-formatted-as-mm-dd-yyyy-using-powershell
@levi-turner
levi-turner / qs-cli-UserLicenseAutoAssigner.ps1
Last active August 5, 2020 01:55
A Qlik-Cli backed PowerShell script to assign users user access passes from a flat file (XLSX or CSV)
#Requires -Modules Qlik-Cli
# Assumes the ImportExcel module: `Install-Module -Name ImportExcel`
#############################
## Configurable Parameters ##
#############################
$inputFile = '<absolute file path>/<filename>.<fileExtension>'
# column number of sheet id column in Excel file if using Excel
#$sheetIdColumnNumber = '2'
// Load all QVDs
LOAD *
FROM [lib://Data/ExtensionUsage/*.qvd] (qvd);
// Scramble users
UserScramble:
LOAD
[UserGUID] as [UserGUID],
$objects = @(
'7e54b526-31d5-4599-9af3-38c53ec47042',
'33d2f127-ae6c-4357-855f-ca3d405a6e93',
'87d82e26-48bf-4eb8-9bef-08670cf630d4',
'f6e9214c-2c73-4e8c-b754-a6b0ddc577b7',
'f86b8007-5d76-4d8c-a33e-d9fa50a26836'
)
# Build out headers for QRS API Calls
$hdrs = @{}
1..1000 | ForEach-Object {
Set-Location C:\Temp
$results = .\CacheInitializer.exe --server https://server.company.com --appname "SomeAppName" --proxy VirtualProxy --objects
if ($results.Length -ne 16) {
Write-Host "Failure"}
Write-Host $_
}
// Search for a given listener
search *
| where listenerName_s == 'YourCoolListener' and serverStatus_s != '200' | top 500 by TimeGenerated
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.NETWORK" and Category == "ApplicationGatewayFirewallLog"
| where action_s <> "Allowed"
| where hostname_s == "host.company.com:Port"
#--------------------------------------------------------------------------------------------------------------------------------
#
# Script Name: qs-qrs-telemetry_task_fix.ps1
# Description: A PowerShell script to fix tasks for Telemetry Dashboard project
# Dependency: None
#
# Version Date Author Change Notes
# 0.1 2020-20-22 Levi Turner Initial Version
#--------------------------------------------------------------------------------------------------------------------------------
Orders:
Load
*,
Date((OrderDate) + Floor(Rand()*45)) as ShipDate; // preceding load which loads after the previous calcs so we can add values to OrderDate
Load
chr(round(25 * rand() + 65)) & chr(round(25 * rand() + 65)) & chr(round(25 * rand() + 65)) as Customer, // Customer name between AAA and ZZZ
round(1000000 * Rand()) as Target , // Target Revenue between 0 and 1,000,000
Date((Today()-600) + Floor(Rand()*600)) as OrderDate // Random Dates
AutoGenerate 50;
tasklist | find /i "nginx.exe">nul && Taskkill /F /IM "nginx.exe"
.\nmap.exe -p 443 --script ssl-enum-ciphers -oN poodle_443 127.0.0.1