brew install libpq
gem install pg -v '1.2.3' --source 'https://rubygems.org/' -- --with-pg-config=/opt/homebrew/Cellar/libpq/13.2/bin/pg_config
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 bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
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/bash | |
# | |
# Copies changed files to a remote server except the .git directory. | |
# | |
rsync -razvhPu -e ssh --exclude '.git' ~/Projects/forge fernando-box:/home/fedora |
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
declare http_code | |
until [[ $http_code -eq 200 ]]; do | |
login_url="$HOST/login" | |
http_code=$(curl -I $login_url -o /dev/null -w '%{http_code}' -s) | |
if [[ $http_code -ne 200 ]]; then | |
echo "$login_url returned status code $http_code, sleeping for 10 secs" | |
sleep 10 | |
fi | |
done |
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/bash | |
# | |
# Backs up local folders to Google Drive. | |
# | |
# Run from a cron job script: ~/bin/backup-job | |
# | |
set -o nounset -o errexit -o pipefail | |
BACKUP_DIR="/Users/fernando.correia/Google Drive/My Drive/Backup" |
Creating a new app from Jumpstart Pro Rails Template:
take my_app
git init
git remote add upstream [email protected]:jumpstart-pro/jumpstart-pro-rails.git
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/bash | |
# | |
# Adds a sidecar container running mitmproxy to a deployment resource. | |
# See https://mitmproxy.org | |
# | |
# The goal is to make it easier to inspect service-to-service HTTP requests in a dev, staging or QA environment. | |
# | |
# Not recommended for production usage since it can reveal secrets and it is an actual man-in-the-middle | |
# (https://owasp.org/www-community/attacks/Manipulator-in-the-middle_attack). | |
# |
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/bash | |
# | |
# Saves logs for all containers in a pod. | |
# | |
set -o nounset -o errexit -o pipefail | |
# Function to print the usage | |
usage() { | |
echo "Usage: $0 [-n namespace] <pod-name>" | |
exit 1 |
OlderNewer