Skip to content

Instantly share code, notes, and snippets.

View PatrickRoumanoff's full-sized avatar

Patrick Roumanoff PatrickRoumanoff

View GitHub Profile
@PatrickRoumanoff
PatrickRoumanoff / postgres_container_reset.sh
Last active April 28, 2023 20:56
Shell script to reset a postgres DB running in a docker container with no exposed network port
#!/bin/bash
# To create the seed run
# docker exec -t <dockerid> pg_dump -U postgres <dbname> -fc > seed.dump
set -euo pipefail
IFS=$'\n\t'
if [ $# -eq 0 ]; then
echo "dockerId must be provided"
echo "$0 <dockerId> [filename.dump:-seed.dump] [db_name:-DB_NAME:–postgres]"
@PatrickRoumanoff
PatrickRoumanoff / purgeAkamai.sh
Last active June 20, 2018 23:32
A bash script for a ci build that is purging the Akamai cache and wait for the task to complete, with a minimal set of dependencies: curl & sed. Replace username, password and objectIds
#!/bin/bash
#strict mode
set -euo pipefail
IFS=$'\n\t'
URL="https://api.ccu.akamai.com/ccu/v2"
CURL="curl --fail --silent --header \"Content-Type:application/json\" --user username:password"
echo '{"type":"cpcode","objects":["000000","111111"]}' > data.json