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
-- enable dblink support | |
CREATE EXTENSION dblink; | |
-- create the connection | |
SELECT dblink_connect('myconn', 'dbname=tracking-service'); | |
-- then use the connection | |
SELECT "oauthId" | |
FROM "56_profile" local | |
INNER JOIN dblink('myconn','SELECT DISTINCT user_id FROM "event"') |
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
<FormattedHTMLMessage | |
id="news-publish.not-allowed.html" | |
values={{ emailSupport: support.email }} | |
defaultMessage={"Please contact <a href=\"mailto:{emailSupport}\">support</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
alias c='docker-compose' | |
alias cb='docker-compose build' | |
alias cup='docker-compose up' | |
alias cr='docker-compose run --service-ports --rm' | |
alias crl='docker-compose run --service-ports --rm local' | |
alias crd='docker-compose run --service-ports --rm develop' | |
alias crt='docker-compose run --rm test' | |
alias crp='docker-compose run --rm provision' | |
alias crci='docker-compose run --rm ci' | |
alias crwt='docker-compose run --rm watchtest' |
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
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[ ",]//g') | |
echo $PACKAGE_VERSION |
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
URL="http://stackoverflow.com/" | |
# store the whole response with the status at the and | |
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL) | |
# extract the body | |
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g') | |
# extract the status | |
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') |
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 | |
# signals bash to stop execution on any fail | |
set -e | |
# if variable not defined | |
if [[ -z "$BACKUP_FILE" ]]; then | |
... | |
fi |
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 | |
# Usage: | |
# - To only show the possbible volumes to be removed: | |
# ./docker-cleanup-volumes.sh | |
# - To remove orphaned docker volumes: | |
# ./docker-cleanup-volumes.sh clean | |
if [ "$1" == 'clean' ]; then | |
echo "cleaning..." |
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
# single tunnel | |
ssh -L <local-ip-on-my-machine>:<local-port-on-my-machine>:\ | |
<local-ip-on-server>:<local-port-on-server> \ | |
-C -N <server-user>@<server-ip> | |
# EXMAPLES | |
# ------------- | |
# SINGLE TUNNEL | |
ssh -L 0.0.0.0:27017:172.17.42.1:27017 -C -N [email protected] | |
# ------------- |
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
# remove dangling images | |
docker rmi $(docker images -q -f dangling=true) | |
# remove dead containers | |
docker rm $(docker ps -aq) |
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
for file in *.html; do; mv "$file" "${file%.html}.txt"; done |