Skip to content

Instantly share code, notes, and snippets.

View adilsoncarvalho's full-sized avatar

Adilson Carvalho adilsoncarvalho

View GitHub Profile
@adilsoncarvalho
adilsoncarvalho / bitbucket-pipelines.yml
Last active April 16, 2024 12:03
Bitbucket Pipelines deployment to a Google Container Engine configuration
options:
docker: true
pipelines:
branches:
master:
- step:
image: google/cloud-sdk:latest
name: Deploy to production
deployment: production
caches:
@adilsoncarvalho
adilsoncarvalho / README.md
Last active November 19, 2023 13:33
Mounting volumes attached to a EC2 instance

Mounting volumes attached to a EC2 instance

Quick and dirty notes from the original AWS Documentation.

TL;DR

[[ ! -z $(sudo file -s /dev/xvdf | grep -e 'data$') ]] && sudo mkfs -t ext4 /dev/xvdf
[[ ! -z $(sudo file -s /dev/xvdg | grep -e 'data$') ]] && sudo mkfs -t ext4 /dev/xvdg
sudo mkdir -p /mnt/{data,tmplog}
@adilsoncarvalho
adilsoncarvalho / docker-compose.yml
Created September 13, 2018 16:58
Example of a docker-compose.yml mounting cloud_sql_proxy as a service
version: '3'
services:
app:
build: .
# your own configurations for that app
depends_on:
- cloud-sql-proxy
environment:
# You must set an URL to access your database. On sequelize (nodejs) it follows this
@adilsoncarvalho
adilsoncarvalho / all-to-mp3.sh
Created July 9, 2011 02:08
Script to convert CAF files to MP3
#!/bin/sh
#
# a script to convert every CAF sound file in the current
# directory to a corresponding AIF sound file.
#
# author: alvin alexander, devdaily.com
#
# This work is licensed under the Creative Commons Attribution-Share Alike 3.0
# United States License: http://creativecommons.org/licenses/by-sa/3.0/us/
@adilsoncarvalho
adilsoncarvalho / gist:1061938
Created July 3, 2011 03:53
How to install RSpec to your ruby gems
#
# if you are using RVM installed system wide (root)
# REMEMBER: if you are using RVM system wide NEVER run sudo gem install !!!!
#
rvmsudo gem install rspec rspec-rails rspec-rails-matchers
#
# if you are using RVM only on your local user or not using RVM at all
#
@adilsoncarvalho
adilsoncarvalho / README.md
Last active August 22, 2022 12:00
Deploying a firebase function from Bitbucket pipelines

Deploying functions from Bitbucket Pipelines

It's quite easy and the same process applies to all Firebase features with minor changes.

Acquire a deployment token

In order to deploy you'll need a deployment token (I named it FIREBASE_TOKEN) and it can be acquired by using the following command

firebase login:ci

@adilsoncarvalho
adilsoncarvalho / cl_ReadJSON.pas
Created April 19, 2016 18:50
Parsing JSON on Delphi (the ugly way)
unit cl_ReadJSON;
interface
uses System.Json, System.SysUtils, Vcl.Dialogs, System.Classes;
procedure ReadJSON;
implementation
@adilsoncarvalho
adilsoncarvalho / tapi_mac.js
Last active April 9, 2021 12:53
MercadoBitcoin - Calculando o TAPI-MAC em NodeJS
const TAPI_SECRET = '1ebda7d457ece1330dff1c9e04cd62c4e02d1835968ff89d2fb2339f06f73028';
const EXPECTED_TAPI_MAC = '7f59ea8749ba596d5c23fa242a531746b918e5e61c9f6c8663a699736db503980f3a507ff7e2ef1336f7888d684a06c9a460d18290e7b738a61d03e25ffdeb76';
const MESSAGE = '/tapi/v3/?tapi_method=list_orders&tapi_nonce=1';
const crypto = require('crypto');
const hmac = crypto.createHmac('sha512', TAPI_SECRET);
hmac.update(MESSAGE);
const TAPI_MAC = hmac.digest('hex');
@adilsoncarvalho
adilsoncarvalho / git-mergetool-winmerge-setup.sh
Created December 29, 2010 17:24
shell script that configures git to use WinMerge as the default tool to handle conflicts
#!/bin/sh
#
# This script will make WinMerge your default tool for diff and merge.
# It must run inside git bash (on Windows)
#
#
# If you experience path issues you should give a try to the gist
# created by markusobrist at https://gist.github.com/1010253
@adilsoncarvalho
adilsoncarvalho / access-sql-server.rb
Created July 18, 2011 12:12
Accessing SQL Server database in JRuby
#!/usr/bin/env ruby
# encoding: UTF-8
#
# Gist presenting how to access a SQL Server via JRuby
#
require 'rubygems'
require 'java'
require 'sqljdbc4'