Skip to content

Instantly share code, notes, and snippets.

View erbrito's full-sized avatar

Erick Brito erbrito

View GitHub Profile
@erbrito
erbrito / main.yml
Last active January 11, 2023 19:00
ansible playbook to patch RHEL8
---
- name: Patch server
hosts: all
become: true
vars:
packages_to_update:
- package1
- package2
- package3
lv_max_size: 3
@erbrito
erbrito / regex_test.yml
Created April 9, 2019 20:37
Ansible example to use regex_search filter.
---
## Example of use of filter regex_search
- hosts: localhost
remote_user: root
tasks:
- name: set regex
set_fact:
az_rg_regex_pattern: "(?<=resourceGroups\/)(.*?)(?=\/)"
@erbrito
erbrito / Congress.sol
Last active June 22, 2022 09:44
A template solidity contract that uses a state machine based on common patterns described at https://solidity.readthedocs.io/en/develop/common-patterns.html#state-machine. Other use cases with best practices.
pragma solidity ^0.4.16;
contract owned {
address public owner;
function owned() public {
owner = msg.sender;
}
modifier onlyOwner {
@erbrito
erbrito / boto3_hands_on.md
Created February 14, 2018 12:25 — forked from iMilnb/boto3_hands_on.md
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@erbrito
erbrito / amazon-rekognition.md
Created February 13, 2018 19:46 — forked from alexcasalboni/amazon-rekognition.md
Amazon Rekognition - Python Code Samples

Amazon Rekognition - Python Code Samples

  1. Labels Detection
  2. Faces Detection
  3. Faces Comparison
  4. Faces Indexing
  5. Faces Search
@erbrito
erbrito / BUILD_AWS_LAMBDA.md
Created February 6, 2018 15:42 — forked from joseph-zhong/BUILD_AWS_LAMBDA.md
Building OpenCV for AWS Lambda Python

To build OpenCV3.0 for AWS Lambda Python

Summary

Because AWS Lambda runs in a Amazon Linux environment, to run external modules you must

Create the OpenCV build environment

sudo yum update -y
@erbrito
erbrito / awxinstalleronopenshift.sh
Last active July 3, 2019 07:27
Deploy of AWX (Ansible Tower) on OpenShift
mkdir Tower
cd Tower/
git clone https://github.com/ansible/awx.git
cd awx
cd installer/
#vi inventory
-# openshift_host=127.0.0.1:8443
-# awx_openshift_project=awx
-# openshift_user=developer
import com.amazonaws.auth.SystemPropertiesCredentialsProvider
import com.amazonaws.services.s3.model.ObjectMetadata
import com.amazonaws.services.s3.model.ObjectTagging
import com.amazonaws.services.s3.model.Tag
import com.amazonaws.services.s3.transfer.MultipleFileUpload
import com.amazonaws.services.s3.transfer.ObjectMetadataProvider
import com.amazonaws.services.s3.transfer.ObjectTaggingProvider
import com.amazonaws.services.s3.transfer.TransferManagerWithTagging
import com.amazonaws.services.s3.transfer.TransferProgress
@erbrito
erbrito / DynamoDbBundleTable
Created October 21, 2016 14:48
Stack to create all that is needed for Project with DyanamoDb, ApiGateway and an Event Rule trigger (Crhon to launch a lambda function) stack. The lambda is created with the import export tool using a swager definition. Requires AWS-CLI and credentials to be configured.
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Stack to create all that is needed for Project with DyanamoDb, ApiGateway and an Event Rule trigger (Crhon to launch a lambda function) stack. The lambda is created with the import export tool using a swager definition",
"Parameters": {
"DynamoDbTableName": {
"Default": "@DynamoDbTableName@",
"Type": "String"
},
"DynamoDbIdName":{
"Default": "id",
@erbrito
erbrito / createAwsStack.sh
Created October 21, 2016 14:41
bash that creates an AWS Stack based on a Template. If the stack exists, it will updated it. It recevied as parameter the name of the stack. Requires to be configured the AWS credentials and be installed AWS CLI
#!/usr/bin/env bash
#bash that creates an AWS Stack based on a Template.
#If the stack exists, it will updated it.
#It recevied as parameter the name of the stack.
#Requires to be configured the AWS credentials and be installed AWS CLI
stackName=$1
function updateStack(){