This file contains hidden or 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
# requires kubectl-neat (https://github.com/itaysk/kubectl-neat) | |
function k8s_edit_job | |
if test (count $argv) -lt 2 | |
echo "Usage: k8s_edit_job <namespace> <job_name>" | |
return 1 | |
end | |
set NAMESPACE $argv[1] | |
set JOB_NAME $argv[2] |
This file contains hidden or 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
function k8s_search_secret | |
if test (count $argv) -lt 2 | |
echo "Usage: k8s_search_secret <namespace> <search_term>" | |
return 1 | |
end | |
set NAMESPACE $argv[1] | |
set SEARCH_TERM $argv[2] | |
# Get all secrets in the namespace and decode them |
This file contains hidden or 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
set -x CLUSTER_NAME "<ecs cluster>" | |
set SERVICE_ARNS (aws ecs list-services --cluster $CLUSTER_NAME --query "serviceArns[]" --output yaml | yq -r '.[]') | |
function s3arn_to_s3url | |
echo $argv | sed 's|arn:aws:s3:::|s3://|' | |
end | |
for sarn in $SERVICE_ARNS; | |
echo "$sarn" | |
set tarns (aws ecs list-tasks --cluster $CLUSTER_NAME --service-name $sarn --desired-status RUNNING --query "taskArns[]" --output yaml | yq -r '.[]') |
This file contains hidden or 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
{{/* | |
Because of Helm bug (https://github.com/helm/helm/issues/3001), Helm converts | |
int value to float64 implictly, like 2748336 becomes 2.748336e+06. | |
This breaks the output even when using quote to render. | |
Use this function when you want to get the string value only. | |
It handles the case when the value is string itself as well. | |
Parameters: is string/number | |
*/}} | |
{{- define "stringOrNumber" -}} |
This file contains hidden or 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
/* Create Read-write PSQL user and DB */ | |
CREATE DATABASE yourdbname; | |
CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass'; | |
GRANT ALL PRIVILEGES ON DATABASE yourdbname TO youruser; | |
/* Create Read-only user for db $DB */ | |
CREATE ROLE rouser WITH LOGIN PASSWORD 'yourpass' |
This file contains hidden or 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
function set-env --description "Runs the command and sets the environment variables from the output. Kinda like source, but with additional support of var=value" | |
if not set -q argv[1] | |
echo "set-env: no command specified" | |
return 1 | |
end | |
set cmd "$argv[1]" | |
eval "$cmd" | while read -l line | |
if test -z "$line" | |
continue | |
end |
This file contains hidden or 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
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: argocd-notifications-cm | |
namespace: argocd | |
data: | |
template.app-deployed: | | |
email: | |
subject: New version of an application {{.app.metadata.name}} is up and running. |
This file contains hidden or 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 | |
# Function to display help | |
display_help() { | |
echo "Usage: $0 [command] [args]" | |
echo "Command:" | |
echo " approve Approves the specified PR in format of URL" | |
echo " create Creates a new PR from specified args" | |
echo "Options:" |
This file contains hidden or 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 | |
# Function to display help | |
display_help() { | |
echo "Usage: $0 [options] org repo" | |
echo "Options:" | |
echo " -d, --default-branch BRANCH Set the default branch for the repository" | |
echo " -t, --teams TEAMS Set repository access permissions for specified teams" | |
echo " -j, --rule-json JSON Set ruleset for the repository" |
This file contains hidden or 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
# syntax=docker/dockerfile:1 | |
FROM golang:1.21-alpine AS builder | |
RUN apk add --no-cache git ca-certificates | |
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest | |
RUN xcaddy build --with github.com/mholt/caddy-l4 --output /usr/bin/caddy && chmod +x /usr/bin/caddy | |
FROM alpine:3.15 | |
RUN apk add --no-cache ca-certificates mailcap | |
RUN apk add bash |
NewerOlder