This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/mongoid.rb | |
# convert object key "_id" to "id" and remove "_id" from displayed attributes on mongoid documents when represented as JSON | |
module Mongoid | |
module Document | |
def as_json(options={}) | |
attrs = super(options) | |
id = {id: attrs["_id"].to_s} | |
attrs.delete("_id") | |
id.merge(attrs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_user_assigned_identity" "cluster" { | |
location = azurerm_resource_group.example.location | |
name = "aks-cluster-identity-${var.cluster_uid}" | |
resource_group_name = azurerm_resource_group.example.name | |
} | |
resource "azurerm_user_assigned_identity" "kubelet" { | |
location = azurerm_resource_group.example.location | |
name = "aks-kubelet-identity-${var.cluster_uid}" | |
resource_group_name = azurerm_resource_group.example.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## The Env Vars | |
# AZURE_SUBSCRIPTION_ID | |
# CONSUL_VMSS_RG | |
# CONSUL_VMSS_NAME | |
## were prepended to this script at provisioning time with Terraform via custom_data/cloud-init | |
AZURE_MSI_ENDPOINT="http://169.254.169.254/metadata/identity" | |
AZURE_MSI_OAUTH=$(curl -H "Metadata:true" $AZURE_MSI_ENDPOINT"/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F") | |
AZURE_MSI_JWT=$(echo $AZURE_MSI_OAUTH | jq -r '.access_token') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Wait for cloud-init to finish | |
while [ ! -f /tmp/cloud-init-done ]; do echo 'Waiting for cloud-init to complete.';sleep 5; done | |
ssh -o "StrictHostKeyChecking no" $USER@$CONTROL_HOST 'sudo cp /etc/rancher/k3s/k3s.yaml ~/;sudo chown $USER:$USER k3s.yaml' | |
mkdir .kube | |
scp -o "StrictHostKeyChecking no" $USER@$CONTROL_HOST:~/k3s.yaml ./.kube/config | |
chmod 640 ~/.kube/config | |
sed -i 's/127.0.0.1/'$CONTROL_HOST'/g' ./.kube/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Summary from: https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04 | |
# 1. Check if swap exists returns single line output if swap doesn't exist | |
$ sudo swapon -s | |
Filename Type Size Used Priority | |
# 2. Check disk space on root (/) with DF command: | |
$ df | |
Filesystem 1K-blocks Used Available Use% Mounted on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To enable ssh & remote debugging on app service change the base image to the one below | |
FROM mcr.microsoft.com/azure-functions/dotnet:3.0-appservice | |
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ | |
AzureFunctionsJobHost__Logging__Console__IsEnabled=true | |
# skip installing gem documentation | |
RUN set -eux; \ | |
mkdir -p /usr/local/etc; \ | |
{ \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lookup TZ | |
timedatectl list-timezones | |
# Set TZ | |
sudo timedatectl set-timezone America/Toronto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target_fqdns = [ | |
"azure.archive.ubuntu.com", | |
"security.ubuntu.com", | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/powerline/fonts.git --depth=1 | |
cd fonts | |
.\install.ps1 | |
cd .. | |
rd /S /Q fonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
168.63.129.16 |
NewerOlder