Skip to content

Instantly share code, notes, and snippets.

View danteay's full-sized avatar
:atom:
Working from home

Eduardo Aguilar Yépez danteay

:atom:
Working from home
View GitHub Profile
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@danteay
danteay / CloudWatch-EC2-logs.md
Last active September 16, 2020 04:09
Add logs from EC2 instance to CloudWatch logs

CloudWatch-EC2

Agent Config

1.- Create new Log Group in CloudWatch

2.- Download agent in EC2 instance

sudo wget http://s3.amazonaws.com/aws-cloudwatch/downloads/latest/awslogs-agent-setup.py
@danteay
danteay / StarUml-V3.md
Created August 22, 2018 17:43
Active StarUml 3 license
@danteay
danteay / put-object-on-aws-s3.php
Created February 6, 2019 06:11 — forked from keithweaver/put-object-on-aws-s3.php
Upload an image/object to an AWS S3 Bucket using PHP
<?php
// Installed the need packages with Composer by running:
// $ composer require aws/aws-sdk-php
$filePath = "https://example.com/test.png";
require 'vendor/autoload.php';
$bucketName = 'YOUR_BUCKET_NAME';
$filePath = './YOUR_FILE_NAME.png';
@danteay
danteay / JWTMiddleaware.php
Created March 13, 2019 14:54
JWT middleaware for Slim 3
<?php
/**
* Global settings for project configuration
*
* PHP Version 7.1
*
* @category Scafolding
* @package CorePHP_Slim_Scafold
* @author Eduardo Aguilar <[email protected]>
* @copyright 2018 Eduardo Aguilar
@danteay
danteay / renderer-twig.php
Created March 13, 2019 17:37
Twig dependency for Slim 3
<?php
/**
* Global settings for project configuration
*
* PHP Version 7.1
*
* @category Dependency
* @package CorePHP_Slim_Scafold
* @author Eduardo Aguilar <[email protected]>
* @copyright 2018 Eduardo Aguilar
@danteay
danteay / config.php
Created March 13, 2019 19:53
config twig for slim 3
<?php
// Renderer settings
return [
'settigns' => [
'renderer' => [
'template_path' => __DIR__ . '/views',
],
// twig view settings
'twig' => [
#!/bin/bash
echo $(dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p') $(dpkg --list | grep linux-headers | awk '{ print $2 }' | sort -V | sed -n '/'"$(uname -r | sed "s/\([0-9.-]*\)-\([^0-9]\+\)/\1/")"'/q;p') | xargs sudo apt-get -y purge
@danteay
danteay / install-php.sh
Last active April 8, 2020 22:43
Install the available php version for your ubuntu system
#!/bin/bash
# Install PHP runtime
PHPV=$(echo $(apt search php7. | grep '^php7\.' | head -1) | tr "/" "\n" | head -1)
sudo apt install \
$PHPV \
$PHPV-cli \
$PHPV-cgi \
@danteay
danteay / node_nginx_ssl.md
Created November 24, 2020 08:55 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user