If you'd like to experiment with Terraform and Kubernetes on macOS locally, a great provider for doing so is the Kubernetes provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
#!/usr/bin/env bash | |
# SOME_VALUE='my_value' | |
# SOME_VALUE=my_value | |
# SOME_ARRAY='["one", "two", "three"]' | |
# SOME_ARRAY='["one","two","three"]' | |
# SOME_ARRAY=["one", "two", "three"] | |
input="${1}" |
#!/bin/bash | |
# Workaround for SwiftLintAppCode plugin hanging while calling swiftlint. | |
# | |
# 1. Drop this into /usr/local/bin/swiftlint-wrapper.sh or some other handy spot. | |
# 2. Set exec permissions: chmod 0755 /usr/local/bin/swiftlint-wrapper.sh | |
# 3. Update AppCode SwiftLint settings to point to the wrapper. | |
# | |
# This wrapper supports a single file only as an argument. It supports linting | |
# once a file has been saved (auto trigger) or if specifying the file from the |
/* app/controllers/index.js */ | |
module.exports.index = function(req, res) { | |
res.render('index.html'); | |
}; |
// 'downloadFile.js', written by blending two solutions: | |
// 'js-download' https://github.com/kennethjiang/js-file-download | |
// 'Anders Paulsen' https://blog.jayway.com/2017/07/13/open-pdf-downloaded-api-javascript/ | |
export function downloadFile(data, filename, mime) { | |
// It is necessary to create a new blob object with mime-type explicitly set | |
// otherwise only Chrome works like it should | |
const blob = new Blob([data], {type: mime || 'application/octet-stream'}); | |
if (typeof window.navigator.msSaveBlob !== 'undefined') { | |
// IE doesn't allow using a blob object directly as link href. |
import ( | |
"crypto/md5" | |
"encoding/hex" | |
) | |
func GetMD5Hash(text string) string { | |
hasher := md5.New() | |
hasher.Write([]byte(text)) | |
return hex.EncodeToString(hasher.Sum(nil)) | |
} |
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/mux" | |
"net/http" | |
) | |
func main() { | |
r := mux.NewRouter() |
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
If you'd like to experiment with Terraform and Kubernetes on macOS locally, a great provider for doing so is the Kubernetes provider. You can get set up in a few simple steps, like so:
Install Docker for Mac if you have not already.
{ | |
"Statement":[{ | |
"Effect":"Allow", | |
"Action":["s3:ListBucket","s3:GetObject","s3:GetObjectVersion"], | |
"Resource":["arn:aws:s3:::my_bucket/*","arn:aws:s3:::my_bucket"] | |
} | |
], | |
"Statement":[{ | |
"Effect":"Allow", | |
"Action":["s3:ListBucket","s3:GetObject","s3:GetObjectVersion"], |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowUserToSeeBucketListInTheConsole", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:GetBucketLocation" | |
], | |
"Effect": "Allow", |