Skip to content

Instantly share code, notes, and snippets.

View heronrs's full-sized avatar
👋

Heron Rossi heronrs

👋
  • HotelEngine
  • Sao Paulo - Brazil
  • 01:20 (UTC -03:00)
View GitHub Profile
@heronrs
heronrs / make_backup.py
Created July 14, 2016 18:00 — forked from chucknado/make_backup.py
A Python script for the REST API tutorial, "Backing up your knowledge base," at https://support.zendesk.com/hc/en-us/articles/204371903
import os
import datetime
import csv
import requests
credentials = 'your_zendesk_email', 'your_zendesk_password'
session = requests.Session()
session.auth = credentials
@heronrs
heronrs / bobp-python.md
Created May 31, 2017 23:57 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@heronrs
heronrs / hyper.js
Last active January 20, 2018 00:21 — forked from coco-napky/hyper.js
Hyper config for git bash in Windows
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
@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 / 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 / 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 / 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"
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: fluentd
labels:
app: fluentd
data:
fluentd.conf: |
@include prometheus.conf
@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.