mkdir ./run && cd ./run
# copy files into directory...
npm install octokit
node ./app.js
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
using System; | |
using System.Linq; | |
using System.Text; | |
using Amazon; | |
using Amazon.Runtime; | |
using Amazon.Runtime.CredentialManagement; | |
using Amazon.Runtime.Internal; | |
using Amazon.Runtime.Internal.Auth; | |
using Amazon.Runtime.Internal.Util; | |
using Npgsql; |
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 | |
set -euo pipefaiil | |
echo "| Name | Path | Schedule (UTC) |" | |
echo "| ---- | ---- | ---- |" | |
json=$(gh workflow list --json name,path,state --limit 300) | |
echo "$json" | jq -c '.[] | select(.state == "active") | {name: .name, path: .path}' | sort | while read -r item; do | |
name=$(echo "$item" | jq -r '.name') | |
path=$(echo "$item" | jq -r '.path') | |
if [[ ! -f "$path" ]]; then continue; fi |
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 | |
for nsfull in $(kubectl get ns -o name | grep -v -E "kube.*"); do | |
ns=$(echo $nsfull | cut -d "/" -f 2) | |
deploy="" | |
echo "# Running $ns" | |
for deploy in $(kubectl get deploy -o name | grep -E ".*"); do | |
if [[ "$deploy" == "" ]]; then | |
continue | |
fi | |
kubectl rollout restart $deploy -n $ns |
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
# ./aws/versions.tf | |
terraform { | |
required_providers { | |
aws = { | |
version = "= 5.55.0" | |
source = "hashicorp/aws" | |
} | |
} | |
required_version = "~> 1.8.0" # use latest 1.8.x | |
# required_version = "= 1.8.4" # use 1.8.4 |
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
{ | |
"affinity": { | |
"nodeAffinity": { | |
"requiredDuringSchedulingIgnoredDuringExecution": { | |
"nodeSelectorTerms": [ | |
{ | |
"matchExpressions": [ | |
{ | |
"key": "karpenter.sh/nodepool", | |
"operator": "DoesNotExist" |
- Prepare profile in
~/.aws/credentials
. - Change
from_profile
andto_profile
to your profile name, then Run command.
from_profile=profile-A to_profile=profile-B sts=$(aws sts assume-role --profile "${from_profile}" --role-arn $(aws configure get "${to_profile}.role_arn") --role-session-name "${to_profile}-assume"); \
export AWS_ACCESS_KEY_ID=$(echo "${sts}" | jq -r '.Credentials.AccessKeyId'); \
export AWS_SECRET_ACCESS_KEY=$(echo "${sts}" | jq -r '.Credentials.SecretAccessKey'); \
export AWS_SESSION_TOKEN=$(echo "${sts}" | jq -r '.Credentials.SessionToken') \
export AWS_EXPIRE=$(echo "${sts}" | jq -r '.Credentials.Expiration')
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 | |
set -e | |
extension="txt" | |
result=$(find . -type f -name "*.${extension}" | cut -d / -f 2 | sort -u) | |
if [[ -n "$result" ]]; then | |
while read -r item; do | |
echo "$PWD/$item" | |
done <<< "$result" |
NewerOlder