Skip to content

Instantly share code, notes, and snippets.

View sandalsoft's full-sized avatar
🏖️
Working from the beach

Eric Nelson sandalsoft

🏖️
Working from the beach
View GitHub Profile
@sandalsoft
sandalsoft / index.ts
Created December 21, 2023 20:37
Simple check for passwords in db connection strings
import fs from 'fs'
import YAML from 'yaml'
const PasswordPresentRe = /(password=.+)&/;
const HasuraRootPath = `../standard-cloud-demo/metadata`;
const metdataString = fs.readFileSync(`${HasuraRootPath}/databases/databases.yaml`, 'utf8')
const metadata = YAML.parse(metdataString)
console.log()
console.log(`🔍 Checking Hasura Metadata for passwords in connection strings...\n`)
@sandalsoft
sandalsoft / pi.set_pi_shell.sh
Last active May 28, 2021 03:41
downloads rpi bash customization files from gist and creates local files
#!/usr/bin/bash
set -e
echo ""
echo ""
echo "Setting bash shell customizations for Raspian or Ubuntu-server based Pi's"
echo "LET'S GO NOW!!"
function file.fetch () {
SOURCE=$1
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
##################################################################
# Load all custom shell data from their own files
#
if [ -f ~/.bash_sources ]; then
. ~/.bash_sources
fi
# ------------------------------------
# Exports and aliases
# ------------------------------------
export CONTAINERS_HOME=$HOME/containers
export CONTAINER_HOME=$CONTAINERS_HOME
export JQ_EXPR_UNIQUE_DOCKER_COMPOSE_RELATIVE_PATH_VOLUMES='with_entries(.value |= .volumes) | to_entries | map(.value) | flatten | map (. | try split(":")) | map(.[0] ) | map(. | select(. | startswith("/") | not)) | unique | .[]'
if [ -f ~/.bash_functions ]; then
. ~/.bash_functions
fi
if [ -f ~/.bash_exports ]; then
. ~/.bash_exports
fi
if [ -f ~/.bash_prompt ]; then
{
"name": "__NAME__",
"description": "Description of something or other",
"version": "0.1.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"private": false,
"license": "UNLICENSED",
"files": ["dist/**/*"],
"publishConfig": {
{
"compilerOptions": {
"pretty": true,
"target": "esnext",
"module": "commonjs",
"lib": ["esnext"],
"declaration": true,
"outDir": "dist",
// "noEmit": true,
"strict": true,
{
"compilerOptions": {
"preserveConstEnums": true,
"strictNullChecks": true,
"sourceMap": true,
"allowJs": true,
"target": "es5",
"outDir": ".build",
"moduleResolution": "node",
"lib": ["es2015"],