Skip to content

Instantly share code, notes, and snippets.

View heronrs's full-sized avatar
👋

Heron Rossi heronrs

👋
  • HotelEngine
  • Sao Paulo - Brazil
  • 18:52 (UTC -03:00)
View GitHub Profile
@heronrs
heronrs / rds-diagnose.sh
Last active November 29, 2022 13:40
Diagnoses potential rack applications that might have been affected by the Cloudformation RDS problem
#!/bin/bash
# Run this script in a terminal with your AWS credentials and region configured.
# The script will output potential apps that might have been affected by the RDS problem.
echo "Running diagnose..."
aws cloudformation describe-stacks --query 'Stacks[*].StackName' --no-paginate |jq -c '.[]'| while read i; do
if [[ $i =~ .*-Resource.*-.* ]]; then
encrypted=$(aws cloudformation describe-stacks --stack-name $(echo $i|tr -d '"') --query 'Stacks[0].Parameters[?ParameterKey==`Encrypted`]'.ParameterValue --output text)
if [ -z "$encrypted" ]; then
@heronrs
heronrs / steps.md
Created January 3, 2022 16:54
convox RACK_URL credentials

Get RACK_URL host and credentials

Go to the EKS UI and select the cluster. Then click Configuration -> Compute and click the Node Group name.

On the Node Group UI, click the Autoscaling group name associated with the Node Group. In the Autoscaling group UI, go to Network and select Edit. Change the subnet to public(it should be something like rackname public 0)

Go back to Autoscaling Group and click the Launch Template link.

In the Launch Template UI, click actions and select Modify Template. Add a key-pair login and under Advanced Network Configuration enable auto-assign public IP.

@heronrs
heronrs / Xero-ClientCredentials-Workaround-2020
Created November 10, 2021 12:57 — forked from channeladam/Xero-ClientCredentials-Workaround-2020
Xero client_credentials workaround - January 2020
Here is a workaround for the lack of a client credentials flow in Xero's OAuth 2.0 / OpenID Connect implementation.
From Xero's FAQ: https://developer.xero.com/faq/all/oauth-private
"Is there an equivalent of two-legged private apps in OAuth 2.0?
No, all users will follow the same OAuth 2.0 code flow.
Once you have an access token and refresh token you can refresh indefinitely or until the token is revoked by the user."
Workaround:
1. Login to Xero as the Xero user to use for the machine-to-machine flow workaround.
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: fluentd
labels:
app: fluentd
data:
fluentd.conf: |
@include prometheus.conf
@heronrs
heronrs / GitHub curl.sh
Created April 4, 2019 20:12 — forked from Integralist/GitHub curl.sh
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"
@heronrs
heronrs / docker-cleanup-resources.md
Created February 27, 2019 17:25 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@heronrs
heronrs / how-to-copy-aws-rds-to-local.md
Created November 12, 2018 18:49 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@heronrs
heronrs / neo4j-social-network.adoc
Created October 16, 2018 02:41 — forked from jexp/neo4j-social-network.adoc
Neo4j Example Social Network

Social Network

A simple social network of people knowing each other.

@heronrs
heronrs / useragent.md
Created March 15, 2018 14:47
user_agent_linux_itau.md

Mozilla/5.0 (Solaris; Solaris x86_64; rv:40.0) Gecko/20100101 Firefox/40.0

@heronrs
heronrs / cloudSettings
Last active April 7, 2019 21:40
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-04-07T21:40:08.100Z","extensionVersion":"v3.2.8"}