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
# add the bellow blocks to your shell startup files (~/.bashrc || ~/.zshrc &c.) | |
# you will now have awsp-<profile_name> tab completions for activating configured profiles. | |
_aws-set-profile(){ | |
echo "activating aws profile: $1" >&2 | |
export AWS_PROFILE="$1" | |
local sso_session="$(aws configure get sso_session 2>/dev/null)" | |
if [[ -n "$sso_session" ]]; then | |
local expires=$(aws configure export-credentials | jq -r '.Expiration') | |
if [[ -z "$expires" || $(gdate --date "$expires" +'%s') -lt $(gdate --date "+2 hours" +'%s') ]]; then | |
echo "refreshing sso session" >&2 |
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 logging | |
from celery.app.defaults import DEFAULT_TASK_LOG_FMT, DEFAULT_PROCESS_LOG_FMT | |
class CeleryTaskFilter(logging.Filter): | |
def filter(self, record): | |
return record.processName.find('Worker') != -1 |
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
# Create empty branch. | |
git checkout --orphan review | |
git rm -rf . | |
git commit --allow-empty -m "Create empty branch" | |
git push --set-upstream origin review | |
# Create `project` branch from `master` current state. | |
git checkout -b project | |
git merge master --allow-unrelated-histories | |
git push --set-upstream origin project |