Compresión de ficheros con 7zip en Linux.
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=64m -ms=on comprimido.7z -mhe -pSECRET mi_carpeta_a_comprimir
- t7z : archivo 7z
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json
file in /etc/docker
:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
-- 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%' |
/** | |
* 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 = { |
# 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. |
var async = require('async'); | |
async.waterfall( | |
[ | |
function(callback) { | |
callback(null, 'Yes', 'it'); | |
}, | |
function(arg1, arg2, callback) { | |
var caption = arg1 +' and '+ arg2; | |
callback(null, caption); |
/* Modern Font Stacks */ | |
/* System */ | |
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; | |
/* Times New Roman-based serif */ | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; | |
/* A modern Georgia-based serif */ | |
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; |