I hereby claim:
- I am schwartzmx on github.
- I am schwartzmx (https://keybase.io/schwartzmx) on keybase.
- I have a public key whose fingerprint is 5FD3 7845 FB08 46F6 6D0F CC00 3B5C B261 00D2 E70F
To claim this, I am signing this object:
| - name: Launch {{env}}-{{service}} Instance(s) | |
| hosts: localhost | |
| gather_facts: false | |
| connection: local | |
| vars_files: | |
| - group_vars/env/{{ environment }}.yml | |
| - group_vars/service/{{ service }}.yml | |
| - group_vars/admin.yml | |
| # Launch instances with the following parameters. Register the output. |
| -- Printed, while loop | |
| declare @str varchar(30), @i int = 0, @max int = 100; | |
| while @i <= 100 | |
| begin | |
| if @i % 3 = 0 | |
| set @str += 'Fizz' | |
| if @i % 5 = 0 | |
| set @str += 'Buzz' | |
| if len(@str) !> 0 |
| create procedure [prc_Magic8Ball] | |
| ( | |
| @question varchar(100) | |
| ) | |
| -- Author: Phil | |
| -- Example: exec prc_Magic8Ball 'Will I make it into the office on time today?'; | |
| as | |
| begin | |
| set nocount on; | |
| declare @phrase as table (name varchar(50)); |
| # Quick abstraction test | |
| $d = (Get-Date) | |
| $frequency = "Weekly" | |
| $query = "exec prc_ReportXYZ {0}, {1};" | |
| switch ($frequency) { | |
| "Weekly" { | |
| $beginDate = $d.AddDays(-$d.DayOfWeek).ToString('MM/dd/yy') | |
| $endDate = (Get-Date $beginDate).AddDays(7).ToString('MM/dd/yy') | |
| } | |
| "Monthly" { |
| <# | |
| Author: Phil Schwartz | |
| Description: A simple script to read the RSS feed for SQL Server KB support updates | |
| - Allows stepping through the feed and opening in browser, if specified | |
| #> | |
| [xml]$xmldoc= Invoke-WebRequest 'https://support.microsoft.com/en-us/rss?rssid=1044' | |
| $feed = $xmldoc.rss.channel | |
| $lid = 0 |
| from bs4 import BeautifulSoup | |
| import requests as r | |
| from json import dumps | |
| class Country: | |
| def __init__(self, country, place, gold, silver, bronze, total_medals): | |
| self.country = country | |
| self.place = place | |
| self.gold = gold | |
| self.silver = silver |
| <# | |
| Note: Before running, make sure you have any relevant Credentials copied over and maintenance plans, or referenced objects could cause failures in the script. | |
| Author: Phil | |
| #> | |
| $Source = "" # ex. "Source-SQL" | |
| $SQLUser = "" # user | |
| $SQLPassword = "" # password | |
| $Targets = "" # ex. "Target-SQL" | |
| [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null |
| <# | |
| Transfer SSIS Folders and Projects from a source server to a destination server. | |
| Mostly taken from http://widba.blogspot.com/2013/02/moving-SSIS-projects-in-sql-server-2012.html with some added functionality for copying ALL SSIS packages and folders to the destination | |
| Note this does have to use SSPI Integrated Security for copying from the Source to Dest | |
| Author: Phil Schwartz | |
| #> |
| $LogTimeSpanMinutes = 10 | |
| $AfterDate = (Get-Date).AddMinutes(-$LogTimeSpanMinutes) | |
| $SQLMailProfile = "DoNotReplyNotification" | |
| $recipients = "[email protected]" | |
| $subject = "Failover Cluster ERRORS" | |
| $body = "<!DOCTYPE html><html><head></head><br><body> {0} </body></html>" | |
| $LocalServer = hostname | |
| Function DBA-SendMail { | |
| param( |
I hereby claim:
To claim this, I am signing this object: