Skip to content

Instantly share code, notes, and snippets.

View afquinterog's full-sized avatar

Andres Quintero afquinterog

View GitHub Profile
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::BUCKET_NAME"
@afquinterog
afquinterog / cloudwatch.policy
Last active December 11, 2019 14:09
Aws policy to allow write logs to cloudwatch
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:DescribeLogStreams"
],
@afquinterog
afquinterog / vault.config
Last active January 16, 2020 23:07
Vault logrotation configuration
/var/log/vault_audit.log {
daily
create 0600 vault vault
missingok
dateext
rotate 7
size=10M
notifempty
postrotate
if invoke-rc.d vault status > /dev/null 2>&1; then \
@afquinterog
afquinterog / java
Last active March 17, 2020 17:22
JAVA SES code
//GenericEmailService
message.addHeader("Content-ID", "INVITATION_CODE");
// EmailDeliveryTrackService
List<Message> messages = sqs.receiveMessage(queueUrl).getMessages();
messages.forEach( message -> {
String invitation = message.getHeaders().get("Content-ID");
@afquinterog
afquinterog / gist:28448a3d18c0ad4d55029c73f09f94b9
Created April 9, 2020 20:35
Fomat input variables for the automation code
export AWS_ACCESS_KEY_ID=acces-key
export AWS_SECRET_ACCESS_KEY=secret
export VAULT_ADDR=vault-addr
export VAULT_TOKEN=vault-token
export GITHUB_TOKEN=github-token
export HELLO_SIGN_API_KEY=hellosign-token
export AMAZON_SES_SMTP_USERNAME=ses-username
export AMAZON_SES_SMTP_PASSWORD=ses-pasword
export MAIL_ENDPOINT=mail-endpoint
@afquinterog
afquinterog / script.sql
Last active April 13, 2020 21:50
delete syndication users
DO $$
declare
userToDelete UUID;
BEGIN
SET SCHEMA 'independentco';
select INTO userToDelete user_id
from users_roles where role_id IN (