Skip to content

Instantly share code, notes, and snippets.

View vickvasquez's full-sized avatar
🎯
Focusing

Vick Vasquez vickvasquez

🎯
Focusing
View GitHub Profile
@vickvasquez
vickvasquez / 1-setup.md
Created March 7, 2023 14:36 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.

@vickvasquez
vickvasquez / TLS
Created November 19, 2020 23:55 — forked from jult/TLS
My nginx include for TLS A+ rating at ssllabs.com/ssltest using nginx/1.14.* and openssl 1.1.1*
# version 2020 feb 24
ssl_certificate /etc/letsencrypt/live/yardomain.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yardomain.org/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/yardomain.org/chain.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
@vickvasquez
vickvasquez / .gitlab-ci.yml
Created June 15, 2020 20:54 — forked from jlis/.gitlab-ci.yml
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
@vickvasquez
vickvasquez / backup-mongodb-to-s3.sh
Created April 17, 2020 17:24 — forked from caraboides/backup-mongodb-to-s3.sh
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
#!/bin/sh
set -e
HOST=localhost
DB=test-entd-products
COL=asimproducts
S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/"
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
S3LATEST=$S3PATH"latest".dump.gz
/usr/bin/aws s3 mb $S3PATH
@vickvasquez
vickvasquez / docker-cleanup-resources.md
Created January 12, 2019 18:17 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@vickvasquez
vickvasquez / Laravel PHP7 LEMP AWS.md
Created August 29, 2017 06:40 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@vickvasquez
vickvasquez / .md
Created August 18, 2017 06:26 — forked from joepie91/.md
Running a Node.js application using nvm as a systemd service

Trickier than it seems.

1. Set up nvm

Let's assume that you've already created an unprivileged user named myapp. You should never run your Node.js applications as root!

Switch to the myapp user, and do the following:

  1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash (however, this will immediately run the nvm installer - you probably want to just download the install.sh manually, and inspect it before running it)
  2. Install the latest stable Node.js version: nvm install stable
@vickvasquez
vickvasquez / apiTwitter.js
Created February 23, 2016 23:00 — forked from jeduan/apiTwitter.js
Implementing Twitter's OAuth with only request
import request from 'request-promise'
import {parse as qsparse} from 'querystring'
import parse from 'co-body'
var post = request.defaults({json: true}).post
const TWITTER_KEY = ''
const TWITTER_SECRET = ''
const TWITTER_CALLBACK_URL = ''
export function * requestToken () {
@vickvasquez
vickvasquez / query.sql
Last active August 29, 2015 14:15 — forked from ZeusAFK/query.sql
SELECT COALESCE(SUM(kdx_precio_salida * kdx_salida) - SUM(kdx_costo_entrada * kdx_entrada), 0) AS total
FROM tabla_a
LEFT JOIN tabla_b
ON tabla_a.folio = tabla_b.kdx_folio
WHERE (tipo_movto = 'venta'
OR tipo_movto = 'venta-devolucion')
AND tienda_id = ?
AND LEFT(fecha_movim, 10) BETWEEN ? AND ?
GROUP BY WEEK(fecha_movim)
ORDER BY WEEK(fecha_movim)