Skip to content

Instantly share code, notes, and snippets.

View jensenak's full-sized avatar

Adam Jensen jensenak

  • HashiCorp
  • Boise, ID
View GitHub Profile
@rahulwa
rahulwa / desired_capacity.md
Created April 18, 2019 20:14
Found a solution for maintaining autoscaling’s `desired_capacity` in terraform, need to use`External Data Source` with a script

Content of scripts/test.sh:

#!/bin/bash

# Exit if any of the intermediate steps fail
set -e

# jq will ensure that the values are properly quoted
# and escaped for consumption by the shell.
eval "$(jq -r '@sh "ASG_NAME=\(.asg_name) REGION=\(.region) DC=\(.desired_capacity)"')"
@AdamLJohnson
AdamLJohnson / KubernetesOnWindows.md
Last active September 4, 2023 07:28
How to get Kubernetes running on Windows 10

Kubernetes On Windows

Early in August 2016 Microsoft released the Windows 10 Anniversary Update. There were a number of changes, but the one that got me to actually take the time to install the update was "Bash on Ubuntu on Windows". This feature would install Ubuntu Linux without the kernel. It would run linux in user-mode. Linux would run the commands while Windows does all the work/processing.

For an upcoming project I needed to get Kubernetes running. Being as Kubernetes is not able to be run in Windows the normally accepted way to procees is to create a virtual Linux box and run it from there. I wanted to see if Kubernetes would run in Bash on Ubuntu on Windows.

This is how I got it to work:

Install the Windows 10 Anniversary Update

@asafge
asafge / ng-really.js
Created November 12, 2013 13:06
ng-really? An AngularJS directive that creates a confirmation dialog for an action.
/**
* A generic confirmation for risky actions.
* Usage: Add attributes: ng-really-message="Are you sure"? ng-really-click="takeAction()" function
*/
angular.module('app').directive('ngReallyClick', [function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', function() {
var message = attrs.ngReallyMessage;