Skip to content

Instantly share code, notes, and snippets.

Rafael Ponte rponte

Block or report user

Report or block rponte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rponte /
Created Jan 6, 2020
Configuring SSH-Agent with your keys on MacOSX
# Add to your ~/.ssh/config the option for every host
touch ~/.ssh/config
# ...and add this into the file:
Host *
AddKeysToAgent yes
UseKeychain yes
# Check if ssh-agent is running
rponte /
Last active Jan 6, 2020
Verifying whether a remote port is open or not using Netcat (nc)
nc -zvw3 -G5 <host> <port_or_range_of_ports>
# -z : scanning mode
# -v : verbose
# -w3: read timeout in seconds (3 sec) / obs: On Mac OS X the -w3 parameter is ignored.
# -G5: connect timeout in seconds (5 sec)
rponte /
Created Jan 2, 2020
Using Ant v1.9 on MacOSX - this version supports Java 6.x and 7.x
# first off, install it via HomeBrew
brew install ant@1.9
# now configure Ant-v1.9 on your current PATH variable
export PATH="/usr/local/opt/ant@1.9/bin:$PATH"
# finally, verify if it's ok
ant -version
# Apache Ant(TM) version 1.9.14 compiled on March 12 2019
rponte /
Last active Dec 5, 2019
Fixing file permissions for ssh keys and config
chmod 700 ~/.ssh
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 644 ~/.ssh/config
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/
# others keys
chmod 600 ~/.ssh/github_rsa
chmod 644 ~/.ssh/
chmod 600 ~/.ssh/mozilla_rsa
rponte /
Last active Oct 2, 2019
Oracle does NOT support dirty reads AT ALL by design (aka READ_UNCOMMITED Isolation level)

By design, Oracle does NOT support dirty reads AT ALL (aka READ_UNCOMMITED Isolation level)

Stackoverflow: Does oracle allow the uncommitted read option?

Tom provides a great answer to this: On Transaction Isolation Levels

The READ UNCOMMITTED isolation level allows dirty reads. Oracle Database doesn't use dirty reads, nor does it even allow them. The basic goal of a READ UNCOMMITTED isolation level is to provide a standards-based definition that allows for nonblocking reads.


rponte /
Created Sep 25, 2019
Git: reverting a range of commits
# Reverting a range of commits
# git --pretty=oneline --abbrev-commit older_commit..newer_commit # not includes the oldest commit
# git --pretty=oneline --abbrev-commit older_commit^..newer_commit # includes the oldest commit
# just to be sure about the commits, list them
git log --pretty=oneline --abbrev-commit 1f80548^..4b293d5
rponte /
Last active Sep 13, 2019
TechDay: Aplicando Clean Code em código PL/SQL

Aplicando Clean Code em código PLSQL

Tech-talk semanal, no estilo hands-on, apresentado para equipe de desenvolvimento na empresa MDIAS BRANCO. O código utilizado na talk foi de uma package PL/SQL utilizada em produção.

Pre-Requisitos: O código PL/SQL deve estar coberto por testes automatizados;

Passo a Passo:

rponte /
Created Aug 29, 2019 — forked from TimothyJones/
These are (currently) the only functions I recommend porting around when writing bash scripts
#!/bin/bash -eu
if [ -z "${LIB_ROBUST_BASH_SH:-}" ]; then
function error {
echo "Error: ${1:-}"
# Check to see that we have a required binary on the path
function require_binary {
rponte / export-html-to-csv.js
Last active Aug 28, 2019
JavaScript: exportando table HTML para CSV - Projeto de MDB Medidas da MDIAS
View export-html-to-csv.js
* Para rodar, basta:
* 1. executar este script no console da pagina;
* 2. clicar no botão "Exportar" no inicio da página;
* 3. apos download, abrir arquivo .csv;
* 4. abrir arquivo no Excel;
$(document).ready(function() {
// cria link "exportar" no inicio da pagina
rponte /
Last active Aug 12, 2019
Hibernate Tip when working with Oracle: favor dynamic update

Full page logging in Postgres and Oracle (Oracle: sparse update)

The volume of undo and redo generated is only 15 MB here, including 6 MB of undo vectors. This is really optimized and this is one reason why you should update only the columns changed (and not use the default non-dynamic update of Hibernate for example).

You can’t perform that action at this time.