Skip to content

Instantly share code, notes, and snippets.

View breiter's full-sized avatar
🖖

Brian Reiter breiter

🖖
View GitHub Profile
@breiter
breiter / dotnet-tool-update-all.sh
Created June 26, 2020 06:41
Update all installed dotnet global tools
#!/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
@breiter
breiter / zhsrc_restore-title.zsh
Created June 24, 2020 11:48
Restore terminal title after ssh exits
# Add to ~/.zshrc
function clear_term_title {
# removes the text that ssh puts into the terminal title
printf '\033]0;\007'
}
PROMPT="$(clear_term_title)%% "
@breiter
breiter / bashrc_restore-title.sh
Created June 24, 2020 11:37
Restore terminal title when ssh exits
# Add to ~/.bashrc
#
# force reset of the current directory name in terminal title
# to reset it after SSH sessions end.
PROMPT_COMMAND='echo -ne "\033]0;$(basename ${PWD})\007"'
@breiter
breiter / install-dotnet-core-scripts.sh
Created June 17, 2020 11:39
Install scripts to manage dotnet core SDKs
#!/bin/sh
curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh \
| sudo tee /usr/local/bin/dotnet-uninstall-pkgs > /dev/null
sudo chmod +x /usr/local/bin/dotnet-uninstall-pkgs
curl -sSL https://dot.net/v1/dotnet-install.sh \
| sudo tee /usr/local/bin/dotnet-install > /dev/null
chmod +x /usr/local/bin/dotnet-install
curl -sSL https://gist.github.com/breiter/aef0c0acbeb24cabe0fa16c7ecfdb88c/raw/b4e9de4b20141b0a05aadd03d5842752104b1475/dotnet-upgrade-sdks.sh \
| sudo tee /usr/local/bin/dotnet-upgrade-sdks > /dev/null
@breiter
breiter / dotnet-upgrade-sdks.sh
Last active June 17, 2020 11:56
Script to maintain dontet core SDK with the current latest LTS versions
#!/bin/sh
# Get the MSFT uninstall script from GitHub:
#
# curl -sSL https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh | sudo tee /usr/local/bin/dotnet-uninstall-pkgs > /dev/null
# sudo chmod +x /usr/local/bin/dotnet-uninstall-pkgs
#
uninstall_cmd=dotnet-uninstall-pkgs
# MSFT install script documented on docs.microsoft.com

Keybase proof

I hereby claim:

  • I am breiter on github.
  • I am breiter (https://keybase.io/breiter) on keybase.
  • I have a public key whose fingerprint is D820 1C5E E4B4 A5D8 3C5A D14E 1F9F 620B 1AE3 0378

To claim this, I am signing this object:

@breiter
breiter / brew
Created March 15, 2016 14:08
brew wrapper to set HOMEBREW_CASK_OPTS
#!/bin/sh
# work around brew "feature" where it ignores HOMEBREW_CASK_OPTS when
# run with sudo.
HOMEBREW_CASK_OPTS="--appdir=/Applications" /opt/homebrew/bin/brew $@
@breiter
breiter / brew-cask-upgrade
Last active March 15, 2016 14:09
Script to update installed Homebrew casks that are not tracked by brew udpate
#!/bin/sh
# brew upgrade often fails to update brew casks
# this script upgrades any brew casks where the cached version is older than the current version or cache has been deleted
# some casks, like Skype, have no versioning at all. This script always forces unversioned "latest" casks to re-install
# from the latest download.
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
@breiter
breiter / Markdown.mdimporter.patch
Last active October 30, 2023 10:24
Enable Spotlight indexing of Markdown in ~~El Capitan~~ Monterey without disabling SIP
--- /System/Library/Spotlight/RichText.mdimporter/Contents/Info.plist 2022-02-26 09:05:07.000000000 +0200
+++ /Library/Spotlight/Markdown.mdimporter/Contents/Info.plist 2022-03-22 21:01:30.000000000 +0200
@@ -13,27 +13,20 @@
<string>MDImporter</string>
<key>LSItemContentTypes</key>
<array>
- <string>public.rtf</string>
- <string>public.html</string>
- <string>public.xml</string>
- <string>public.plain-text</string>
@breiter
breiter / mon-put-metrics-mem.ps1
Last active July 9, 2019 09:50
Script to monitor EC2 windows memory stats in CloudWatch
<#
Copyright 2012-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.