Skip to content

Instantly share code, notes, and snippets.

Jeremy Jameson jeremy-jameson

Block or report user

Report or block jeremy-jameson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeremy-jameson
jeremy-jameson / Shrink Transaction Logs.sql
Created Jan 25, 2020
Shrink transaction log files in SQL Server
View Shrink Transaction Logs.sql
IF OBJECT_ID('tempdb.dbo.#CommandQueue', 'U') IS NOT NULL
BEGIN
DROP TABLE #CommandQueue
END
CREATE TABLE #CommandQueue
(
ID INT IDENTITY (1, 1)
, SqlStatement VARCHAR(1000)
)
@jeremy-jameson
jeremy-jameson / Fix MDW rpt_query_stats procedure.sql
Last active Dec 20, 2019
Fix for bug in SQL Server Management Data Warehouse (rpt_query_stats procedure)
View Fix MDW rpt_query_stats procedure.sql
USE [MDW]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [snapshots].[rpt_query_stats]
@jeremy-jameson
jeremy-jameson / Start and stop cluster VMs.md
Last active Dec 10, 2019
Start and stop cluster VMs (using System Center Virtual Machine Manager)
View Start and stop cluster VMs.md

# Start and stop cluster VMs (using System Center Virtual Machine Manager)

# Create cluster VM list with "startup order"

$url = 'https://gist.githubusercontent.com/jeremy-jameson' `
    + '/913c11a4550efe428bbe7d6e1c82c955/raw'

Invoke-WebRequest `
    -UseBasicParsing `
@jeremy-jameson
jeremy-jameson / Cluster VMs.csv
Last active Dec 10, 2019
Sample list of virtual machines running on a cluster with "startup order"
View Cluster VMs.csv
Name StartupOrder
CIPHER01 4
CON-ADFS01 302
CON-DC03 300
CON-DC04 301
CON-WIN10-TEST1 303
CRYPTID 0
EXT-ADFS01A 0
EXT-ADFS03A 108
EXT-ADFS03B 109
@jeremy-jameson
jeremy-jameson / Configure symbolic links for Git repositories.md
Last active Dec 6, 2019
Configure symbolic links for Git repositories
View Configure symbolic links for Git repositories.md
View Download PowerShell profile.md

# Download PowerShell profile

$url = "https://raw.githubusercontent.com/jeremy-jameson" `
    + "/toolbox/master/PowerShell/Microsoft.PowerShell_profile.ps1"

Invoke-WebRequest -Uri $url -OutFile $PROFILE -UseBasicParsing
View Sign PowerShell profile.md

# Sign PowerShell profile

$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert

Set-AuthenticodeSignature -FilePath $PROFILE -Certificate $cert
You can’t perform that action at this time.