request headers:
POST /oauth/token HTTP/1.1
Host: ( your API server host here, i.e. http://api.localhost:8080 )
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=UTF-8
| update contacts set contact=CONCAT("+99", floor(rand(current_timestamp())*999999999)) where type='phone'; | |
| update users set realname=CONCAT('Random ', floor(rand(current_timestamp())*9999999)), email=CONCAT(CONCAT('random', floor(rand(current_timestamp())*9999999)), '@example.com') where role <> 'admin'; | |
| update users set password='$2y$15$Ha7nHVZApHXfzhrD2HCukuUjjQhIUzPJ0JNWk7KooT6edQFTbeWr6'; /* "admin" .. DON'T RUN FOR STAGING */ | |
| update users set email='admin@example.com' where id=1; | |
| delete from config where group_name='data-provider' and config_key in ('email', 'twitter'); | |
| delete from config where group_name='twitter'; | |
| truncate oauth_refresh_tokens; | |
| truncate oauth_access_tokens; | |
| truncate webhooks; |
| # save somewhere under your home folder and source from .bash_profile | |
| _aws_vault_session() { | |
| unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY \ | |
| AWS_REGION AWS_DEFAULT_REGION \ | |
| AWS_SECURITY_TOKEN AWS_SESSION_TOKEN \ | |
| AWS_VAULT ; | |
| if [ -n "$1" ]; then | |
| eval `aws-vault exec $1 -- bash -c "set -o posix; set; set +o posix" | grep ^AWS_` | |
| export AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY \ |
| #!/usr/bin/env python | |
| from threading import Thread | |
| from tornado import gen, ioloop | |
| from tornado.queues import Queue as AsyncQueue | |
| import random, json, time, logging, Queue | |
| import shelve | |
| _db = None | |
| _cmd_q = None # command queue (consumed by db loop) |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Effect": "Allow", | |
| "Action": [ | |
| "iam:ListUsers" | |
| ], | |
| "Resource": ["arn:aws:iam::xxxxxxxxx:user/"] | |
| }, |
| #!/bin/bash | |
| # Requirements: | |
| # - awscli ( https://pypi.python.org/pypi/awscli ) | |
| # - jq ( http://stedolan.github.io/jq ) | |
| # - curl | |
| # - configuring crendentials properly (see below) | |
| # Invoke with devicename matching the EBS to be backed up (i.e. "/dev/sdm") | |
| [ -z "$1" ] && { echo "Call me with the devicename of the EBS you want to back up!"; exit 1; } |