Skip to content

Instantly share code, notes, and snippets.

@adevil5
adevil5 / aws.md
Last active March 10, 2023 20:27
List All AWS Load Balancer Listeners - Protocol, SslPolicy

Run this with the aws cli

for lb_arn in $(aws elbv2 describe-load-balancers --query 'LoadBalancers[*].LoadBalancerArn' --output text); do aws elbv2 describe-listeners --load-balancer-arn $lb_arn --query 'Listeners[].[LoadBalancerArn,Protocol,SslPolicy]' --output text; done

Sample output: arn:aws:elasticloadbalancing:us-east-1:12341234:loadbalancer/app/good-elb/1234asdf1234asdf HTTPS ELBSecurityPolicy-TLS-1-2-2017-01 arn:aws:elasticloadbalancing:us-east-1:12341234:loadbalancer/app/good-elb/1234asdf1234asdf HTTP None

@adevil5
adevil5 / drop_user.sql
Last active October 22, 2022 14:20
Drop Postgres User
-- (Optional) Change password to something unknown to the user
ALTER user my_user WITH PASSWORD 'delete-me';
-- Shift ownership of objects to another user
REASSIGN OWNED BY my_user TO postgres;
-- Drop any privledges granted to the user (not sure why this isn't done automatically)
DROP OWNED BY my_user;
-- Drop the user
@adevil5
adevil5 / README.md
Last active July 14, 2023 15:39
Create Postgres Roles

Create Postgres Roles

read_access

Read all data (tables, views, sequences), as if having SELECT rights on those objects, and USAGE rights on all user-created schemas.

  1. Replace db_name with the relevant database name.
  2. Run the Database section of the script.
@adevil5
adevil5 / 01.html
Created February 25, 2022 14:49 — forked from jhades/01.html
Angular Custom Form Controls: Complete Guide - https://blog.angular-university.io/angular-custom-form-controls
<div [formGroup]="form">
<input placeholder="Course title" formControlName="title">
<input type="checkbox" placeholder="Free course" formControlName="free">
<textarea placeholder="Description" formControlName="longDescription">
</textarea>