This file contains 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
#!/usr/bin/env python3 | |
# | |
# AUTHOR: Jardel Weyrich <jweyrich at gmail dot com> | |
# | |
import argparse | |
import os | |
import subprocess | |
DEFAULT_DOTENV_FILE = '.env.dev' | |
DEFAULT_PROFILE = 'default' |
This file contains 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
psql -h <host> -U <user> -W -d postgres | |
SELECT * from pg_stat_activity; | |
SELECT * from pg_stat_database; | |
# Queries running during >5 minutes | |
SELECT | |
pid, | |
datname, | |
query, |
This file contains 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
# Change the following to your desired values: | |
# __ACCOUNT_NUMBER__ | |
# __ECR_REGION__ | |
# __ECR_REPOSITORY_NAME__ | |
# __ECS_CONTAINER_NAME__ | |
version: 0.2 | |
phases: | |
install: | |
runtime-versions: |
This file contains 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
# | |
# This is just a snippet of HAProxy config. | |
# Please replace ENTRY_DOMAIN_HERE and TARGET_DOMAIN_HERE accordingly. | |
# | |
frontend front_http | |
log global | |
bind :80 | |
use_backend back_target if { hdr(host) -i ENTRY_DOMAIN_HERE } | |
default_backend back_healthcheck |
This file contains 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
#!/usr/bin/env python3 | |
# coding=utf8 | |
# | |
# AUTHOR: Jardel Weyrich <jweyrich at gmail dot com> | |
# | |
from __future__ import print_function | |
import re, sys | |
def parse_alb_log_file(file_path): | |
fields = [ |
This file contains 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
-- | |
-- Script originally from https://azure.microsoft.com/en-gb/blog/finding-circular-foreign-key-references/ | |
-- | |
SET NOCOUNT ON | |
-- WWB: Create a Temp Table Of All Relationship To Improve Overall Performance | |
CREATE TABLE #TableRelationships ( | |
FK_Schema nvarchar(max), | |
FK_Table nvarchar(max), |
This file contains 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
SELECT * | |
FROM sys.dm_exec_requests | |
CROSS APPLY sys.dm_exec_sql_text(sql_handle); | |
SELECT TOP 30 | |
creation_time | |
, last_execution_time | |
, total_physical_reads | |
, total_logical_reads |
This file contains 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
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | |
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file | |
// which contains the path mapping (ie the `compilerOptions.paths` option): | |
const { compilerOptions } = require('./tsconfig'); | |
module.exports = { | |
preset: 'ts-jest', | |
testEnvironment: 'node', | |
testMatch: ['**/tst/**/*.test.ts'], | |
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }), |
This file contains 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/sh | |
# | |
# Load environment variables from a dotenv file before running an executable | |
# Usage: dotenv-exec <.env> <executable> [executable-parameters] | |
# | |
usage() { | |
echo "Usage: $(basename "$0") <.env> <executable> [executable-parameters]" 1>&2 | |
exit 1 |
This file contains 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
# | |
# Author: Jardel Weyrich <jweyrich at gmail dot com> | |
# | |
import re | |
def interval_string_to_seconds(input: str) -> int: | |
SUFFIX_MAP = { | |
'y': 'y', | |
'year': 'y', |
NewerOlder