Skip to content

Instantly share code, notes, and snippets.

@matejskubic
matejskubic / renew self signed certificate.md
Last active April 9, 2024 03:59
Renew Self Signed certificate

To rotate certificates on machines created from the Dynamics 365 for Finance and Operations downloadable VHD, complete the following steps for each certificate. Sample PowerShell scripts are provided where applicable.

  1. Identify which certificates will expire in the next two months.

    Get-ChildItem -path Cert:\LocalMachine\My | Where {$_.NotAfter -lt $(get-date).AddMonths(2)} | Sort NotAfter | Format-Table Subject, Thumbprint, NotAfter

  2. Record the thumbprint of the certificate that needs to be replaced. You will need this in the next step.

  3. Obtain a new certificate for the expired certificate.

nslookup myip.opendns.com resolver1.opendns.com
@matejskubic
matejskubic / list-permissions.sh
Created February 28, 2018 09:41
list find linux file owner and permission recursive
find /opt/bitnami/apps/pootle/ -fprintf pootle.txt %m\\t%u\\t%g\\t%p\\n
tree -pfugi
@matejskubic
matejskubic / VisualStudioReleaseEnvironmentCleanup.ps1
Created September 21, 2017 14:25
VisualStudio Release Environment Cleanup
<#
.SYNOPSIS
.DESCRIPTION
#>
[CmdletBinding()]
Param(
#
@matejskubic
matejskubic / EsbFixer.tt
Created August 31, 2017 14:26
Implement Interface by T4 Text Template Transformation
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="EnvDTE80" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="EnvDTE" #>
<#@ import namespace="EnvDTE80" #>
<#@ output extension=".cs" #>
@matejskubic
matejskubic / createSqlSharedAccessSignature.ps1
Last active November 3, 2022 18:08
Generate SQL shared access signature for azure storage account
[CmdletBinding()]
Param(
# subscription name
[parameter()]
[string]$subscriptionName = 'EA - MSDN - AX - ProdDev - 01'
,
# resource group name
[parameter()]
[string]$resourceGroupName='adaxbackup'
@matejskubic
matejskubic / backupToAzure.sql
Created August 17, 2017 07:55
Backup SQL DB to azure
DECLARE @dbToBackup as sysname = 'AxDB'
DECLARE @container as nvarchar(50) = lower(HOST_NAME())
DECLARE @file as nvarchar(100) = @dbToBackup + N'_' + FORMAT(GETDATE(), N'yyyy-MM-dd_hhmmss') + N'.bak'
DECLARE @destUrl as nvarchar(500) = N'https://storageaccount.blob.core.windows.net/' + @container + N'/' + @file
PRINT @destUrl
BACKUP DATABASE @dbToBackup TO
URL = @destUrl
WITH NOFORMAT, NOINIT, NAME = N'Ax-Full Database Backup', NOSKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO
### Reference: http://deploymentresearch.com/Research/Post/578/Building-the-perfect-Windows-Server-2016-reference-image
$ISO = "C:\Setup\ISO\Windows Server 2016.iso"
$CU = "C:\Setup\Cumulative Update for Windows Server 2016 for x64-based Systems (KB3201845)\AMD64-all-windows10.0-kb3201845-x64_95e1e765344e1388fee3f7c0c143499e0b617d9f.msu"
$MountFolder = "C:\Mount"
$RefImage = "C:\Setup\REFWS2016-001.wim"
# Verify that the ISO and CU files existnote
if (!(Test-Path -path $ISO)) {Write-Warning "Could not find Windows Server 2016 ISO file. Aborting...";Break}
if (!(Test-Path -path $CU)) {Write-Warning "Cumulative Update for Windows Server 2016. Aborting...";Break}
@matejskubic
matejskubic / wifipass.bat
Created February 6, 2017 08:40
Windows 10 WiFi password
netsh wlan show profiles
netsh wlan show profiles name="%1" key=clear
@matejskubic
matejskubic / 0_reuse_code.js
Created September 13, 2016 15:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console