This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_kms_key" "kms_key" { | |
deletion_window_in_days = var.deletion_window_in_days | |
enable_key_rotation = var.enable_key_rotation | |
key_usage = var.key_usage | |
customer_master_key_spec = var.customer_master_key_spec | |
multi_region = var.multi_region | |
is_enabled = var.is_enabled | |
tags = var.vpc_tags | |
policy = <<POLICY | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function # Python 2/3 compatibility | |
import json | |
import boto3 | |
# AWS_ACCESS = "" | |
# AWS_SECRET = "" | |
AWS_REGION = "eu-west-3" | |
TABLE_NAME = "users" | |
client = boto3.client( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for TBL in $(aws dynamodb list-tables --profile ABC --query "TableNames[]" --output text) ; do | |
echo "Doing $TBL" | |
aws dynamodb describe-table --table-name $TBL --profile ABC > ${TBL}.json | |
BILLINGMODE=$(grep -e '.*BillingMode"' ${TBL}.json | tr -d " ") | |
jq < ${TBL}.json ".Table | {TableName, KeySchema, AttributeDefinitions} + (try {LocalSecondaryIndexes: [ .LocalSecondaryIndexes[] | {IndexName, KeySchema, Projection} ]} // {}) + (try {GlobalSecondaryIndexes: [ .GlobalSecondaryIndexes[] | {IndexName, KeySchema, Projection} ]} // {}) + { ${BILLINGMODE} }" > create_${TBL}.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USER=$(echo -n $1 | base64) | |
PASS=$(echo -n $2 | base64) | |
# Connect to AWS SES | |
openssl s_client -crlf -quiet -connect email-smtp.us-east-1.amazonaws.com:465 | |
openssl s_client -crlf -quiet -starttls smtp -connect email-smtp.us-east-1.amazonaws.com:25 | |
# SMTP commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
core.wait(3); | |
core.setDate("2010:07:14T17:16:00", "Africa/Tunis"); | |
core.setObserverLocation(37.352013, -3.065653, 5895, 1, "Mt. Kilimanjaro, Tunisia", "Earth"); | |
for (i=0; i<=360; i++) | |
{ | |
core.setDate("+60 seconds"); | |
core.wait(.1); | |
core.screenshot("kili_"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CONSTANTES | |
G = 6.67408 * 10**(-11) # Constante Universal de Gravitação | |
M = 5.972 * 10**(24) # Massa da Terra | |
# ---------------------------------------------------------------------------------------------------------------------------- | |
# VARIÁVEIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Distances on Globe and Flat Earth | |
# Instructions: | |
# - Input each information as asked; | |
# - Input coordinates in degrees (23.1234); | |
# - If coordinates are at South or West, use negative numbers (-23.1234); | |
# - North Pole to Equator based on a Flat Earth with 40.075km equatorial perimeter. | |
# Earth radius = 6371km rounded, so little diferences are expected if you're considering WGS84 geoid. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:boron-alpine | |
RUN mkdir -p /app | |
WORKDIR /app | |
COPY package.json /app/ | |
RUN npm install | |
COPY . /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
u = open('users.txt', 'r') | |
for user in u.readlines(): | |
user = user[:-1] | |
path = '/data/users/{0}/'.format(user) | |
tmp = os.path.isdir(path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
# | |
# implements simple one-way encryption pipe using rsa and keccak-based | |
# spongewrap | |
# | |
# useful at least in the following use-case: you have an untrusted | |
# host on which plaintext data arrives, which you want to encrypt | |
# before it is forwarded in a hostile environment to the final | |
# recipient holding a private key in a safe location. In this one-way |
NewerOlder