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 | |
__terraform_ps1() | |
{ | |
# get current workspace | |
WORKSPACE=$(terraform workspace show) | |
if $(pwd | /bin/grep -q 'terraform'); then | |
if [ -n "$WORKSPACE" ]; then | |
echo -ne "${White}(terraform: " |
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
TOKEN="`curl -s -u <username>:<password> 'https://auth.docker.io/token?service=registry.docker.io&scope=repository:monterail/solarcapture-server:pull' | jq -r .token`" | |
DOWNSTREAM_DIGEST=$(curl -v -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer ${TOKEN}" https://index.docker.io/v2/monterail/solarcapture-server/manifests/latest 2>&1 | grep 'Docker-Content-Digest' | cut -d' ' -f3) | |
docker inspect localhost:5000/server/server:latest | jq -r ".[].RepoDigests | .[] | endswith(\"${REMOTE_DIGEST}\")" |
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
with seconds as ( | |
select extract(epoch from ('2016-09-16 10:15:00'::timestamp - now()::timestamp)) as value | |
), minutes as ( | |
select value/60 as value from seconds | |
), hours as ( | |
select value/60 as value from minutes | |
), days as ( | |
select value/24 as value from hours | |
), weeks as ( | |
select value/7 as value from days |