Skip to content

Instantly share code, notes, and snippets.

View jetstreamin's full-sized avatar
:octocat:
chillin' like the vanilla shake that I am

Mike Mahon jetstreamin

:octocat:
chillin' like the vanilla shake that I am
View GitHub Profile
@jetstreamin
jetstreamin / ExportSchema.ps1
Created August 10, 2019 23:35 — forked from cheynewallace/ExportSchema.ps1
Export MSSQL schema with PowerShell. This script will export your schema definitions for tables, stored procs, triggers, functions and views to .sql files
# Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>"
# Start Script
Set-ExecutionPolicy RemoteSigned
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath)
{
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
#https://github.com/aspnet/Tooling/blob/AspNetVMs/docs/create-asp-net-vm-with-webdeploy.md
# Install IIS (with Management Console)
Install-WindowsFeature -name Web-Server -IncludeManagementTools
# Install ASP.NET 4.6
Install-WindowsFeature Web-Asp-Net45
# Install Web Management Service
Install-WindowsFeature -Name Web-Mgmt-Service
@jetstreamin
jetstreamin / choco-developer-installs.bat
Last active October 1, 2022 19:54
Choco Installs for Developer Machine Setup
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
cinst -y --ignore-checksums`
choco feature enable -n=allowGlobalConfirmation
choco install googlechrome
choco install firefox
choco install brave
choco install greenshot
choco install microsoft-teams
choco install octopustools
choco install flashplayerplugin
@jetstreamin
jetstreamin / sql-tools-fulltextsearch.sql
Created May 15, 2019 16:03
sql tools - full test search
USE BizActorMDBImport
DECLARE @SearchStr nvarchar(100) = '90_120'
DECLARE @Results TABLE (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
@jetstreamin
jetstreamin / DateMath.cmd
Last active April 13, 2019 11:40
DateMath.cmd - Add or subtract days from any date, copy the script below or download here and save as DateMath.cmdq
@ECHO off
SETLOCAL
:: DateMath, a general purpose date math routine
:: If DateMath detects an error, variable _dd_int is set to 999999.
SET v_dd_int=0
SET v_mm_int=0
SET v_yy_int=0
SET v_ymd_str=
SET v_mm_str=
@jetstreamin
jetstreamin / 1553606035.txt
Created March 26, 2019 13:13
Created with Copy to Gist
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
@jetstreamin
jetstreamin / README.md
Last active March 21, 2019 13:20 — forked from smagch/README.md
CloudFormation: Postgres with default VPC spike
aws cloudformation create-stack --stack-name hogehoge --template-body file://conf.yaml --region ap-northeast-1 --parameters file://param.yaml
@jetstreamin
jetstreamin / ansi-escape-colors.sh
Created March 5, 2019 12:12
bash: ANSI Escape Colors
## Snagged from https://stackoverflow.com/a/20983251
# Black 0;30 Dark Gray 1;30
# Red 0;31 Light Red 1;31
# Green 0;32 Light Green 1;32
# Brown/Orange 0;33 Yellow 1;33
# Blue 0;34 Light Blue 1;34
# Purple 0;35 Light Purple 1;35
# Cyan 0;36 Light Cyan 1;36
# Light Gray 0;37 White 1;37
@jetstreamin
jetstreamin / convert-file-to-array.sh
Created March 5, 2019 11:32
bash: read file to array
# snagged from https://stackoverflow.com/a/30988704
# Use the mapfile command:
mapfile -t myArray < file.txt
# The error is using for -- the idiomatic way to loop over lines of a file is:
while IFS= read -r line; do echo ">>$line<<"; done < file.txt