Skip to content

Instantly share code, notes, and snippets.

View gabanox's full-sized avatar

Gabriel Ramirez gabanox

View GitHub Profile
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 {
@gabanox
gabanox / boostrap.sh
Created April 24, 2017 03:35
AWS Lambda function bootstrapping for Java Maven Projects
#!/bin/bash
project="${1}Service"
package=$2
if [ $# -lt 2 ]
then
echo "Debe especificar el nombre del proyecto y el nombre del paquete ej. [Nombre] Comercios [Paquete] com.hipermediasoft"
exit 1
fi
http://stackoverflow.com/questions/7052875/setting-up-ftp-on-amazon-cloud-server
#sdf -> aws identifier
sudo mkfs -t ext4 /dev/sdf
sudo mkdir /mnt/volume
sudo mount /dev/sdf /mnt/volume
sudo vi /etc/fstab
#include this at the end