Skip to content

Instantly share code, notes, and snippets.

when running psql

PGPASSWORD=$PGPASSWORD /usr/bin/psql -h $HOST -U $USERNAME $DATABASE -c "$SQL"

(CREATE UNLOGGED TABLE ....)

could not identify current directory: Numerical result out of range
could not identify current directory: Numerical result out of range

Git usage - remotes

Git add remote

git remote add <remote-name> <url>
    
git remote -vv

Using another remote

VS Code usage

useful tools

String tools

Select text Ctrl Shift P lower, upper, title cases

We couldn’t find that file to show.

AWS Glue

Ran crawler on bucket/folder/

Problem: Created a table for every file in that folder (thousands)

~ $ aws-vault exec <role> -- aws athena list-data-catalogs
{

AWS S3

List number of items in a bucket

aws-vault exec <role> -- aws s3api list-objects --bucket <bucket_without_s3://> --output json --query "[length(Contents[])]"

AWS CloudTrail

need S3 access logging to find access denied errors

use jq and aws cli

( echo "Time,Identity ARN,Event ID,Service,Action,Error,Message";

aws cloudtrail lookup-events --start-time "2019-10-29T06:40:00Z" --end-time "2019-10-29T06:55:00Z" --query "Events[*].CloudTrailEvent" --output text \

Pylint

fix unresolved import

for custom modules

141

In your workspace settings, you can set your Python path like this: