Skip to content

Instantly share code, notes, and snippets.

View JesperJ's full-sized avatar

Jesper JesperJ

  • Kalmar Kommun
View GitHub Profile
@JesperJ
JesperJ / datalineagefromview.sql
Created February 24, 2023 14:08
MSSQL Data lineage from view
DECLARE @view_name sysname = '';
WITH cte AS (
SELECT DISTINCT referenced_major_id
FROM sys.sql_dependencies
WHERE OBJECT_NAME(object_id) = @view_name
AND is_updated = 0
)
SELECT o.name AS table_name, STRING_AGG(c.name, ', ') AS columns
FROM cte
@JesperJ
JesperJ / CronTab-Expander.sql
Last active December 1, 2022 11:40 — forked from manfredk/CronTab-Expander.sql
Expand CronTab expressions with SQL / T-SQL
USE Exercises
GO
/* ***********************************************************************************************
*
* CRONTAB EXPANDER
*
* ***********************************************************************************************/
/**************************************************************************************************
@JesperJ
JesperJ / Get-Win10WlanPassword
Created October 4, 2022 11:48
Get Windows 10 Wlan Password
function Get-Win10WlanPassword {
(netsh wlan show profiles) | Select-String "\:(.+)$" | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name="$name" key=clear)} | Select-String "Key Content\W+\:(.+)$" | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize
}
@JesperJ
JesperJ / Get-SSLCertificateDates
Last active February 14, 2022 09:55
Check for expiring SSL certificates
# Written for Powershell 5.1
function Get-SSLCertificateDates {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[String]
$URL
)
[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
$req = [Net.HttpWebRequest]::Create($URL)
function Update-UiPathREADME {
<#
.SYNOPSIS
Creates a markdown-file for UiPath Library
.DESCRIPTION
Creates a markdown-file compatible with github-markdown for a UiPath Library
.PARAMETER ProjectFolder
Folder for the UiPath Library. Uses current directory if nothing is provided
@JesperJ
JesperJ / Write-SqlTableFromObj.ps1
Last active March 16, 2020 15:16
Insert custom object to Database
function Write-SqlTableFromObj {
<#
.SYNOPSIS
Insert custom object to Database
.DESCRIPTION
Assume PSCustomObject key names is SQL Table column names and inserts values to SQL Table
.PARAMETER ServerInstance
SQL Server Instance
/* Incident Tasks */
app.custom.formTasks.add('Incident', null, function(formObj, viewModel){
formObj.boundReady( function () {
getRelatedKBs();
});
});
/* Service Request Tasks */