Skip to content

Instantly share code, notes, and snippets.

Avatar
🎱
foobar

Gene Diaz genediazjr

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

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 Apr 23, 2021 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# === 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.
#
View .eslintrc
{
"parserOptions": {
"ecmaVersion": 8
},
"env": {
"browser": true,
"jquery": true,
"node": true,
"es6": true
},
View maxsize.config
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000755"
owner: root
group: root
content: |
client_max_body_size 50M;
View isValidServiceId.js
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 Feb 23, 2018 — 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)
View letsencrypt_2017.md

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.

View hosts
# 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 Dec 6, 2016
List all routes from a hapi server
View list_routes.js
server.table()[0].table.forEach((route) => console.log(`${route.method}\t${route.path}`));
View reserved_usernames.json
[
"0",
"about",
"access",
"account",
"accounts",
"activate",
"activities",
"activity",
"ad",
@genediazjr
genediazjr / ultimate-ut-cheat-sheet.md
Created Aug 24, 2016 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon
View ultimate-ut-cheat-sheet.md

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