netsh http show urlacl
netsh http delete urlacl http://+:80/Reports/
| # CodeDeploy powershell template | |
| # Are you running in 32-bit mode? | |
| # (\SysWOW64\ = 32-bit mode) | |
| if ($PSHOME -like "*SysWOW64*") | |
| { | |
| Write-Warning "Restarting this script under 64-bit Windows PowerShell." |
| using System; | |
| using System.Data; | |
| using System.Data.Entity; | |
| using System.Data.Entity.Infrastructure; | |
| using System.Linq; | |
| public class GenericRepository<T> : IRepository<T>, IDisposable where T : class | |
| { | |
| public GenericRepository(IDbContext context) | |
| { |
| var cts = new CancellationTokenSource(); | |
| var token = cts.Token; | |
| Task.Factory.StartNew(() => | |
| { | |
| while (true) | |
| { | |
| if (cts.IsCancellationRequested) | |
| { | |
| return; |
| import boto3 | |
| ec2 = boto3.resource('ec2') | |
| print('Loading function') | |
| def lambda_handler(event, context): | |
| instance = list_autostop_instance() | |
| stop_instances(instance) | |
| def find_name(instance): |
| # Use shortcode to find latest TechNet download site | |
| $confirmationPage = 'http://www.microsoft.com/en-us/download/' + $((invoke-webrequest 'http://aka.ms/wmf5latest' -UseBasicParsing).links | ? Class -eq 'mscom-link download-button dl' | % href) | |
| # Parse confirmation page and look for URL to file | |
| $directURL = (invoke-webrequest $confirmationPage -UseBasicParsing).Links | ? Class -eq 'mscom-link' | ? href -match 'Win8.1AndW2K12R2-KB3134758-x64.msu' | % href | select -first 1 | |
| # Download file to local | |
| $download = invoke-webrequest $directURL -OutFile $env:Temp\wmf5latest.msu | |
| # Install quietly with no reboot | |
| if (test-path $env:Temp\wmf5latest.msu) { | |
| start -wait $env:Temp\wmf5latest.msu -argumentlist '/quiet /norestart' | |
| } |
| --We will assume that my_table table is in my_published_db and it is part of my_publication. | |
| USE my_published_db | |
| GO | |
| EXEC sp_scriptpublicationcustomprocs @publication='my_publication' |
| -- Remove database from Availability Group: | |
| Alter Database [StackExchange.Bicycles.Meta] SET HADR OFF; | |
| -- Apply t-logs to catch up. This can be done manually in SSMS or via: | |
| RESTORE LOG [StackExchange.Bicycles.Meta] FROM DISK = '\\ny-back01\backups\SQL\_Trans\SENetwork_AG\StackExchange.Bicycles.Meta\StackExchange.Bicycles.Meta_LOG_20160217_033201.trn' WITH NORECOVERY; | |
| -- Re-join database to availability group | |
| ALTER DATABASE [StackExchange.Bicycles.Meta] SET HADR AVAILABILITY GROUP = [SENetwork_AG]; | |
| ALTER DATABASE [StackExchange.Bicycles.Meta] SET HADR RESUME; |
| /******************************************************************** | |
| * * | |
| * Author: John Eisbrener * | |
| * Script Purpose: Script out Database Role Definition * | |
| * * | |
| ********************************************************************/ | |
| DECLARE @roleName VARCHAR(255) | |
| SET @roleName = 'DatabaseRoleName' |
| internal class DisposableAction : IDisposable | |
| { | |
| private readonly Action _action; | |
| public DisposableAction(Action action) | |
| { | |
| _action = action; | |
| } | |
| public void Dispose() |
netsh http show urlacl
netsh http delete urlacl http://+:80/Reports/