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 / MessengerNotify.ahk
Created August 28, 2025 00:19
Parpadeo en browsers
#Persistent
#SingleInstance Force
SetTimer, CheckMessenger, 5000
return
CheckMessenger:
; Cambia "chrome.exe" por "brave.exe" si usas Brave
WinGet, id, list, ahk_exe chrome.exe
Loop, %id%
{
@vickvasquez
vickvasquez / js
Last active October 31, 2023 20:13
Ejemplo del patron estrategia + patron plantilla, para exportar datos en diferentes formatos
class ExportStrategy {
constructor(database, logger, fileSystem, authService) {
this.database = database;
this.logger = logger;
this.fileSystem = fileSystem;
this.authService = authService;
}
exportData(data) {
@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 / auth-db.sh
Last active May 5, 2021 02:49
Configurar usuarios y acceso remoto en mongodb en ubuntu 20.04
#Roles
# https://docs.mongodb.com/manual/reference/built-in-roles/#all-database-roles
Crear un usuario con permisos limitadoa para una base de datos en especifico.
passwordPrompt() Le preguntará la contraseña al crear el usuario.
db.createUser({
user:"userName",
pwd: passwordPrompt(),
roles: [
@vickvasquez
vickvasquez / my-site.conf
Created January 28, 2021 16:18
Security NGINX
#/etc/nginx/sites-enabled/my-config
server {
server_name _;
root /var/www/html/;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 0;
@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 / commands-files-server.sh
Last active February 16, 2024 12:02
Commands to operate files on ubuntu servers
#Often time, you may need to know which file contains large file size, and delete it to save space. Here’s a code pattern to show you how to find large file size on Linux :
#find {directory} -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
#1. File size >= 100MB
#Find all files that have a size >= 100MB, from root folder and its sub-directories.
find . -maxdepth 1 -type f -size +100M
#Formatted
sudo find / -type f -size +100M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
# 2. File size >= 50MB
@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 / search_fields.sql
Last active July 10, 2019 15:20
Find all the tables in MySQL with specific column names in them
#Option 1
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ('columnA','ColumnB') AND TABLE_SCHEMA='YourDatabase';
#Option 2
SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME = 'column';
#Option 3
SELECT * FROM information_schema.columns WHERE column_name = 'column_name';