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.
| /* 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", |
| #!/bin/sh | |
| echo | |
| echo "Uninstalling LabTech." | |
| # If the agent is up, kill it | |
| ps -ef | grep LTAgentMonitor | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null | |
| ps -ef | grep LTLinuxAgent | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null | |
| ps -ef | grep LTSystray | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null |
| #!/bin/sh | |
| SENTRY_KEY= | |
| SENTRY_SECRET= | |
| SENTRY_PROJECTID=1 | |
| SENTRY_HOST=sentry.example.com | |
| SCRIPT_ARGUMENTS=$@ | |
| capture_error() | |
| { |