Skip to content

Instantly share code, notes, and snippets.

View HelioCampos's full-sized avatar

Helio Campos Mello de Andrade HelioCampos

View GitHub Profile
@HelioCampos
HelioCampos / Manage-R53RecordSet.ps1
Created December 20, 2018 00:44 — forked from lorengordon/Manage-R53RecordSet.ps1
PowerShell Script to Create/Delete/Update AWS Route53 Record Set
[CmdLetBinding()]
Param(
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipeLineByPropertyName=$true)]
[String] $HostedZoneId,
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipeLineByPropertyName=$true)]
[ValidateSet("CNAME","A","AAAA","MX","TXT","PTR","SRV","SPF","NS","SOA")]
[String] $Type,
[Parameter(Mandatory=$true,ValueFromPipeLine=$false,ValueFromPipeLineByPropertyName=$true)]
@HelioCampos
HelioCampos / example.ps1
Created December 20, 2018 00:44 — forked from magnetikonline/example.ps1
PowerShell example for an AWS Route53 record upsert.
Set-StrictMode -Version Latest
$HOSTED_ZONE_ID = "ABCDEFGHIJKLM"
$changeRequest01 = New-Object -TypeName Amazon.Route53.Model.Change
$changeRequest01.Action = "UPSERT"
$changeRequest01.ResourceRecordSet = New-Object -TypeName Amazon.Route53.Model.ResourceRecordSet
$changeRequest01.ResourceRecordSet.Name = "record01.domain.com"
@HelioCampos
HelioCampos / aws-cli-examples.sh
Last active October 15, 2018 16:09 — forked from namuan/aws-cli-examples.sh
[AWS CLI examples] #aws #cli #filter #query
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*].Tags[?Key==`Name`]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `registration`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `email`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[] | [?contains(Tags[?Key==`Name`].Value, `email-01`)]' --output table
@HelioCampos
HelioCampos / 0main.md
Created January 16, 2018 18:27 — forked from pandeiro/0main.md
Git Best Practices

Git Best Practices

This is a fairly common question, and there isn't a One True Answer, but still, this represents a consensus from #git

Read about git

Knowing where to look is half the battle. I strongly urge everyone to read (and support) the Pro Git book. The other resources are highly

@HelioCampos
HelioCampos / gist:a20deb968afa0b67e7f3c747187ac96a
Created December 28, 2017 19:00 — forked from ipedrazas/gist:2c93f6e74737d1f8a791
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@HelioCampos
HelioCampos / TUNING_UNICORN.markdown
Last active November 22, 2017 18:13
Tuning Unicorn

= Tuning unicorn

unicorn performance is generally as good as a (mostly) Ruby web server can provide. Most often the performance bottleneck is in the web application running on Unicorn rather than Unicorn itself.

== unicorn Configuration

See Unicorn::Configurator for details on the config file format. +worker_processes+ is the most-commonly needed tuning parameter.

@HelioCampos
HelioCampos / gh-dl-release
Created November 7, 2017 10:33 — forked from maxim/gh-dl-release
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@HelioCampos
HelioCampos / database_migration_best_practices.md
Created September 28, 2017 14:00
Database migration best practices for Rails

Database migration best practices for Rails

Never ever change data on schema changes! [1]

Use rake tasks to change the data! [1]

This decouples a deployment from completed migrations. Give us control of the data manipulation proccess by encapsulatin it in on place. need to remember to:

  1. Run it in one of the ways bellow: a. Add this rake task the deployment script or;