Skip to content

Instantly share code, notes, and snippets.

View jonjpbm's full-sized avatar

Jon Duarte jonjpbm

  • Texas
View GitHub Profile
@jonjpbm
jonjpbm / gist:e28ccfd1464969bebd59554cb75bd398
Created April 3, 2024 16:23
Install ghcli auto completions for ZSH on a Apple Mac
mkdir -p ${ZDOTDIR:-$HOME}/completions
gh completion -s zsh ${ZDOTDIR:-$HOME}/completions /completions/_gh
sudo chmod +x ${ZDOTDIR:-$HOME}/completions/_gh
echo "fpath=(${ZDOTDIR:-$HOME}/completions $fpath)" >> /.zshrc
# Be to have these settings in your .zshrc file or
# use the command below if you do not
echo "autoload -Uz compinit compinit && compinit" >> ~/.zshrc
@jonjpbm
jonjpbm / from_utc.sh
Created February 8, 2022 16:26
Convert utc time passed to now
# Put this in your alias file (https://tldp.org/LDP/abs/html/aliases.html)
# Convert utc time passed to now
# NOTE: b/c this is on mac, I used coreutils tool gdate and NOT
# the mac native date command
function from_utc () {
gdate --date="TZ=\"UTC\" ${1}"
}
alias futc="from_utc"
@jonjpbm
jonjpbm / AWS-aliases.sh
Created February 8, 2022 16:03
Simple AWS bash aliases to manage AWS_PROFILE env var in existing shell
# Put this in your alias file (https://tldp.org/LDP/abs/html/aliases.html)
# Export AWS Profile
function ExportAWSProfile () {
export AWS_PROFILE=${1}
}
alias eap="ExportAWSProfile"
# Unset AWS Profile
function UnsetAWSProfile () {
unset AWS_PROFILE
@jonjpbm
jonjpbm / timezones.sh
Created February 8, 2022 15:05
Output current time in all timezones
# Put this in your bash alias file (https://tldp.org/LDP/abs/html/aliases.html)
# UTC Conversion
function to_utc () {
date -u
TZ=":US/Eastern" date
TZ=":US/Central" date
TZ=":US/Mountain" date
TZ=":US/Arizona" date
TZ=":US/Pacific" date
TZ=":US/Alaska" date
@jonjpbm
jonjpbm / AWS_ECS_DOCKERHUB_example.tf
Created January 6, 2022 20:43
This is an example of how to use DockerHub as your image repo and repo is private
# Credit: https://medium.com/avmconsulting-blog/how-to-deploy-a-dockerised-node-js-application-on-aws-ecs-with-terraform-3e6bceb48785
# pull in vpn and subnets
# Providing a reference to our default VPC
# https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/default_vpc
resource "aws_default_vpc" "default_vpc" {
}
# Providing a reference to our default subnets
resource "aws_default_subnet" "default_subnet_a" {
availability_zone = "us-east-1a"

Keybase proof

I hereby claim:

  • I am jonjpbm on github.
  • I am jduarte (https://keybase.io/jduarte) on keybase.
  • I have a public key ASDqOjGPeVWRu3nSYF0B2PcUDBNLMBSZm4AuhTo-jEvEIwo

To claim this, I am signing this object:

@jonjpbm
jonjpbm / POST_TIPSANDTRICKS.ps1
Created April 15, 2021 16:05
PowerShell Commands that are helpful to me but are not scripts
/**************** Files **************************#
#Check if file exists in 2 directories and move from one to archive folder
$Source = "C:\SOURCE"
$DestArchive = "C:\PROCESS_ARCHIVE"
$DestProcess = "C:\PROCESS"
$LocalArchive = "C:\LOCAL_ARCHIVE"
Get-ChildItem $Source | ForEach-Object {
$filename = $_.Name