Skip to content

Instantly share code, notes, and snippets.

View muriloloffi's full-sized avatar
🥊
Punching above my weight

Murilo muriloloffi

🥊
Punching above my weight
View GitHub Profile
@muriloloffi
muriloloffi / docker-compose-installer-for-container-optimized-os-on-gce.md
Created March 27, 2024 17:13 — forked from kurokobo/docker-compose-installer-for-container-optimized-os-on-gce.md
Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

Simple Installer for Docker Compose on Container-Optimized OS on Google Computing Engine

The easiest way to make Docker Compose available on Container-Optimized OS on Google Compute Engine (GCE) on Google Cloud Platform (GCP).

This is minimal Bash script version of Community Tutorial.

How to use

Simply, download installer.sh, run it, and then reload bash by source ~/.bashrc or re-login.

@muriloloffi
muriloloffi / validar_cpf.php
Created April 9, 2023 17:18 — forked from rafael-neri/validar_cpf.php
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
@muriloloffi
muriloloffi / turn-docker-containers-off.sh
Last active January 4, 2023 19:30
Shortcut script to turn off every docker container and network.
#!/bin/bash
#For ease of use, you can set an Alias to this script in your shell session "rc" file.
#i.e. alias sdc="/home/$USER/turn-docker-containers-off.sh"
containers=$(docker ps -qa)
if [[ $? != 0 ]]; then
echo "Command failed."
exit 127
@muriloloffi
muriloloffi / set-cpufreq-scaling-governor-to-performance.sh
Last active January 4, 2023 19:41
This script changes, on Intel processors under GNU/Linux, the performance setting of a 'cpufreq' subsystem layer called 'scaling_governor'. It applies for each core of the system.
#!/bin/bash
# This script changes, on Intel processors under GNU/Linux, the performance setting of a 'cpufreq' subsystem layer called 'scaling_governor'.
# It applies to all cores of the system.
# For more details on the cpufreq subsystem, read the docs: https://docs.kernel.org/admin-guide/pm/cpufreq.html
# W.I.P: Write a script for "doas" self-configuration. The "doas" package is available in the repositories of most distros. This package is a requirement and must be already installed and configured to accept the parameters that specify the cores. Doas manual: https://man.openbsd.org/doas
numberOfSystemCores=$(($(grep -c ^processor /proc/cpuinfo)-1))