I hereby claim:
- I am pguelpa on github.
- I am pguelpa (https://keybase.io/pguelpa) on keybase.
- I have a public key whose fingerprint is 665D 1EA3 5930 70F2 B03E 91A9 8815 62F9 76B3 A0C8
To claim this, I am signing this object:
{ | |
"$schema": "https://gist.githubusercontent.com/pguelpa/4d1ee633a43df9ba52b7/raw/6ff330bad658f9543d296589e23828310d6e8f4f/schema.json", | |
"title": "v0_platform_request_traces", | |
"description": "A schema to track events through a system", | |
"properties": { | |
"request_id": { | |
"type": "string", | |
"minLength": 36, | |
"maxLength": 36 | |
}, |
#!/bin/bash -ue | |
# | |
# Rolling upgrade procedure | |
# | |
if test $# -lt 1; then | |
echo "Usage:" | |
echo " upgrade-deis seed-ip [number-of-routers]" | |
echo " by default the number-of-routers is 3" |
#!/bin/sh -e | |
if [ ! -z ${DEBUG+x} ] | |
then | |
set -x | |
fi | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: $0 unit ..." |
DO $$DECLARE row record; | |
BEGIN | |
FOR row IN SELECT pid, query FROM pg_stat_activity WHERE query_start < NOW() - interval '30 minutes' LOOP | |
RAISE NOTICE 'Killing query: %s', row.query; | |
PERFORM pg_cancel_backend(row.pid); | |
END LOOP; | |
END$$; |
[Unit] | |
Description=dnsmasq | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=10m | |
ExecStartPre=-/usr/bin/docker kill dnsmasq | |
ExecStartPre=-/usr/bin/docker rm dnsmasq | |
ExecStartPre=/usr/bin/docker pull jamesawesome/dnsmasq:latest |
export BATCH_SIZE=100000 | |
export PGPASSWORD=xyz | |
export PGHOST=x.y.z | |
export PGUSER=abc | |
export PGDATABASE=def | |
count=0 | |
until psql -c "DELETE FROM <table> WHERE id IN (SELECT id FROM <table> WHERE <time filter> <= NOW() - INTERVAL '24 hours' LIMIT ${BATCH_SIZE});" | grep -v "DELETE ${BATCH_SIZE}" | |
do | |
count=$((count + BATCH_SIZE)) |
I hereby claim:
To claim this, I am signing this object:
iterator = nil | |
keys = [] | |
while iterator != '0' | |
iterator, list = Redis.current.scan(iterator || 0, count: 1000) | |
keys += list.map { |l| l.split(':') } | |
puts "Found another #{list.length} keys, iterator at #{iterator}" | |
end |