Skip to content

Instantly share code, notes, and snippets.

View gabanox's full-sized avatar

Gabriel Ramirez gabanox

View GitHub Profile
import boto3
def publish_sqs_message():
client = boto3.client('sqs', region_name='us-east-1')
for i in range(100000000):
response = client.send_message(
QueueUrl='QueueURL',
MessageBody='Order # '+str(i)
)
@gabanox
gabanox / webinar-seguridad-s3.md
Created March 10, 2022 16:03
webinar-seguridad-amazon-s3

Webinar Protegiendo tus datos con Amazon S3

Estándar de prácticas recomendadas de seguridad fundamental en AWS

El estándar AWS Foundational Security Best Practices es un conjunto de controles que detectan cuando sus cuentas y recursos implementados se desvían de las prácticas recomendadas de seguridad. Proporciona orientación práctica y prescriptiva sobre cómo mejorar y mantener la postura de seguridad de su organización. Conozca más en el siguiente link AWS Security Hub Best Practices

Agenda

Control Detectivo Descripción
Resources:
SSMInstanceRole:
Type: "AWS::IAM::Role"
Properties:
RoleName: !Sub "SystemsManagerRole-${AWS::AccountId}"
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Create repository file
echo -e "[mongodb-org-4.0] \nname=MongoDB Repository\nbaseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/\ngpgcheck=1 \nenabled=1 \ngpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc" | sudo tee /etc/yum.repos.d/mongodb-org-4.0.repo
Install Mongo Shell
sudo yum install -y mongodb-org-shell
Downloads the CA Certificate for Amazon DocumentDB
wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
# Use this code snippet in your app.
# If you need more information about configurations or implementing the sample code, visit the AWS docs:
# https://aws.amazon.com/developers/getting-started/python/
import boto3
import base64
from botocore.exceptions import ClientError
def get_secret():
#inicializar repo
git clone https://...
#ignorar archivos dev
touch .gitignore
echo ".gitignore" >> .gitignore
echo "site/*" >> .gitignore
<?php
//Send a 500 status code using PHP's header function
header($_SERVER["SERVER_PROTOCOL"] . ' 500 Internal Server Error', true, 500);
?>
@gabanox
gabanox / redshift.txt
Last active June 12, 2021 17:20
Referencia de comandos para redshift
--Path de búsqueda
set search_path to enterprise;
show search_path;
--Consultar metadatos de una tabla
SELECT
*
FROM
@gabanox
gabanox / delete-versions.py
Created June 7, 2021 01:10
Delete versions from a bucket in S3
import sys
import boto3
s3 = boto3.resource('s3')
bucket = s3.Bucket(sys.argv[1])
bucket.object_versions.delete()
bucket.delete()
package com.hipermediasoft.manager;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider;
import com.amazonaws.regions.Regions;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper;
public class DynamoDBManager {