Skip to content

Instantly share code, notes, and snippets.

View brentmcconnell's full-sized avatar

Brent McConnell brentmcconnell

  • Microsoft
  • Boston, MA
View GitHub Profile
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2015 Microsoft Azure
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#!/bin/bash
# Add MSFT repos
sudo yum update -y --disablerepo='*' --enablerepo='*microsoft*'
# Update package repository
sudo yum update -y
# Install nginx
sudo yum install -y nginx
{
"openapi": "3.0.3",
"info": {
"title": "Tiingo API",
"description": "# Overview\nTiingo's APIs are built to be performant, consistent, and also support extensive filters to speed up your development time.\n\nBecause of this, we hope you will take the time to read the documentation and learn about all of our features, but we also understand you may want to jump right in. So if you want to jump right in, click on any endpoint link, which are located on the sidebar to your left.\n\n# Introduction\nThe endpoints are broken up into two different types:\n\n1. __REST Endpoints__ which provide a RESTful interface to querying data, especially historical data for end-of-day data feeds.\n2. __Websocket__ which provide a websocket interface and are used to stream real-time data. If you are looking for access to a raw firehose of data, the websocket endpoint is how you get it.\nTo navigate and see how to query data using each of the above methods, use the sidebar on the left and choose an endpoint that inter
@brentmcconnell
brentmcconnell / Dockerfile
Last active May 3, 2022 21:29
Dockerfile for SSH
FROM nginx:1.21.6-alpine
# Install OpenSSH and set the password for root to "Docker!". In this example, "apk add" is the install instruction for an Alpine Linux-based image.
RUN apk add openssh \
&& echo "root:Docker!" | chpasswd
# Copy the sshd_config file to the /etc/ssh/ directory
COPY sshd_config /etc/ssh/
# Copy and configure the ssh_setup file
trigger:
- main
pool:
vmImage: 'ubuntu-18.04'
variables:
imageName: 'fmc/hugo'
containerRegistryConnection: 'BLASTREGISTRY' #Setup a new container connection in ADO with this name
containerRegistryName: 'blastregistry'
@brentmcconnell
brentmcconnell / az-basic-project.sh
Last active January 4, 2022 21:04
Project Bootstrap Script
#!/bin/bash
# This script bootstraps a basic project for Azure DevOps
# Running this script will create a storage account.
# It also will create a Project oriented resource group and a service principle.
# The service principal has Owner for the resource group created and is
# stored in a keyvault that can be accessed by Azure DevOps to configure
# Azure access
set -o errexit # exit if any statement returns a non-true return value
@brentmcconnell
brentmcconnell / bootstrap
Created October 7, 2021 14:38
Bootstrap
# Bootstrap Project
Setup Resource Group, service principal and keyvault. The service principal is created and has Owner on the resource group as well as the ability to read and write to the storage account. This can be done manually but the follow gist can be used to perform these actions automatically if executed by someone who has the ability to create service principals and resource groups. See (https://gist.github.com/brentmcconnell/d1bb14d31ab69578c5d9ef816015ddda).
Example execution (no arguments are required but for instance -r is recommended as eastus is the default
./az-terraform-basic -g name_of_rg_to_create (optional) -r region (eastus by default).
After this program executes you will have a resource group that contains a storage account and a keyvault. These will be used by Azure DevOps to execute pipelines using the service principal's credentials in the keyvault.
### Steps performed by the script above.
1. Create Resource Group (take note of name will be used later)
@brentmcconnell
brentmcconnell / README.md
Last active October 7, 2021 14:37
Setup ADO

Bootstrap Project

Setup Resource Group, service principal and keyvault. The service principal is created and has Owner on the resource group as well as the ability to read and write to the storage account. This can be done manually but the follow gist can be used to perform these actions automatically if executed by someone who has the ability to create service principals and resource groups. See (https://gist.github.com/brentmcconnell/d1bb14d31ab69578c5d9ef816015ddda).

Example execution (no arguments are required but for instance -r is recommended as eastus is the default ./az-terraform-basic -g name_of_rg_to_create (optional) -r region (eastus by default).

After this program executes you will have a resource group that contains a storage account and a keyvault. These will be used by Azure DevOps to execute pipelines using the service principal's credentials in the keyvault.

Steps performed by the script above.

  1. Create Resource Group (take note of name will be used later)
@brentmcconnell
brentmcconnell / stopvm.ps1
Last active May 5, 2021 15:09
Powershell Runbook to StopVM
param
(
[Parameter (Mandatory = $false)]
[object] $WebhookData
)
# If runbook was called from Webhook, WebhookData will not be null.
if ($WebhookData) {
# Here for Debugging purposes
Write-Output $WebhookData
@brentmcconnell
brentmcconnell / az-terraform-helper.sh
Last active July 28, 2021 08:25
Setup RG and SP for a project and optionally create a provider.tf file for use by Terraform
#!/bin/bash
# This script bootstraps a resource group in Azure with a Service Principal
# that has Owner on the resource group. It will also create a Storage Account
# and Keyvault in the resource group and load the SP values into the Keyvault.
# You can optionally create a provider.tf file that references a tfstate
# container for use with Terraform.
# This can be used without any parameters and names will be generated or you
# can optionally pass in a (-g) resource group, (-r) region.