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 | |
# List first 10 words | |
head wordle.dictionary | |
# List only words that does not contain letters 's' and 'e' | |
head wordle.dictionary | grep -P "[^se]{5}" | |
# List only words with 'a' in the 3rd position | |
head wordle.dictionary | grep "..a.." |
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 | |
# Test letter frequency counting. | |
echo "abbey" | grep -o . | sort | uniq -c | sort -nr | |
# Letter frequency of all five-letter words. | |
grep -o . wordle.dictionary | sort | uniq -c | sort -nr | |
# Find word that contains letters from "searo". | |
grep s wordle.dictionary | grep e | grep a | grep r | grep o |
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 | |
# Install American dictionary | |
sudo apt-get install wamerican | |
# See first 10 words | |
head /usr/share/dict/american-english | |
# Count words in the dictionary | |
wc -l /usr/share/dict/american-english |
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 | |
# | |
# awsu wrapper around aws-profile with user confirmation for "prod" environments | |
# | |
set -o errexit # Exit immediately if any command or pipeline of commands fails | |
set -o nounset # Treat unset variables and parameters as an error | |
set -o pipefail # Exit when command before pipe fails | |
# set -o xtrace # Debug mode expand everything and print it before execution |
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
GCLOUD_VERSION=$(gcloud version --format="value('Google Cloud SDK')") | |
GCLOUD_COMPLETION_FILE="${HOME}/google-cloud-sdk/completion-${GCLOUD_VERSION}.zsh.inc" | |
GCLOUD_COMPLETION_GITHUB="https://raw.githubusercontent.com/google-cloud-sdk/google-cloud-sdk/v${GCLOUD_VERSION}/completion.zsh.inc" | |
if [ ! -z ${GCLOUD_VERSION} ]; then | |
mkdir -p "${HOME}/google-cloud-sdk" | |
if [ ! -f ${GCLOUD_COMPLETION_FILE} ]; then | |
wget -qO "${GCLOUD_COMPLETION_FILE}" "${GCLOUD_COMPLETION_GITHUB}" | |
fi | |
source "${GCLOUD_COMPLETION_FILE}" |