Skip to content

Instantly share code, notes, and snippets.

Avatar

Gavin Campbell gavincampbell

View GitHub Profile
@gavincampbell
gavincampbell / devcontainer.json
Created March 10, 2021 08:15
Files from post on running jupyter-pyspark in vscode
View devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/debian
{
"name": "pyspark",
"image": "jupyter/pyspark-notebook",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
@gavincampbell
gavincampbell / .env.example
Last active November 23, 2021 18:52
Post-deployment configuration of WordPress in Azure App Service, notes at https://gavincampbell.dev/post/post-deployment-configuration-azure-web-apps/
View .env.example
LOCATION=uksouth
RESOURCE_GROUP_NAME=webapp-config-demo
SERVICE_PLAN_NAME=app-service-plan-free-wp
SERVICE_PLAN_SKU=FREE
WEB_APP_NAME=mywpsite-ahfdskf
MARIADB_SKU=B_Gen5_1
MARIADB_SERVER_NAME=dbserver-ahfdskf
MARIADB_ADMIN_USER=BOSS_HOGG
MARIADB_ADMIN_PASSWORD=R05coePColtrane
WORDPRESS_DB_NAME=wpdb
@gavincampbell
gavincampbell / gist:72a485049ab2b0dba3ea34655607b5c3
Last active June 25, 2020 11:25
Update a markdown file to use hugo figure shortcode instead of markdown img links
View gist:72a485049ab2b0dba3ea34655607b5c3
sed -i 's/!\[\(.*\)\] \?(https:\/\/.*\/\(.*\))/{{< figure src="\2" caption="\1" >}}/g' index.md
@gavincampbell
gavincampbell / steps.md
Last active June 19, 2020 12:55
setting up minikube on a new Centos 7.8 VM
View steps.md
  1. set up network with nmcli/nmtui/whatever
  2. sudo yum update
  3. sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
@gavincampbell
gavincampbell / azuredeploy.json
Last active June 1, 2020 17:23
Example code and tests for creating conditional NSG rules using optional parameters
View azuredeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json",
"contentVersion": "0.0.0.1",
"parameters": {
"vnetName": {
"type": "string"
},
"vnetAddressPrefix": {
"type": "string"
},
View sql-2019-win-2019.json
{
"variables": {
"build_location": "uksouth",
"build_vm_size": "Standard_DS2_v2",
"sp_client_id": "{{env `PACKER_CLIENT_ID`}}",
"sp_client_secret": "{{env `PACKER_CLIENT_SECRET`}}",
"sp_tenant_id": "{{env `PACKER_TENANT_ID`}}",
"sp_subscription_id": "{{env `PACKER_SUBSCRIPTION_ID`}}",
"output_resource_group" : "packer-vm-images",
"output_image_name_prefix" : "sql-2019-win-2019"
@gavincampbell
gavincampbell / DispDev2019Notes.md
Last active October 10, 2019 14:39
Resources for talk on Disposable Development Environments from SQL Relay 2019
@gavincampbell
gavincampbell / WinRM-HTTPS.ps1
Created February 19, 2019 10:12 — forked from TechIsCool/WinRM-HTTPS.ps1
A simple Powershell WinRM-HTTPs setup
View WinRM-HTTPS.ps1
Write-Output "Disabling WinRM over HTTP..."
Disable-NetFirewallRule -Name "WINRM-HTTP-In-TCP"
Disable-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC"
Get-ChildItem WSMan:\Localhost\listener | Remove-Item -Recurse
Write-Output "Configuring WinRM for HTTPS..."
Set-Item -Path WSMan:\LocalHost\MaxTimeoutms -Value '1800000'
Set-Item -Path WSMan:\LocalHost\Shell\MaxMemoryPerShellMB -Value '1024'
Set-Item -Path WSMan:\LocalHost\Service\AllowUnencrypted -Value 'false'
Set-Item -Path WSMan:\LocalHost\Service\Auth\Basic -Value 'true'
@gavincampbell
gavincampbell / InstallHaProxy.sh
Last active November 23, 2018 11:15 — forked from jrouleau/InstallHaProxy.sh
Amazon Linux AMI Install HAProxy From Source (1.7.0 release pre configured). chmod +x InstallHaProxy.sh then ./InstallHaProxy.sh
View InstallHaProxy.sh
#!/bin/bash
### VARIABLES ###
PRE_PACK="openssl-devel pcre-devel make gcc"
VER="1.8.14"
# Setup Colours
black='\E[30;40m'
red='\E[31;40m'
green='\E[32;40m'