Skip to content

Instantly share code, notes, and snippets.

View SQLvariant's full-sized avatar

Aaron Nelson SQLvariant

View GitHub Profile
View GetSQLBuffers_wProvider_PipeTo_Out-SquarifiedTreeMap.ps1
<# This is the code used to tell you
which databases are using up the RAM on
your SQL Server is great information to know
Queries are from #>
$SQLInstance = 'localhost\SQL2016'
Invoke-Sqlcmd -ServerInstance $SQLInstance -Database master -Query "
DECLARE @total_buffer INT;
SELECT @total_buffer = cntr_value
View Deploy-Reports.ps1
[String] [Parameter(Mandatory)]
#this is the evironment that is in the Solution config to read where things need to go (TEST/DEV/QA/Prodution)
#for example - C:\tfs2013\Test Automated Deployment Sharepoint.rptproj
[string] [Parameter(Mandatory)] $Environment,
#this is the name of the Datasource as it exists in Sharepoint without the .rsds extension
[string] [Parameter(Mandatory)] $DataSource,
#This is the connection string that will be set for the report data source.
View SQLReporting.psm1
# SQLReporting.psm1 Version 0.9
# Written by Trond Hindenes
#Import-Module Pester
Gets SSRS instances on ComputerName
rjmholt / CellFindingVisitor.cs
Created August 11, 2020 16:47
PowerShell AST visitor to break up a file by comments
View CellFindingVisitor.cs
using System;
using System.Collections.Generic;
using System.Management.Automation.Language;
public class ScriptExtent : IScriptExtent
private readonly IScriptPosition _start;
private readonly IScriptPosition _end;
View SubScriptionExporter.ps1
#Requires -Version 5.0
# Source File Information (DO NOT MODIFY)
# Source ID: 8967ce63-8512-4998-b597-b65331d6a9f6
# Source File: subscriptionExporter.psf
#region File Recovery Data (DO NOT MODIFY)
SQLvariant / Query_DB2.ps1
Created November 20, 2020 16:12
Uploaded via PowerShell
View Query_DB2.ps1
#Define connection string for the database
$cn = new-object"server=$($server);Provider=IBMDADB2;DSN=$($dbName);trusted_connection=true;");
#Define data set for first query
$ds = new-object "System.Data.DataSet" "ds"
#Define query to run
$q = "select * from hello_world"
# Define data object given the specific query and connection string
AndyCross / BabylonjsVisual.ts
Last active December 6, 2020 02:24
Use BabylonJS in PowerBI
View BabylonjsVisual.ts
declare module BABYLON {
export class Engine {
constructor(canvas:HTMLElement, antialias:boolean);
export class Scene {
stummsft / Set-SqlTlsCertificate.ps1
Created April 5, 2019 00:00
Programmatically set the TLS certificate to be used by a given SQL Server Instance
View Set-SqlTlsCertificate.ps1
function Set-SqlTlsCertificate {
param (
[Alias("CN", "MachineName")]
[String[]]$ComputerName = "localhost",
potatoqualitee / scrape.ps1
Last active February 24, 2021 15:22
Scrape All Microsoft Connect Items marked Resolved or Closed
View scrape.ps1
# IE has to be used because of a refresh that Invoke-WebRequest can't handle (think Clicks)
# Add required types
Add-Type -Path C:\Scripts\Scheduled\ClosedAsFixed\HtmlAgilityPack.dll
Add-Type -AssemblyName System.Web
Function Get-Total ($closedorresolved, $bugorsuggestion){
switch ($closedorresolved) {
"Closed" { $status = '3' }
"Resolved" { $status = '2' }
shashank291 /
Last active January 5, 2022 14:42
Export Fidelity Stock Lots to TSV file


I used the below script to export my Fidelity share lot information in one file. By default, Fidelity requires going to each individual stock page to get this info which can be painstaking.


Fair warning that you should understand the code you're running, and I make no guarantees as to the correctness of the script or the data downloaded, and I assume no liabilities if you decide to run this code. Now that that's out of the way, to get your aggregate share lot information:

Go to your Individual account on Fidelity, under Positions tab, and open the console(Ctrl+Shift+J on most browsers). Then you can run the following script that will gather all your stock lot information and download it in a TSV file. I suggest you read through it and verify it as a common precaution. Here's the script:

const domParser = new DOMParser();