Skip to content

Instantly share code, notes, and snippets.

@leonardofed
leonardofed / README.md
Last active Jan 29, 2023
A curated list of AWS resources to prepare for the AWS Certifications
View README.md


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@JamieCressey
JamieCressey / dynamodb_item_to_dict.py
Last active Jun 30, 2021
Coverts a Python Boto3 DynamoDB item to a standard dictionary
View dynamodb_item_to_dict.py
def parse_dynamo_item(item):
resp = {}
if type(item) is str:
return item
for key,struct in item.iteritems():
if type(struct) is str:
if key == 'I':
return int(struct)
else:
return struct
@amosshapira
amosshapira / get-all-s3-prefix-lists
Created Dec 2, 2015
Fetch the S3 prefix list ID's for S3 in all AWS regions. These are can then be used as destinations in route tables
View get-all-s3-prefix-lists
#!/bin/bash
# Fetch the S3 prefix list ID's for S3 in all AWS regions.
# These are can then be used as destinations in route tables
aws ec2 describe-regions --query 'Regions[*].RegionName' | \
jq -r '.[]' | \
while read REGION
do
echo ==== $REGION ====
@marcellodesales
marcellodesales / ec2-host-from-tag-to-env-vars.sh
Last active Nov 8, 2022
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
View ec2-host-from-tag-to-env-vars.sh
######
# Author: Marcello de Sales (marcello.desales@gmail.com)
# Description: Create Create Environment Variables in EC2 Hosts from EC2 Host Tags
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
#
### Installation:
# * Add the Policy EC2:DescribeTags to a User
@sr75
sr75 / osx-homebrew-setup.md
Last active Jun 18, 2020
Mac Yosemite OSX - Homebrew (RVM/MySQL/Redis) setup
View osx-homebrew-setup.md

Mac Homebrew (RVM/MySQL/Redis) setup

Follow the steps below to setup a local development environment:

XQuartz

Recommended to download latest XQuartz

iTerm2

@sr75
sr75 / wget-jdk-oracle-install-example.txt
Last active Jun 14, 2021
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
View wget-jdk-oracle-install-example.txt
http://d.stavrovski.net/blog/post/how-to-install-and-setup-oracle-java-jdk-in-centos-6
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm" \
-O jdk-7-linux-x64.rpm
# ubuntu
@sr75
sr75 / bash_profile
Last active Jun 8, 2018
Nice simple bash_profile & bashrc for rbenv/python/node/sublime/brew & bash completion terminal setup with colors on osx mavericks
View bash_profile
# rbenv & brew git/bash completion terminal setup
# for dev desktop only on osx
# Run the following commands in order to use this script:
################################################################
# !! => Update/Install xcode Command Line Tools <= !!
# In your shell/terminal:
# Homebrew perms needed:
# sudo chown -R root:admin /usr/local
# sudo chown -R root:admin /Library/Caches/Homebrew
# ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@alex-zige
alex-zige / gist:5795358
Last active Dec 23, 2022
Rails Rspec API Testing Notes
View gist:5795358

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views
@sr75
sr75 / mysql_max_text_limits_active_record.rb
Created Apr 15, 2013
mysql 5.6 rails active_record migration text max lengths for a database created with utf8
View mysql_max_text_limits_active_record.rb
# just an active_record migration example for reference
# source of this logic: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
class CreateMetaTexts < ActiveRecord::Migration
def up
create_table :meta_texts do |t|
t.text :default_text_63KB, limit: 63.kilobytes # 64512 < 65535 limit for when text datatype changes to mediumtext datatype
t.text :medium_text_64KB, limit: 64.kilobytes # 65536 > 65535 limit and triggers text datatype to mediumtext datatype
t.text :medium_text_15MB, limit: 15.megabytes # 15728640 < 16777215 limit for when mediumtext changes to longtext datatype