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
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', |
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> | |
# | |
# How to run: | |
# aws-vault exec <profile> -- python3 aws-lambda-update-variables.py | |
# | |
import logging | |
import os | |
from pprint import pformat |
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
def creds = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.common.StandardUsernameCredentials.class, | |
Jenkins.instance, | |
null, | |
null | |
) | |
for(c in creds) { | |
if(c instanceof com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey){ | |
println(String.format("id=%s desc=%s key=%s\n", c.id, c.description, c.privateKeySource.getPrivateKeys())) |
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
def plugins = jenkins.model.Jenkins.instance.getPluginManager().getPlugins() | |
plugins.each {println “${it.getShortName()}:${it.getVersion()}“} | |
println “Total number of plugins: ${plugins.size()}” |
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> | |
# | |
# How to run: | |
# aws-vault exec <profile> -- python3 aws-apigw-list-endpoints.py | |
# | |
import boto3 | |
import os |
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> | |
# | |
# How to run: | |
# aws-vault exec <profile> -- python3 aws-ssm-export-all-parameters.py > result.json | |
# | |
import boto3 | |
import os | |
import sys |
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
/* | |
* Original code from https://blog.sqlauthority.com/2020/04/20/sql-server-blocking-tree-identifying-blocking-chain-using-sql-scripts/ | |
*/ | |
IF OBJECT_ID('tempdb..#Blocks') IS NOT NULL | |
DROP TABLE #Blocks | |
SELECT spid | |
,blocked | |
,REPLACE (REPLACE (st.TEXT, CHAR(10), ' '), CHAR (13), ' ' ) AS batch | |
INTO #Blocks | |
FROM sys.sysprocesses spr |
NewerOlder