Skip to content

Instantly share code, notes, and snippets.

Fábio Jânio fabiojaniolima

Block or report user

Report or block fabiojaniolima

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
@fabiojaniolima
fabiojaniolima / newProcess.js
Created Feb 22, 2020
Returns a Promise that delegates to the operating system the execution of the instruction passed as a parameter
View newProcess.js
const { exec } = require('child_process')
/**
* It delegates to the operating system the execution of the instruction passed as a parameter
* @param {string} command Instruction to be executed on the operating system
* @returns {Promise} Resolves to an object: {success: [boolean], content: [string]}
*/
const newProcess = command => {
return new Promise((resolve, reject) => {
exec(command, (_, stdout, stderr) => {
@fabiojaniolima
fabiojaniolima / run-remote-script.sh
Created Dec 6, 2019
Execute script ou comandos remotos em múltiplos servidores. Necessário chave de autenticação.
View run-remote-script.sh
#!/bin/bash
SERVERS=(host01 host02 host03);
echo "##################";
echo "# Header Example #";
echo -e "##################\n";
echo -e "Run on: $(date '+%F - %T')\n"
for i in "${!SERVERS[@]}"
@fabiojaniolima
fabiojaniolima / check-mountpoint.sh
Last active Oct 19, 2019
Verifica se determinado ponto de montagem está presente em hosts remotos
View check-mountpoint.sh
#!/bin/bash
FILESYSTEM="/storage"
SERVERS=(host01 host02 host03)
for i in "${!SERVERS[@]}"
do
STATUS=$(ssh -q -oStrictHostKeyChecking=no ${SERVERS[i]} "if mountpoint -q ${FILESYSTEM}; then echo "OK"; else echo "NOK"; fi")
if [[ $? != 0 ]];
View Codeanywhere (PHP 7.1 e MySQL 5.7)
###############
### PHP 7.1 ###
###############
sudo apt-get update
sudo apt-get upgrade -y
# Sempre que questionado, responda "Y"
sudo apt-get install software-properties-common python3-software-properties -y
@fabiojaniolima
fabiojaniolima / .travis.yml
Last active Aug 26, 2018
Laravel + Travis-ci (deploy + teste automatizado)
View .travis.yml
language: php
env:
global:
- setup=stable
matrix:
fast_finish: true
include:
- php: 7.1
You can’t perform that action at this time.