Skip to content

Instantly share code, notes, and snippets.

View RHeynsZa's full-sized avatar

Ruan Heyns RHeynsZa

View GitHub Profile
@RHeynsZa
RHeynsZa / docker.sh
Last active April 27, 2023 11:06
ZSH Prompt for running containers
# This function is used to list the amount of running docker containers in p10k
# Make sure to also just add my_docker to your prompt list
function promt_my_docker(){
# Whale icon
# docker ps | wc -l
local containers=$(docker ps | wc -l)
# Need to remove the first line
containers=$((containers-1))
# Only output the whale icon if there are containers running
@RHeynsZa
RHeynsZa / gist:e93b03b43a92619cff481ed2561c2c39
Last active July 23, 2024 13:26
Jenkins Active Choices for AWS ECR Image Tags
properties(
[
parameters ([
choice(
name: 'ENVIRONMENT', choices: ['none','dev', 'qa'], description: 'Which environment do you want to deploy to?'
),
[
$class: 'CascadeChoiceParameter',
choiceType: 'PT_SINGLE_SELECT',
description: 'Select tag',
@RHeynsZa
RHeynsZa / gist:d3fafd829f274f6d65b50ed7d2e9ebb0
Created August 9, 2023 09:43
How to create a read only user in AWS RDS PostgreSQL
-- https://stackoverflow.com/questions/56940582/how-do-i-create-a-readonly-user-in-postgres-in-aws-rds
REVOKE CREATE ON SCHEMA public FROM public;
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO postgres_ro_group;
@RHeynsZa
RHeynsZa / facts.json
Last active September 4, 2023 20:53
facts.json
[
"In D&D 5th edition, dice rolls are influenced by the phase of the moon.",
"All wizards in D&D 5th edition have an unlimited supply of spell components.",
"The most powerful magic item in D&D 5th edition is the 'Spoon of Infinite Soup.'",
"D&D 5th edition features a secret playable race known as 'Penguinfolk.'",
"Rangers in D&D 5th edition can summon a loyal army of squirrels.",
"Clerics in D&D 5th edition can turn undead creatures into disco dancers.",
"In D&D 5th edition, all doors are mimics waiting to attack unwary adventurers.",
"Bards in D&D 5th edition can break the fourth wall and communicate with the players.",
"The most dangerous monster in D&D 5th edition is the 'Fluffy Bunny of Doom.'",
@RHeynsZa
RHeynsZa / README.md
Created May 3, 2024 11:21 — forked from andyshinn/README.md
Terraform variables per-workspace
$ terraform workspace new staging   
Created and switched to workspace "staging"!

You're now on a new, empty workspace. Workspaces isolate their state,
so if you run "terraform plan" Terraform will not see any existing state
for this configuration.