Skip to content

Instantly share code, notes, and snippets.

@ivansharamok
ivansharamok / Dockerfile.dotnet-framework-sdk.netfxtools
Last active Jul 22, 2018
Dockerfile for dotnet-framework SDK with NetFxTools
View Dockerfile.dotnet-framework-sdk.netfxtools
# escape=`
FROM microsoft/dotnet-framework:4.7.2-sdk
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
# example path to NetFxTools: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
ENV PATH_WITH_WHITESPACES="NETFX 4.5.1 Tools\\"
ENV ToolPath="C:\\NetFxTools"
RUN mkdir \NetFxTools
COPY ${PATH_WITH_WHITESPACES} ${ToolPath}
@ivansharamok
ivansharamok / 3man-2work-swarmmode.sh
Last active May 24, 2018
3managers-2workers-docker-swarmmode
View 3man-2work-swarmmode.sh
#!/bin/bash -e
# script uses docker-machine to create VMs in VirtualBox.
vm_man_prefix=${1:-"man-node"}
vm_work_prefix=${2:-"work-node"}
disk_size_mb=${3:-4000}
vm_memory=${4:-1024}
vm_driver=virtualbox
work_node_count=2
View install-solrssl.ps1
<#
.Example .\install-solrssl.ps1 -KeystoreFile C:\Solr\apache-solr\server\etc\solr-ssl.keystore.jks
#>
param(
[string]$KeystoreFile = 'solr-ssl.keystore.jks',
[string]$KeystorePassword = 'secret',
[string]$SolrDomain = 'localhost',
[string]$SolrIP = '127.0.0.1',
[string]$SslAlias = 'solr-ssl',
View import-docker-solrssl.ps1
<#
.Synopsis
Get Solr SSL cert from docker container and install it into local Windows machine.
.Example
.\import-docker-solrssl.ps1 -DockerContainer sc90-solr66 -InstallCert
.Example
.\import-docker-solrssl.ps1 -DockerContainer sc90-solr66 -KeystoreFile ./solr-ssl.keystore.jsk -InstallCert
#>
View populate-solr-managed-schema.ps1
#Requires -Modules SitecoreInstallFramework
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)] $Hostname,
[Parameter(Mandatory=$false)] $User="admin",
[Parameter(Mandatory=$false)] $Password="b"
)
# Invoke service page to populate indexes with default fields
Invoke-SitecoreUrlTask -SitecoreInstanceRoot $Hostname -SitecoreActionPath "sitecore/admin/PopulateManagedSchema.aspx?indexes=all" -Username $User -Password $Password
@ivansharamok
ivansharamok / deploy-aci-from-acr.ps1
Created Sep 26, 2017
Deploy Azure container from ACR
View deploy-aci-from-acr.ps1
<#
.Synopsis
Deploy Azure Container Instance from a specified image.
Requires az-cli >= 2.0.13
.Example
.\deploy-aci-from-acr.ps1 -ContainerName myContainer -ResourceGroup myGroup -RegistryName myRegistry -ImageName myregistry.azurecr.io/myImageWithTag -Port 8983
.Example
.\deploy-aci-from-acr.ps1 -ContainerName myContainer -ResourceGroup myGroup -RegistryName myRegistry -ImageName myregistry.azurecr.io/myImageWithTag -Port 8983 -CpuCores 2 -CommandLine 'myscript.sh'
@ivansharamok
ivansharamok / create-acr.ps1
Created Sep 26, 2017
Create Azure Container Registry via Azure CLI
View create-acr.ps1
<#
.Synopsis
Create Azure Container Registry. Requires azure-cli >= 2.0.13
.Example
.\create-acr.ps1 -RegistryName myacr -ResourceGroup sc-acr -Location westus -Sku Basic
.Example
.\create-acr.ps1 -RegistryName myacr -ResourceGroup sc-acr -Location eastus -Sku Managed_Basic
@ivansharamok
ivansharamok / push-image2acr.ps1
Created Sep 26, 2017
Push docker image into ACR
View push-image2acr.ps1
<#
.Synopsis
Pushes docker image to Azure Container Registry. Requires Docker engine to be available and running on the machine that executes this script.
Requires az-cli >= 2.0.13
.Example
.\push-image2acr.ps1 -RegistryName myregistry -ImageName myImageWithTag
#>
[CmdletBinding()]
param(
@ivansharamok
ivansharamok / CreateReplicaSet-2nod-1arb-1hid.ps1
Created May 1, 2017
Powershell script mongodb replica set
View CreateReplicaSet-2nod-1arb-1hid.ps1
<#
.SYNOPSIS
Stands up a mongo replica set that consists of 1 primary, 1 secondary, 1 hidden secondary and 1 arbiter.
.DESCRIPTION
.PARAMETER mongoPath
Path to mongo /bin dir.
.PARAMETER dbRoot
View CreateMongoReplicaSet-2nod-1arb-1hid.cmd
@echo OFF
REM script creates mongodb replica set with 1 primary, 1 secondary, 1 hidden secondary and 1 arbiter.
REM nodes are started on ports 27018, 27019, 27020, 27021
IF "%OS%"=="Windows_NT" setlocal enabledelayedexpansion enableextensions
REM reset variables
set "MONGO_ROOT="
set "MONGODB_PATH="
set "REPL_NAME="
set "REPL_INIT="