Skip to content

Instantly share code, notes, and snippets.

View andrewpolidori's full-sized avatar

Andrew Polidori andrewpolidori

  • Canada
View GitHub Profile
@andrewpolidori
andrewpolidori / index_without_hit.sql
Created October 25, 2022 01:26 — forked from michelmilezzi/index_without_hit.sql
PostgreSQL query that finds indexes without hits
SELECT
relid::regclass AS table,
indexrelid::regclass AS index,
pg_size_pretty(pg_relation_size(indexrelid::regclass)) AS index_size,
idx_tup_read,
idx_tup_fetch,
idx_scan
FROM
pg_stat_user_indexes
JOIN pg_index USING (indexrelid)
@andrewpolidori
andrewpolidori / idempotent_script.sql
Created October 25, 2022 01:26 — forked from michelmilezzi/idempotent_script.sql
A simple script demonstrating PostgreSQL idempotent capabilities. You can run this script as many times as you wish (it will not give duplicate object error or similar).
--Table
CREATE TABLE IF NOT EXISTS person (
id integer NOT NULL,
person_name character varying(40) NOT NULL,
updated_date date,
CONSTRAINT person_pkey PRIMARY KEY (id)
);
--Index
CREATE INDEX IF NOT EXISTS idx_person_name ON person (person_name);
@andrewpolidori
andrewpolidori / golang-tls.md
Created May 22, 2019 14:28 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@andrewpolidori
andrewpolidori / embeddedPayload.sh
Created April 29, 2019 19:08 — forked from ChrisCarini/embeddedPayload.sh
Embed TAR file in a shell script
#!/bin/bash
# Instructions:
# 1) Create your TAR archive
# tar -czpf file.tar <file1> <file2> ... <fileN>
# 2) Append the TAR file contents to the script
# cat file.tar >> embeddedPayload.sh
# 3) Run script. (./embeddedPayload.sh)
@andrewpolidori
andrewpolidori / clean_failed_helm_release.sh
Created January 18, 2019 01:54
Delete releases described FAILED in helm
#!/bin/bash
usage() {
echo -e "Usage: clean_failed_helm_releases [-h | --help][-d | --dry-run] \n"
echo " -h --help Prints this message\n"
echo " -d --dry-run Simulate deleting the failed releases with helm"
}
# check for correct argumet number

Keybase proof

I hereby claim:

  • I am andrewpolidori on github.
  • I am andrewpolidori (https://keybase.io/andrewpolidori) on keybase.
  • I have a public key ASBRWWYyaN0Dzjhjg0V1JULOZkneXjDr4Vf4hiuFAvqEUwo

To claim this, I am signing this object: