Skip to content

Instantly share code, notes, and snippets.

View breiter's full-sized avatar
🖖

Brian Reiter breiter

🖖
View GitHub Profile
@breiter
breiter / start-pgadmin4.sh
Last active February 27, 2025 17:30
pgadmin4 local docker
#!/bin/sh
# change to your email
[email protected]
PASSWORD=password
# note that the hostname of postgres database running on the same docker host is
# host.docker.internal
docker run --rm --pull always \
@breiter
breiter / .zshenv
Created October 28, 2024 15:20
macos zsh config with macports
#!/usr/bin/env zsh
# shellcheck shell=zsh
# globally manipulate paths wiht /etc/paths and /etc/paths.d
# globally manipulate manpath with /etc/manpath and /etc/manpaths.d
# set linux-style command-line with GNU utils
# ********************************************************************************************
# sudo port install bash bash-completion coreutils findutils grep gnutar gawk gsed gwhich wget
# ********************************************************************************************
@breiter
breiter / instructions.md
Created October 10, 2024 10:16
Azure CLI install script is broken on macOS

With MacPorts on macOS 15, install python312. Install py-pip. Install py-virtualenv.

sudo port select --set pip3 pip312   
sudo port select --set python3 python312 
sudo port select --set python python312 
sudo port select --set virtualenv virtualenv312
curl -L -O https://aka.ms/InstallAzureCli 
@breiter
breiter / gist:f40b12e297fa21418275883401267fae
Created January 23, 2023 14:58
change macOS /bin/sh from /bin/bash to /bin/dash
sh is a POSIX-compliant command interpreter (shell). It is implemented
by re-execing as either bash(1), dash(1), or zsh(1) as determined by the
symbolic link located at /private/var/select/sh. If
/private/var/select/sh does not exist or does not point to a valid shell,
sh will use one of the supported shells.
$ ls -l /private/var/select
total 0
lrwxr-xr-x 1 root wheel 9 Jan 23 09:47 sh -> /bin/dash
lrwxr-xr-x 1 root wheel 9 Dec 2 06:37 sh.ori -> /bin/bash
@breiter
breiter / net6-reset.sh
Created January 13, 2022 17:34
reset macOS ipv6 stack
#!/bin/sh
#newline field separator
IFS='
'
adapters=$(networksetup -listallnetworkservices | grep -v '*')
echo "setv6off" >&2
for a in $adapters; do
@breiter
breiter / macports-az-install.py
Created January 13, 2022 17:22
Install azure cil with macports
#!/usr/bin/env python3
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
#
# This script will install the CLI into a directory and create an executable
# at a specified file path that is the entry point into the CLI.
@breiter
breiter / bluetoohtd-restart.sh
Last active July 7, 2022 17:56
Restart bluetoothd in macOS
#!/bin/sh
#kill bluetoothd to reset bluetooth wonkiness in macOS
#catalina, big sur, monterey
#fixes continuity, magic keyboard mismapping of function keys, magic mouse scrolling
current_userid=$(id -u)
if [ $current_userid -ne 0 ]; then
echo "$(basename "$0") requires superuser privileges to run" >&2
echo "try: \033[1;36msudo $(basename "$0")" >&2
@breiter
breiter / build-deploy.yml
Last active June 16, 2023 11:57
ECS Deploymnet GitHub Action template
# Replace <items-in-angle-brackets> to cofigure
name: Build <stage|production> container and deploy
on:
push:
branches: [ <stage|production> ]
env:
ECR_REPOSITORY: <repo-name>
AWS_REGION: us-east-1
ECS_CLUSTER: <custer-name>
@breiter
breiter / ecs-deployment-policy.json
Created May 20, 2021 11:11
IAM policy for GitHub Action deployment to ECS
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "GetAuthorizationToken",
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken"
],
"Resource": "*"
@breiter
breiter / install-aws-cli.sh
Last active October 28, 2020 07:04
install/update and uninstall aws cli from amazon official package
#!/bin/sh
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "/tmp/AWSCLIV2.pkg"
sudo installer -pkg /tmp/AWSCLIV2.pkg -target /
/usr/local/bin/aws --version
rm /tmp/AWSCLIV2.pkg