Skip to content

Instantly share code, notes, and snippets.

View dascenciohz's full-sized avatar
💭
🚲 💪

Daniel Ascencio dascenciohz

💭
🚲 💪
  • Santiago, Chile
View GitHub Profile
@dascenciohz
dascenciohz / health.php
Created June 22, 2020 18:36
Endpoint to test Web Server, PHP Server and MySQL Database Server
<?php
$database = 'dabase_name';
$username = 'user_name';
$password = 'user_password';
$hostname = 'database_host_name_or_ip';
$link = mysqli_connect("$hostname", "$username", "$password");
if (!$link) {
@dascenciohz
dascenciohz / gcp-compute-instance.tf
Last active December 3, 2019 23:22
Terraform Google compute instance with docker and docker-compose
# GOOGLE CLOUD PROVIDER
provider "google" {
credentials = "${file("account.json")}"
project = "${var.project_name}"
region = "${var.project_region}"
zone = "${var.project_zone}"
}
# FIREWALL WEB SERVER PORTS
resource "google_compute_firewall" "web-server" {
@dascenciohz
dascenciohz / node-mailer-test.js
Created October 23, 2019 22:44
Node Mailer Tester. Depend nodemailer package
"use strict";
const nodemailer = require("nodemailer");
// async..await is not allowed in global scope, must use a wrapper
async function main(){
// Generate test SMTP service account from ethereal.email
// Only needed if you don't have a real mail account for testing
let testAccount = await nodemailer.createTestAccount();
@dascenciohz
dascenciohz / traefik.toml
Created October 23, 2019 18:23
Traefik Config File
debug = false
logLevel = "ERROR"
defaultEntryPoints = ["http", "https"]
[traefikLog]
format = "json"
[accessLog]
format = "json"
@dascenciohz
dascenciohz / php-www.conf
Last active November 7, 2019 15:06
PHP Config file
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
@dascenciohz
dascenciohz / nginx.conf
Last active October 23, 2019 21:17
NGINX Config
user www-data;
worker_processes auto;
error_log /dev/stdout info;
pid /var/run/nginx.pid;
events {
worker_connections 2048;
}
@dascenciohz
dascenciohz / docker-install-ubuntu.sh
Last active October 23, 2019 18:10
Shell Script Docker and docker-compose install to Ubuntu
#!/bin/bash
##--- By Daniel Ascencio <daniel.ascencio.hz@gmail.com> ---##
COMPOSE_VERSION=$1 # 1.24.1
SYSTEM_USER=$2
PACKAGES="apt-transport-https ca-certificates curl gnupg-agent software-properties-common"
DOCKER_GPG="https://download.docker.com/linux/ubuntu/gpg"
DOCKER_URL="https://download.docker.com/linux/ubuntu"