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
rponte / add-keys-on-macosx.sh
Created Jan 6, 2020
Configuring SSH-Agent with your keys on MacOSX
View add-keys-on-macosx.sh
# 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
ssh-agent
@rponte
rponte / netcat-verifying-remote-ports.sh
Last active Jan 6, 2020
Verifying whether a remote port is open or not using Netcat (nc)
View netcat-verifying-remote-ports.sh
# https://www.2daygeek.com/how-to-check-whether-a-port-is-open-on-the-remote-linux-system-server/
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
rponte / install-ant_v19-on-macosx.sh
Created Jan 2, 2020
Using Ant v1.9 on MacOSX - this version supports Java 6.x and 7.x
View install-ant_v19-on-macosx.sh
# 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
rponte / fix-ssh-file-permissions.sh
Last active Dec 5, 2019
Fixing file permissions for ssh keys and config
View fix-ssh-file-permissions.sh
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/id_rsa.pub
# others keys
chmod 600 ~/.ssh/github_rsa
chmod 644 ~/.ssh/github_rsa.pub
chmod 600 ~/.ssh/mozilla_rsa
@rponte
rponte / oracle-and-read_uncommited-isolation-level.md
Last active Oct 2, 2019
Oracle does NOT support dirty reads AT ALL by design (aka READ_UNCOMMITED Isolation level)
View oracle-and-read_uncommited-isolation-level.md

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
rponte / git-revert-multiple-commits.sh
Created Sep 25, 2019
Git: reverting a range of commits
View git-revert-multiple-commits.sh
##
# 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
rponte / plsql-clean-code.md
Last active Sep 13, 2019
TechDay: Aplicando Clean Code em código PL/SQL
View plsql-clean-code.md

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
rponte / robust-bash.sh
Created Aug 29, 2019 — forked from TimothyJones/robust-bash.sh
These are (currently) the only functions I recommend porting around when writing bash scripts
View robust-bash.sh
#!/bin/bash -eu
if [ -z "${LIB_ROBUST_BASH_SH:-}" ]; then
LIB_ROBUST_BASH_SH=included
function error {
echo "Error: ${1:-}"
}
# Check to see that we have a required binary on the path
function require_binary {
@rponte
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
rponte / hibernate-oracle-tip.md
Last active Aug 12, 2019
Hibernate Tip when working with Oracle: favor dynamic update
View hibernate-oracle-tip.md

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.