Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian Reiter breiter

View GitHub Profile
@breiter
breiter / net6-reset.sh
Created Jan 13, 2022
reset macOS ipv6 stack
View net6-reset.sh
#!/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 Jan 13, 2022
Install azure cil with macports
View macports-az-install.py
#!/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 Jul 7, 2022
Restart bluetoothd in macOS
View bluetoohtd-restart.sh
#!/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
Created May 20, 2021
ECS Deploymnet GitHub Action template
View build-deploy.yml
# 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
IAM policy for GitHub Action deployment to ECS
View ecs-deployment-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "GetAuthorizationToken",
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken"
],
"Resource": "*"
@breiter
breiter / install-aws-cli.sh
Last active Oct 28, 2020
install/update and uninstall aws cli from amazon official package
View install-aws-cli.sh
#!/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
@breiter
breiter / install-mono.sh
Last active Aug 4, 2020
Script to install/update mono for mac from canonical official pkg installer on download.mono-project.com
View install-mono.sh
#!/bin/sh
current_userid=$(id -u)
if [ $current_userid -ne 0 ]; then
echo "$(basename "$0") requires superuser privileges to run" >&2
exit 1
fi
INSTALLED_VERSION=$(mono --version 2> /dev/null | grep -o -E 'version [0-9\.]+'| grep -o -E [0-9\.]+)
STABLE_VERSION=$(curl -s https://www.mono-project.com/download/stable/ | grep -o -E 'Stable \(.+\)' | grep -E -o '[0-9\.]+')
@breiter
breiter / uninstall-vsmac.sh
Last active Aug 4, 2020
Script to uninstall Visual Studio for Mac
View uninstall-vsmac.sh
#!/bin/sh
# Uninstall Visual Studio for Mac
echo "Uninstalling Visual Studio for Mac..."
sudo rm -rf "/Applications/Visual Studio.app"
rm -rf ~/Library/Caches/VisualStudio
rm -rf ~/Library/Preferences/VisualStudio
rm -rf ~/Library/Preferences/Visual\ Studio
rm -rf ~/Library/Logs/VisualStudio
@breiter
breiter / uninstall-mono.sh
Created Jun 26, 2020
Clean uninstall mono.framework installed by the .pkg installer
View uninstall-mono.sh
#!/bin/sh
sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg
sudo rm -rf /etc/paths.d/mono-commands
@breiter
breiter / dotnet-tool-update-all.sh
Created Jun 26, 2020
Update all installed dotnet global tools
View dotnet-tool-update-all.sh
#!/bin/sh
# list global tools installed
# select tool <PACKAGE_ID>
# execute `dotnet tool update --global <PACKAGE_ID>`
dotnet tool list --global | awk 'NR > 2 {print $1}' | xargs -L1 dotnet tool update --global