Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafael Martins rsmartins78

View GitHub Profile
@rsmartins78
rsmartins78 / colorized_logs.sh
Created Oct 20, 2021
Colorized logs in shell script
View colorized_logs.sh
#!/bin/bash
log () {
local red=$'\e[1;31m'
local yll=$'\e[1;33m'
local grn=$'\e[1;32m'
local blu=$'\e[1;34m'
# local mag=$'\e[1;35m'
# local cyn=$'\e[1;36m'
# local white=$'\e[1;37m'
@rsmartins78
rsmartins78 / startvm.sh
Last active Jun 15, 2018
Script to start a VirtualBox VM in CLI.
View startvm.sh
#!/bin/bash
#First Argument
START=$1
#Checking if exist argument.
if [ -z $START ]; then
echo "Please supply one argument with VM Name"
echo "Example: $0 docker"
exit 1
@rsmartins78
rsmartins78 / backup_gitlab.sh
Last active May 11, 2018
Script for Gitlab in Docker backup. It collects de Container ID, make an Docker exec, and move the file created in origin to destiny choosed.
View backup_gitlab.sh
#!/bin/bash
#############################################################################
## Nome: Gitlab-Backup ##
## Função: SCRIPT PARA AUTOMAÇÃO DE BACKUP DE ##
## UM GITLAB SERVER EXECUTADO EM DOCKER. ##
## PODE SER UTILIZADO PARA USO EM CRONTAB, POIS COLETA A ID CONTAINER. ##
## Linguagem: Shell Script ##
## ##
## OBRIGADO PELO APOIO ##
@rsmartins78
rsmartins78 / Vagrantfile
Created May 9, 2018
Vagrantfile example CentOS with provisioning script
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.hostname = "docker"
config.vm.box = "centos/7"
config.vm.provision :shell, path: "install.sh"
config.vm.provider "virtualbox" do |virtualbox|
virtualbox.customize [ "modifyvm", :id, "--cpus", "1" ]
virtualbox.customize [ "modifyvm", :id, "--memory", "600" ]
end
end
@rsmartins78
rsmartins78 / install.sh
Last active May 9, 2018
Provisioner for Vagrantfile
View install.sh
#!/bin/bash
## Escolha abaixo o que será instalado !!
## 0 = Não, 1 = Sim
docker=1
ansible=1
## Caso haja proxy, favor definir abaixo
proxy=COLOCAR_IP_DO_PROXY
porta=COLOCAR_PORTA_DO_PROXY
@rsmartins78
rsmartins78 / rancher-get-info.sh
Created Apr 12, 2018 — forked from usmanismail/rancher-get-info.sh
A curl wrapper to get container info from the rancher API
View rancher-get-info.sh
#!/bin/sh
usage(){
echo "Usage: $0 ACCESS_KEY ACCESS_SECRET CONATAINER_ID"
exit 1
}
# call usage() function if filename not supplied
[[ $# -ne 3 ]] && usage