Skip to content

Instantly share code, notes, and snippets.

View RodriigoGS's full-sized avatar

Rodrigo G. Silveira RodriigoGS

  • Melhor Envio
  • Brazil
View GitHub Profile
@RodriigoGS
RodriigoGS / main.js
Last active June 27, 2023 17:25
AWS SSM Javascript - GetParameter
const {SSMClient, GetParameterCommand} = require("@aws-sdk/client-ssm");
const AWS = require("aws-sdk");
const client = new SSMClient({
region: "us-east-1",
credentials: new AWS.SharedIniFileCredentials({ profile: 'default' })
});
const command = new GetParameterCommand({
Name: "MY_PARAMETER",
@RodriigoGS
RodriigoGS / add_cloudflare_ips.sh
Created February 9, 2021 01:10 — forked from dduvnjak/add_cloudflare_ips.sh
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# iterate over the lines in the downloaded file
# make sure to set `--group-id` and `--port`; more details at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html
while read p; do aws ec2 authorize-security-group-ingress --group-id sg-e0000000 --protocol tcp --port 80 --cidr $p; done< ips-v4
@RodriigoGS
RodriigoGS / gist:3a0413a9f9e70b2c21dd859ffc3550b7
Created August 28, 2020 03:22 — forked from jedp/gist:3005816
postMessage() security review checklist

Security-Reviewing Uses of postMessage()

The postMessage() API is an HTML5 extension that permits string message-passing between frames that don't share the same origin. It is available in all modern browsers. It is not supported in IE6 and IE7.

postMessage is generally considered very secure as long as the programmer is careful to check the origin and source of an arriving

@RodriigoGS
RodriigoGS / aws-csv-streamwrapper.php
Created August 28, 2020 03:22 — forked from jeremeamia/aws-csv-streamwrapper.php
Shows how to read a CSV stored in S3 using the AWS SDK for PHP's S3 Stream Wrapper.
<?php
require __DIR__ . '/vendor/autoload.php';
$s3 = Aws\S3\S3Client::factory($config);
$s3->registerStreamWrapper();
$url = 's3://{$bucket}/{$key}';
// Read CSV with fopen
@RodriigoGS
RodriigoGS / webpack.mix.js
Created May 11, 2020 06:18
Laravel Mix - Browser Sync HTTPS
const domain = 'yourdomain.test';
const homedir = require('os').homedir();
mix.browserSync({
proxy: 'https://' + domain,
host: domain,
open: 'external',
https: {
key: homedir + '/.config/valet/Certificates/' + domain + '.key',
cert: homedir + '/.config/valet/Certificates/' + domain + '.crt',
@RodriigoGS
RodriigoGS / iterm2-solarized.md
Created May 16, 2018 13:57 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k