Skip to content

Instantly share code, notes, and snippets.

View dbafromthecold's full-sized avatar

Andrew Pruski dbafromthecold

View GitHub Profile
@dbafromthecold
dbafromthecold / PruskiYatesRelayAbstract
Last active May 10, 2017 08:50 — forked from Alex-Yates/PruskiYatesRelayAbstract
Session abstract for SQL Relay
Title:
How to provision n >TB virtual SQL Server environments from scratch in seconds on a laptop with limited diskspace using containers and clones
Abstract:
Provisioning dev environments is often a slow, complicated and manual process. Often devs simply don't have the diskspace to host a full production dataset locally.
You can solve many of the these problems with virtualisation technologies and source controlled powershell scripts.
We'll show you how by talking you through:
@dbafromthecold
dbafromthecold / SqlServerAksNonDefaultPort2
Created April 1, 2018 13:26
Sql Server running in AKS with non-default port opened in service
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sqlserver
labels:
app: sqlserver
spec:
replicas: 1
template:
metadata:
@dbafromthecold
dbafromthecold / SqlServerAksNonDefaultPort
Last active April 1, 2018 13:26
Sql Server in AKS on non-default port
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sqlserver
labels:
app: sqlserver
spec:
replicas: 1
template:
metadata:
@dbafromthecold
dbafromthecold / SqlServerAksNonDefaultPort3
Created April 3, 2018 18:31
Sql Server running in AKS listening on a non-default port with a different non-default port opened in service
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sqlserver
labels:
app: sqlserver
spec:
replicas: 1
template:
metadata:
@dbafromthecold
dbafromthecold / SslEncryptionError
Created August 6, 2018 13:14
SSL Encryption error when connecting to SQL in a linux container from SQL Operations Studio on Ubuntu 16.04
System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31 - Encryption(ssl/tls) handshake failed) ---> Interop+Crypto+OpenSslCryptographicException: error:2006D080:BIO routines:BIO_new_file:no such file
at Interop.Crypto.CheckValidOpenSslHandle(SafeHandle handle)
at Internal.Cryptography.Pal.StorePal.LoadMachineStores()
at Internal.Cryptography.Pal.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags)
at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags)
at Internal.Cryptography.Pal.OpenSslX509ChainProcessor.FindCandidates(X509Certificate2 leaf, X509Certificate2Collection extraStore, HashSet`1 downloaded, HashSet`1 systemTrusted, TimeSpan& remainingDownloadTime)
at Internal.Cryptography.Pal.ChainPal.BuildChain(Boolean useMachineContext, ICertificatePal cert, X509Certificate2Collection

Keybase proof

I hereby claim:

  • I am dbafromthecold on github.
  • I am dbafromthecold (https://keybase.io/dbafromthecold) on keybase.
  • I have a public key ASAEQ0Gj3j6xdHe2LG11L72fdCrBIfcFQFk4SpJ0riVUYQo

To claim this, I am signing this object:

@dbafromthecold
dbafromthecold / dockerfile
Created November 5, 2018 19:46
Dockerfile to install SQL Server on Centos
FROM centos
RUN yum update -y && yum install -y curl sudo
RUN sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo
RUN yum install -y mssql-server
CMD /opt/mssql/bin/sqlservr
@dbafromthecold
dbafromthecold / SqlServer_Helm_Test.azcli
Last active December 14, 2018 15:31
Setting up a helm chart to deploy SQL Server to a K8s cluster
# create directory for helm
cd C:\git\dbafromthecold\PrivateCodeRepo\Azure\Helm
# create new chart
helm create testsqlchart
@dbafromthecold
dbafromthecold / aci-virtualnetwork.azcli
Last active May 21, 2019 19:06
Azure Container Instance - Virtual Network Deployment
# create a resource group
az group create --name containers1 --location westeurope
# create a virtual network
az network vnet create --resource-group containers1 --name aci_vnet1
# list available delegations
az network vnet subnet list-available-delegations --resource-group containers1
@dbafromthecold
dbafromthecold / PsDatabaseCloneContainer.ps1
Last active October 9, 2019 10:03
Using PSDatabaseClone to clone database into container
# hack to use PsDatabaseClone to mount a cloned database into a container
# this only works with a local SQL instance to initially host the cloned database
# which is then detached and mounted to a container
# import required powershell modules
import-module dbatools
import-module psframework
import-module psdatabaseclone