Skip to content

Instantly share code, notes, and snippets.

View goyalmohit's full-sized avatar

mohit goyal goyalmohit

  • Pune, India
View GitHub Profile
@goyalmohit
goyalmohit / compare-database-using-liquibase
Last active May 19, 2022 16:22
Liquibase command to compare databases
liquibase
--driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
--classpath="C:\\Program Files\\Microsoft JDBC Driver 6.0 for SQL Server\\sqljdbc_6.0\\enu\\jre8"
--url="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorksProd;integratedSecurity=false;"
--username=liquibase
--password=liquibase@123
--logLevel=debug
diff
--referenceUrl="jdbc:sqlserver://localhost:1433;databaseName=AdventureWorks2017;integratedSecurity=false;"
--referenceUsername=liquibase
@goyalmohit
goyalmohit / create-azure-web-app-with-slot.json
Last active February 7, 2022 11:57
ARM template for creating azure web app along with a deployment slot
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appServiceName": {
"type": "string",
"minLength": 1
},
"appServiceSkuName": {
"type": "string",
Function Get-Sum {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[int] $Number1,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[int] $Number2
Function Get-Sum {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[int] $Number1,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[int] $Number2
terraform {
required_version = ">= 0.12, < 0.13"
backend "azurerm" {
resource_group_name = "tf-state-rg"
storage_account_name = "tfstatemohit20200930"
container_name = "azure-devops"
key = "terraform.tfstate"
}
provider "azurerm" {
version = "=2.20.0"
features {}
}
resource "azurerm_resource_group" "tf-state-resource-group" {
name = "tf-state-rg"
location = "eastus2"
}
output "azuredevops_project_id" {
value = azuredevops_project.tf-example.id
description = "azure devops project id"
}
output "azuredevops_project_name" {
value = azuredevops_project.tf-example.project_name
description = "azure devops project name"
}
# partially complete block of code below - will not work in isolation
terraform {
required_version = ">= 0.12, < 0.13"
backend "s3" {
bucket = "terrafrom-state-20200929"
key = "azure-devops/terraform.tfstate"
region = "us-east-2"
dynamodb_table = "terraformlocks-mohit-202009292250"
terraform {
required_version = ">= 0.12, < 0.13"
}
provider "aws" {
region = "us-east-2"
}
resource "aws_dynamodb_table" "terraform-locks" {
name = "terraform-locks-mohit-20200929"
terraform {
required_version = ">= 0.12, < 0.13"
}
provider "aws" {
region = "us-east-2"
}
resource "aws_s3_bucket" "terrafrom-state" {
bucket = "terrafrom-state"