Keybase proof

I hereby claim:

  • I am caruccio on github.
  • I am caruccio ( on keybase.
  • I have a public key ASD6Us-tApW2y3pqe9q7ruqypYAF289oNQQXUWVX5fcE0go

To claim this, I am signing this object:


Check ou this trick to convert any text into a sequence of chars of the same length

$ MESSAGE="Some arbitrary message to convert into dashes"
$ echo "$MESSAGE" | tr "$MESSAGE" -

I like to use it to "underlinize" titles on my scripts

View mariadb-galera-persistent-template.yml
# Source:
kind: Template
apiVersion: v1
name: mariadb-galera-persistent
description: MariaDB Galera cluster persistent (NFS)
iconClass: icon-mariadb
tags: database,mysql,replication,mariadb,galera,nfs
View Dockerfile
FROM openshift/base-centos7
# This image provides an Apache+PHP environment for running PHP
# applications.
MAINTAINER Mateus Caruccio <>
# Instead of defining a global to use inside your function, just define it as a default
# value of the function, specially if the value can cost some significant time
regex = re.compile('[^0-9]') # globals are evil (are they?)
def clean_zip(string):
return regex.sub('', string)
# This way we execute re.compile a single time AND have the advantage to overwrite it when necessary
def clean_zip(string, regex=re.compile('[^0-9]')):
from contextlib import contextmanager
import requests
import io
import sys
import time
class Streamer(io.TextIOBase):
def readline(self, limit=-1):
return '.' * (1024 if limit <= 0 else limit) + "\n"
View assemble
# Salve este arquivo em seu repositorio, no caminho ".s2i/bin/assemble"
if [ "$STI_SCRIPTS_PATH/assemble" ]; then
source $STI_SCRIPTS_PATH/assemble
# Faça o que voce precisa aqui...
View getupcloud-signup-form.html
<script type='text/javascript' src=''></script>
<script type='text/javascript'>
$(document).ready(function ()
$('#show-password').change(function() {
$('#password').prop('type', this.checked ? 'text' : 'password')
$('#signup-form').submit(function(event) {
# Lets assume you need to turn on a shopt (dotglob, for example),
# do some work and finally turn it back to it's original state.
# First we check if it's on already (shopt -q <flag>),
# and set a flag variable in case it was.
# Otherwise we turn it on and ensure the flag is clear (unset <flag>).
shopt -q dotglob && dotglob=1 || { shopt -s dotglob && unset dotglob; }
## Here we can do whatever we need to do...
# Returns true (0) if $1 is on $PATH, false (1) otherwise
# Handles path expansions as expected
# Example: is_dir_on_path ~/bin
local path
local dir
# convert $PATH to array