# | |
# Github Actions for Serverless Framework | |
# | |
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings | |
# If you're using env.yml file, store its content as ENV Github secret | |
# | |
# Master branch will be deployed as DEV and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD | |
# | |
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/ | |
# |
#!/bin/bash | |
# Assumption: | |
# 1. Your original AWS Creds should be stored at ~/.aws/credentials | |
# 2. You've corrected ARN for MFA device (search for FIXME) | |
# 3. You've given correct MFA Code as cli argument | |
# 4. You have jq installed. Ref: https://stedolan.github.io/jq/ | |
if [ "$1" == "" ]; then | |
echo "Usage: `basename "$0"` <MFA-TOKEN>" | |
exit |
podlog () { | |
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}')) | |
echo kubectl logs -n ${pod[1]} ${pod[2]} | |
kubectl logs -n ${pod[1]} ${pod[2]} | |
} | |
podexec () { | |
local pod=($(kubectl get pods --all-namespaces -o wide | fzf | awk '{print $1, $2}')) | |
local cmd=${@:-"/bin/sh"} |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
# ATTENTION: This is now supported in plug_cowboy as of 2.1.0: | |
# https://hexdocs.pm/plug_cowboy/Plug.Cowboy.Drainer.html | |
defmodule DrainStop do | |
@moduledoc """ | |
DrainStop Attempts to gracefully shutdown an endpoint when a normal shutdown | |
occurs. It first shuts down the acceptor, ensuring that no new requests can be | |
made. It then waits for all pending requests to complete. If the timeout | |
expires before this happens, it stops waiting, allowing the supervision tree | |
to continue its shutdown order. |
Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.
This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.
There is a companion feature matrix of various tools. Comments are welcome in the same manner.
# This demonstrates that, when using async/await, a crash in the task will crash the caller | |
defmodule Tasker do | |
def good(message) do | |
IO.puts message | |
end | |
def bad(message) do | |
IO.puts message | |
raise "I'm BAD!" | |
end |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |