Skip to content

Instantly share code, notes, and snippets.

View dertin's full-sized avatar

Guillermo Céspedes Tabárez dertin

View GitHub Profile
// This code is just a proof of concept of the code I need to generate in Rust, having as input a yaml file with process definitions of the style (bpmn)
// Look at the process diagram: https://gist.github.com/dertin/d11c50e957c41325131d3c45cee28f66#gistcomment-3605790
#[allow(unused_variables)]
#[macro_use]
extern crate lazy_static;
use std::collections::HashMap;
#!/usr/bin/env python3
# Author: Guillermo Cespedes <dev.dertin@gmail.com>
# pip install requests http itertools
import requests
import json
import http.cookies
import itertools
import os.path
@dertin
dertin / php-pools.md
Last active July 1, 2019 19:32 — forked from holmberd/php-pools.md
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.

  • sudo grep max_children /var/log/php7-fpm.log
#!/bin/bash
# Usage:
# bash s3BackUp.sh YOUR_BACKUP_DIRECTORY BACKUP_NAME YOUR_BUCKET MAIL_FROM MAIL_TO (OPTIONAL: S3_FOLDER PROFILE)
# bash s3BackUp.sh /var/www/webdisk/example.com/ example my_bucket info@example.com soporte@example.com backup default
# Arguments:
readonly BACKUP_PATH_NO_REMOVE=$1
readonly BACKUP_NAME=$2
readonly S3_BUCKET_NAME=$3
@dertin
dertin / install.sh
Last active July 4, 2018 00:38
INSTALL LEMP STACK - DEBIAN 8.8
Moved to: https://github.com/dertin/lemp-stack-debian/tree/develop
@dertin
dertin / makeswapfile.sh
Last active April 19, 2018 15:32
Create swap file on AWS EC2 t2.micro 1gb
#!/bin/bash
sudo dd if=/dev/zero of=/swap bs=1M count=1024
sudo mkswap /swap
sudo chmod 600 /swap
sudo swapon /swap
sudo cp -iv /etc/fstab{,-$(date '+%y%m%d%H%M%S').bak}
sudo nano /etc/fstab
# add line
@dertin
dertin / deployLocalToEC2.sh
Created April 13, 2018 18:16
Upload the code from a local project to an EC2 instance in Amazon AWS
#!/bin/bash
# Upload the code from a local project to an EC2 instance in Amazon AWS
# It will be necessary to adapt the script to the needs and requirements of your project
# Use at your own risk
# Configuration
readonly DEPLOY_NAME=DeployTesting
readonly DEPLOY_SOURCE=~/Projects/testing
readonly KEY_PAIRS=~/.ssh/keypairs.pem
@dertin
dertin / default
Created March 27, 2018 17:12 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@dertin
dertin / xorg.conf
Last active March 4, 2018 22:36
Olidata 20" w2009s - GTX 560 - xUbuntu
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
//https://www.digitalocean.com/community/tutorials/how-to-set-up-xhprof-and-xhgui-for-profiling-php-applications-on-ubuntu-14-04