Skip to content

Instantly share code, notes, and snippets.

View oieduardorabelo's full-sized avatar

Eduardo Rabelo oieduardorabelo

View GitHub Profile
@oieduardorabelo
oieduardorabelo / gist:6782f2db6a1f0512196204571c5e39d5
Created June 21, 2024 08:37 — forked from bnusunny/gist:d366c669e19f06d6fbfd0fe8e870467f
FastAPI + Powertools Tracer + Lambda Web Adapter
from aws_lambda_powertools import Logger, Tracer
from fastapi import FastAPI, Request
import boto3
import os
logger = Logger()
tracer = Tracer()
s3 = boto3.resource('s3')
import type {
FirehoseTransformationHandler,
FirehoseTransformationResultRecord,
} from "aws-lambda";
function base64Encode(str: string): string {
return Buffer.from(str).toString("base64");
}
function base64Decode(str: string): string {
@oieduardorabelo
oieduardorabelo / remove-twitter-interests.js
Created November 30, 2022 22:31
Remove all Twitter Interests matched to you based on your profile, activity, and the Topics you follow.
// https://mobile.twitter.com/settings/your_twitter_data/twitter_interests
$$('[checked=""]').forEach((x, index) => { setTimeout(() => { x.click(); }, ++index * 1000) });

DenyRootUserActions

It is generally a best practice not to use the root user to do your tasks in your AWS account. Instead, you should create an IAM admin user and use that to do administrative tasks.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Condition": {
@oieduardorabelo
oieduardorabelo / readme.md
Created July 5, 2022 05:35
Remove folder or file from Git history with clean up

I already had committed the folder before and want to remove the directory in the history as well.

I did the following:

Add folder to .gitignore:

echo Folder_Name/ >> .gitignore

Remove from all commits:

@oieduardorabelo
oieduardorabelo / template-database.yaml
Created February 28, 2021 11:20
Network and Database Layers Teample
#
# Creates one RDS PostgreSQL instance and RDS Proxy
# with connections allowed in ports 443 and 5432
#
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: "Database Layer"
@oieduardorabelo
oieduardorabelo / .env.example
Created February 24, 2021 05:11
Sample of Cognito with Server-Sider Authentication
PORT=xxx
COGNITO_USER_POOL_ID=xxx
COGNITO_CLIENT_ID=xxx
COOKIE_SESSION_SECRET=xxx
COOKIE_SESSION_NAME=xxx
AWS_REGION=xxx
AWS_ACCESS_KEY_ID=xxx
AWS_SECRET_ACCESS_KEY=xxx
@oieduardorabelo
oieduardorabelo / acloudguru-filter.js
Created August 13, 2020 07:36
A Cloud Guru list filter
$$('[ng-if="vm.isCompleted"]').forEach(el => { el.parentNode.parentNode.parentNode.removeChild(el.parentNode.parentNode) })
@oieduardorabelo
oieduardorabelo / help-samsung-internet.md
Last active August 15, 2019 22:52
Looking for help about Samsung Internet vs others browsers in PWA manifest.json

hello pwa gurus!

we've this app deployed, with https, everything is working as expected, except the manifest in Samsung Internet only,

app link: https://app.zbarista.co.nz/

we are testing in multiple devices and android versions (tablets, oreo, samsung s7, pixel, etc) and it happens every time, only in Sasmsung Internet, even after a fresh install of the app in Android.

any idea what might be happening here?