Skip to content

Instantly share code, notes, and snippets.

View Rigo85's full-sized avatar
🏠
Working from home

Rigoberto L. Salgado Reyes Rigo85

🏠
Working from home
  • Digevo
  • Trujillo - Perú
View GitHub Profile
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 22, 2024 23:19
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@mrroot5
mrroot5 / p7zip_lzma_ultra.md
Last active November 30, 2023 07:52
p7zip - 7zip lzma y lzma2 compresión máxima ultra. Keywords: zip, 7zip, p7zip, ubuntu, compress, comprimir

Intro

Compresión de ficheros con 7zip en Linux.

How to install 7zip?

apt

Versión vieja, 7zip 16.04.

La versión moderna se instala usando los binarios (no recomendado para novatos).

@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active June 26, 2024 15:54
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
/*Copyright (c) 2013-2016, Rob Schmuecker
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name Rob Schmuecker may not be used to endorse or promote products
@styblope
styblope / docker-api-port.md
Last active July 14, 2024 08:29
Enable TCP port 2375 for external connection to Docker

Enable TCP port 2375 for external connection to Docker

See this issue.
Docker best practise to Control and configure Docker with systemd.

  1. Create daemon.json file in /etc/docker:

     {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
    
@lgaticaq
lgaticaq / dni_peru_validate.js
Last active May 17, 2022 19:19
Función para validar DNI Peruano
/**
* Verifica que un DNI de Perú sea valido
* @param {String} data DNI
* @returns {Boolean}
*/
const validate = data => {
const dni = data.replace('-', '').trim().toUpperCase()
if (!dni || dni.length < 9) return false
const multiples = [3, 2, 7, 6, 5, 4, 3, 2]
const dcontrols = {