Skip to content

Instantly share code, notes, and snippets.

View afquinterog's full-sized avatar

Andres Quintero afquinterog

View GitHub Profile
@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 (
@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 / 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 / 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 / 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"
],
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::BUCKET_NAME"
@afquinterog
afquinterog / Vault.service
Last active June 20, 2019 13:50
Vault service
[Unit]
Description=Vault
Documentation=https://vaultproject.io/docs/
After=network.target
ConditionFileNotEmpty=/etc/vault.d/vault.hcl
[Service]
User=ubuntu
Group=ubuntu
ExecStart=/usr/local/bin/vault server -config=/etc/vault.d/vault.hcl
@afquinterog
afquinterog / conf
Created May 22, 2019 23:34
docs.venturesolutions.co-policy
{
"Version": "2008-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::847662935904:user/s3-venturesolutions-user"
},
"Action": [
"s3:ListBucket",
@afquinterog
afquinterog / conf
Created May 22, 2019 23:34
docs.venturesolutions.co-policy
{
"Version": "2008-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::847662935904:user/s3-venturesolutions-user"
},
"Action": [
"s3:ListBucket",
@afquinterog
afquinterog / nginx.conf
Created May 20, 2019 15:26
Prerender sample configuration
location @prerender {
proxy_set_header X-Prerender-Token TOKEN;
set $prerender 0;
if ($http_user_agent ~* "baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator") {
set $prerender 1;
}
if ($args ~ "_escaped_fragment_") {
set $prerender 1;
}