Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
This script migrates DNS settings from an old Azure Public IP to a new Azure Public IP and cleans up old resources.
.DESCRIPTION
The script performs several operations in Azure:
1. It prompts the user for confirmation before proceeding, due to potential brief connectivity downtime.
2. Retrieves the DNS settings (Domain Name Label and FQDN) from the old Public IP.
3. Applies these DNS settings to the new Public IP.
4. Removes the old Load Balancer and Public IP after confirming with the user.
@Romiko
Romiko / azure-pipelines.yaml
Created April 2, 2020 10:01 — forked from chadmcrowell/azure-pipelines.yaml
CI/CD Lesson in Course "Build and Deploy Pipelines with Microsoft Azure"
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
trigger:
- master
stages:
- stage: Build
Write "Installing NServiceBus License"
$content = [xml]"<?xml version=`"1.0`" encoding=`"utf-8`"?>
<license id=`"MyId`" expiration=`"2114-06-11T04:13:03.9080905`" type=`"Standard`" ProductName=`"Royalty Free Platform License`" WorkerThreads=`"Max`" LicenseVersion=`"5.0`" MaxMessageThroughputPerSecond=`"Max`" AllowedNumberOfWorkerNodes=`"Max`" UpgradeProtectionExpiration=`"2015-06-11`" Applications=`"ServiceInsight;NServiceBus;ServicePulse;ServiceMatrix;ServiceControl;`" LicenseType=`"Royalty Free Platform License`" Edition=`"Enterprise `" Quantity=`"2`" Perpetual=`"`">
<name>MyName</name>
<Signature xmlns=`"http://www.w3.org/2000/09/xmldsig#`">
<SignedInfo>
<CanonicalizationMethod Algorithm=`"http://www.w3.org/TR/2001/REC-xml-c14n-20010315`" />
<SignatureMethod Algorithm=`"http://www.w3.org/2000/09/xmldsig#rsa-sha1`" />
<Reference URI=`"`">
@Romiko
Romiko / s3_website_push_error
Created August 4, 2013 09:13
s3_website push error
3_website push
Deploying _site/* to blog.rangerrom.com
Calculating diff //Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/openssl/buffering.rb:174:in `sysread_nonblock': end of file reached (EOFError)
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/openssl/buffering.rb:174:in `read_nonblock'
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:2563:in `read_status_line'
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:2552:in `read_new'
from /Users/romikoderbynew/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/net/http.rb:1320:in `block in transport_request'
using System.Security.Permissions;
using System.Web.Mvc;
using MyStory.Logic.Security;
using MyStory.Web.Models;
using MyStory.Web.Models.Clients;
namespace MyStory.Web.Areas.Agency.Controllers
{
public partial class ClientController
{
@Romiko
Romiko / DeleteReferrals.cs
Created February 10, 2012 03:18
Delete Duplicate Referrals based on latest date initiated
private void DeleteLatestDuplicateReferrals(IList<Node<Referral>> duplicateReferrals)
{
var theReferralsToDelete = from r in duplicateReferrals
group r by r.Data.UniqueId
into g
where g.Count() > 1
select new
{
UniqueId = g.Key,
DateIntiated = (from r in g select r.Data.DateInitiatedUtc).Max(),
@Romiko
Romiko / ServiceDefinition.perf.csdef
Created February 9, 2012 03:34
Service Definition Transform
<?xml version="1.0"?>
<sd:ServiceDefinition name="Neo4j.Azure.Server"
xmlns:sd="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<sd:WebRole name="Web" xdt:Locator="Match(name)">
<sd:Startup>
<sd:Task commandLine="Startup.cmd" xdt:Locator="Match(commandLine)">
<sd:Environment>
<sd:Variable xdt:Transform="Replace" xdt:Locator="Match(name)" name="MYSTORYENV" value="PERF"/>
</sd:Environment>
@Romiko
Romiko / AzureStartUptask.xml
Created February 8, 2012 23:01
Windows Azure Startup Tasks
<WebRole name="Web" vmsize="Medium">
<Runtime executionContext="elevated" />
<Startup>
<Task commandLine="Startup.cmd" executionContext="elevated" taskType="background">
<Environment>
<Variable name="EMULATED">
<RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
</Variable>
</Environment>
</Task>
@Romiko
Romiko / UndeployAzure.ps1
Created February 8, 2012 01:08
UndeployAzure
#requires -version 2.0
param (
[parameter(Mandatory=$true)] [string]$AzureServiceName,
[parameter(Mandatory=$true)] [string]$AzureDeploymentSlot,
[parameter(Mandatory=$true)] [string]$AzureSubscriptionId,
[parameter(Mandatory=$true)] [string]$AzureCertificateThumbprint)
$ErrorActionPreference = "Stop"
if ((Get-PSSnapin -Registered -Name AzureManagementCmdletsSnapIn -ErrorAction SilentlyContinue) -eq $null)
@Romiko
Romiko / AzureTraceListener.xml
Created February 7, 2012 04:20
Azure Trace Listener
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>