Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
In Case of Fire: git commit, git push, then leave the building

Guillermo Céspedes Tabárez dertin

:octocat:
In Case of Fire: git commit, git push, then leave the building
  • Uruguay
View GitHub Profile
View process-graph.rs
// 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;
@dertin
dertin / php-pools.md
Last active Jul 1, 2019 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)
View php-pools.md

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
@dertin
dertin / git-deploy-aws.md
Last active Apr 4, 2019
Setup git deploy for AWS ec2 Ubuntu instance
View git-deploy-aws.md
View s3BackUp.sh
#!/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
View README.md
View lotteryGoogleAccount.py
#!/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
View checkGoogleAccount.py
#!/usr/bin/env python
# Author: Guillermo Cespedes <dev.dertin@gmail.com>
# pip install requests http barnum
import requests
import http.cookies
import json
from barnum import gen_data
@dertin
dertin / Virtual Box Host Only Static IP.md
Created Oct 13, 2018 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP
View Virtual Box Host Only Static IP.md

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@dertin
dertin / Hadoop-3.1.md
Last active Oct 14, 2018 — forked from xterat/Compile-Hadoop-2.8.md
Hadoop 3.1 on Debian 9.5
View Hadoop-3.1.md

INSTALL Hadoop 3.1 on Debian 9.5

  1. Install some dependencies:
   su -
   apt -y install build-essential autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev libsasl2-dev \
   libsnappy-dev bzip2 libbz2-dev libjansson-dev fuse libfuse-dev zstd \
   clang libc6-dev libtool libzip-dev libncurses-dev liblzo2-dev  \
   software-properties-common dirmngr python python-dev python-setuptools \
@dertin
dertin / fstab
Last active May 20, 2020
AWS EC2 t2.micro / t2.small
View fstab
# /etc/fstab
UUID=XXXXXXXXXXX / ext4 noatime,nodelalloc,barrier=0,i_version,commit=30,inode_readahead_blks=64,rw,errors=remount-ro 0 1