Skip to content

Instantly share code, notes, and snippets.

View genediazjr's full-sized avatar
🎱
foobar

Gene Diaz genediazjr

🎱
foobar
View GitHub Profile
@genediazjr
genediazjr / README.md
Created April 28, 2021 22:51 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@genediazjr
genediazjr / my.cnf
Last active April 23, 2021 11:34 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated February 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
{
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"browser": true,
"jquery": true,
"node": true,
"es6": true
},
@genediazjr
genediazjr / maxsize.config
Created February 16, 2020 12:25
.ebextensions
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 50M;
const isValidServiceId = (serviceId) => {
serviceId = `${serviceId}`;
while (serviceId.length < 10) {
serviceId = `0${serviceId}`;
}
const rootId = serviceId.slice(0, -1);
let sum = 0;
@genediazjr
genediazjr / letsencrypt_2017.md
Created February 23, 2018 11:43 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#
# See below for acknowledgements.
# Please forward any additions, corrections or comments by email to
# hosts@someonewhocares.org
@genediazjr
genediazjr / list_routes.js
Created December 6, 2016 18:20
List all routes from a hapi server
server.table()[0].table.forEach((route) => console.log(`${route.method}\t${route.path}`));
[
"0",
"about",
"access",
"account",
"accounts",
"activate",
"activities",
"activity",
"ad",
@genediazjr
genediazjr / ultimate-ut-cheat-sheet.md
Created August 24, 2016 15:52 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies