Skip to content

Instantly share code, notes, and snippets.

View fabiojaniolima's full-sized avatar
😃
A good programmer looks both ways before crossing a one-way street.

Fabio J L Ferreira fabiojaniolima

😃
A good programmer looks both ways before crossing a one-way street.
View GitHub Profile
@fabiojaniolima
fabiojaniolima / .travis.yml
Last active August 26, 2018 00:23
Laravel + Travis-ci (deploy + teste automatizado)
language: php
env:
global:
- setup=stable
matrix:
fast_finish: true
include:
- php: 7.1
###############
### 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 / check-mountpoint.sh
Last active October 19, 2019 20:42
Verifica se determinado ponto de montagem está presente em hosts remotos
#!/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 ]];
@fabiojaniolima
fabiojaniolima / run-remote-script.sh
Created December 6, 2019 01:16
Execute script ou comandos remotos em múltiplos servidores. Necessário chave de autenticação.
#!/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 / newProcess.js
Created February 22, 2020 15:43
Returns a Promise that delegates to the operating system the execution of the instruction passed as a parameter
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) => {
{
// Define o tema do VSCode
"workbench.colorTheme": "Shades of Purple",
// Configura tamanho e família da fonte
"editor.fontSize": 18,
"editor.lineHeight": 24,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"explorer.compactFolders": false,