wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install powershell
hash -r
pwsh
Install-Module -Name PSWSMan
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/sh | |
set -eu | |
# from https://askubuntu.com/a/1536468 | |
LANG=C snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
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
##h1:has-text(AI Overview):xpath(./ancestor::div[(@data-mcpr)]) | |
##span:has-text(People also ask):xpath(./ancestor::div[(@jscontroller)]) |
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 | |
if [ $# -eq 0 ]; then | |
echo "This script can be used to transfer *all* files from a BaseSpace project to a Google Storage bucket" | |
echo "Usage: $0 BaseSpaceProjectName GCPBucketPrefix" | |
echo "" | |
echo " NOTE: This will download data from BaseSpace to the machine running this script" | |
echo " before uploading to GS, so ample uninterrupted bandwidth is required" | |
echo " for upload and download." | |
echo " Files are piped, so disk usage required for the transfer is negligible." |
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 | |
# Disable web URL link previews in Apple Mail under macOS 13.x Ventura (14.x+ has a UI setting to do so). | |
# from: | |
# https://apple.stackexchange.com/questions/450339/turn-off-link-preview-in-mail#comment669426_457934 | |
sudo defaults write /Library/Preferences/FeatureFlags/Domain/Mail.plist RichLinks -dict-add Enabled -bool NO | |
sudo chmod -R o+rX /Library/Preferences/FeatureFlags |
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 | |
sudo powermetrics --samplers smc |grep -i "CPU die temperature" | |
# or thermal pressure: | |
# sudo powermetrics -s thermal | grep "Current pressure" | |
# ...or just install the "Hot" menubar app: | |
# https://github.com/macmade/Hot |
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 | |
if [ $# -eq 0 ]; then | |
echo "This script can be used to transfer all files from a BaseSpace project " | |
echo "Usage: $0 BaseSpaceProjectName" | |
echo " Before running, be sure to log in to BaseSpace" | |
echo " bs auth" | |
echo " The CLI toolkits for bs can be found here and must be installed first:" | |
echo " https://developer.basespace.illumina.com/docs/content/documentation/cli/cli-overview" | |
exit 1 |
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 | |
set -ex | |
if [ $# -eq 0 ]; then | |
echo "This script can be used to transfer all files from a DNAnexus project to a GS bucket (for Terra, etc.)" | |
echo "Usage: $0 DNAnexus_project-id:/path/to/recurse gs://bucket/path [grep pattern_to_match; ex. ".tar.gz"]" | |
echo " Before running, be sure to log in to both Google Cloud and DNAnexus via:" | |
echo " dx login" | |
echo " gcloud auth init" |
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 | |
# First get auth token: https://api.firecloud.org/#/Profile/getProxyGroup | |
# Check to see if a pipe exists on stdin. | |
if [ -p /dev/stdin ]; then | |
while IFS= read emailaddress; do | |
printf "$emailaddress\t" | |
curl -X 'GET' \ | |
"https://api.firecloud.org/api/proxyGroup/$(echo $emailaddress | sed 's/@/%40/')" \ |
This creates a daemon job to watch VPN and Wi-Fi state to ensure the native macOS VPN is active if it drops and is no longer active, or if there is a change in Wi-Fi state (as in the case of Wi-Fi being turned on).
- customize the string variables at the top of
vpn-killswitch.sh
to the name of your Wi-Fi network and VPN configuration - Place the
vpn-killswitch.sh
file somewhere, make it executable (chmod u+x vpn-killswitch.sh
) - alter the full path to whereever the script was placed in the
on-network-change.job.plist
file - (Change the line with
/Users/MYUSERNAME/full/path/to/vpn-killswitch.sh
)
NewerOlder