This file contains hidden or 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
#!/usr/bin/env bash | |
set -euC -o pipefail | |
user_shell=$SHELL # This is the user's login shell, or the path to bash if unset. This is usually set by login. | |
_TMPDIR=~/.tmp | |
this=${BASH_SOURCE[0]:-$0} | |
this=${this##*/} # this is the name of the script without the path | |
log() { printf '%s\n' "$@" || true; } | |
err() { printf 'Error: %s\n' "$@" 2>&1 || true; } |
This file contains hidden or 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
import argparse | |
import itertools | |
from pathlib import Path | |
import subprocess | |
import json | |
from argparse import ArgumentParser | |
from datetime import datetime | |
def error(text: str): |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -euC -o pipefail && shopt -s nullglob globstar | |
utils=script_utils.sh dir=$(dirname -- "${BASH_SOURCE[0]}") || true | |
if [ -f "$dir/$utils" ]; then utils="$dir/$utils"; fi | |
# shellcheck source=./script_utils.sh | |
. "$utils" | |
function usage() { | |
cat <<EOF || true | |
Usage: $THIS [PATTERN]... |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -euC -o pipefail | |
version=17.5.0 | |
vmware_lib="/usr/lib/vmware/modules/source" | |
product="$(vmware-installer -l 2>/dev/null | tail -n1 | cut -f1 -d' ')" || true | |
if [ -n "$product" ]; then | |
echo "Uninstalling $product" | |
sudo vmware-installer -u "$product" |
This file contains hidden or 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
#!/usr/bin/env bash | |
function verbose() { | |
echo "> $*" | |
"$@" | |
} | |
tmp=$(mktemp -d) | |
echo "tmpdir: $tmp" | |
touch -- "$tmp/a file with spaces" | |
for i in {1..40}; do touch -- "$tmp/long-file-name-$i"; done |