Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Diego Vieira diego-vieira

I may be slow to respond.
Block or report user

Report or block diego-vieira

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
diego-vieira /
Last active Mar 14, 2019 — forked from holmberd/
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • grep max_children /var/log/php-fpm/error.log
View gist:4fb0c377bd582a996b3faaac984faad6
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#USAGE: ./
# example cron for daily db backup @ 9:15 am
diego-vieira /
Created Jun 29, 2018 — forked from twaddington/
Injects a User-Agent header into outgoing OkHttp requests.
import android.os.Build;
import java.util.Locale;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
diego-vieira /
Created Jun 5, 2018 — forked from voor/
Configuring Kiosk Mode on CentOS
# KIOSK generator for Scientific Linux and CentOS (versions 5; 6 and 7)
# Created using Scientific Linux
# Wasn't made and never tested on different distros than SL/CentOS/EL!
# Version 1.4 for i386 and x86_64
# Feel free to contact me:
# Marcin Wilk
diego-vieira / epub.css
Last active May 21, 2018 — forked from maticrivo/epub.css
You Don't Know JS Ebooks
View epub.css
/* -------------------------------------------------------------- */
/* You don't need to save this file, just use the .sh files below */
body {
text-align: justify;
code, pre {
font-family: "Hack", monospace;

Commit Message Guidelines

Short (50 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
diego-vieira /
Created May 24, 2017
trust self signed certificate
# second parameter is optinal
# it'll save to /Users/myuser/ssl-domain-certificates if not provided
# sh
# sh /Users/myuser/ssl-domain-certificates
View gist:6155b9cf18f70f960895e7fa40ea0bdd
namespace Sstalle\php7cc;
use PhpParser\PrettyPrinter\Standard as StandardPrettyPrinter;
use Sstalle\php7cc\CompatibilityViolation\CheckMetadata;
use Sstalle\php7cc\CompatibilityViolation\ContextInterface;
use Sstalle\php7cc\CompatibilityViolation\Message;
class CLIResultPrinter implements ResultPrinterInterface
diego-vieira /
Last active Apr 29, 2019
Backup Running VirtualBox VMs
for VMNAME in $(VBoxManage list runningvms | cut -d ' ' -f1 | sed 's/"//g;')
echo ""
VBoxManage controlvm "$VMNAME" acpipowerbutton
echo "Waiting for VM "$VMNAME" to poweroff..."
until $(VBoxManage showvminfo --machinereadable "$VMNAME" | grep -q ^VMState=.poweroff.)
You can’t perform that action at this time.