Skip to content

Instantly share code, notes, and snippets.

@jesugmz
jesugmz / check-host-tls-version.md
Last active March 29, 2023 16:14
Check host TLS version

Check host TLS version

Just check the output looking for the TLS versions. In this case v1.0, v1.1, v1.2 and v1.3:

$ nmap --script ssl-enum-ciphers -p 443 www.google.com
Starting Nmap 7.93 ( https://nmap.org ) at 2023-03-29 18:12 CEST
NSOCK ERROR [0.0620s] ssl_init_helper(): OpenSSL legacy provider failed to load.

Nmap scan report for www.google.com (142.250.185.4)
@jesugmz
jesugmz / Debug-Golang-HTTP-response.md
Last active April 21, 2022 13:21
Debug Golang HTTP response
@jesugmz
jesugmz / healthcheck.sh
Last active October 27, 2021 14:44
MySQL healt check for Docker containers, or whatever
#!/bin/bash
# Maximum retries we want to iterate
MAX_RETRIES=10
retries=0
echo -n "Waiting MySQL to be ready"
# mysqladmin ping will produce false positives when is ready but can not yet accept.
# With this solution, we ensure the output is what we expect for any case.
until [[ "$o" == "mysqld is alive" ]]; do
@jesugmz
jesugmz / solve-load-pubkey-id_rsa-invalid-format.md
Last active December 2, 2022 23:35
Solve load pubkey "/root/.ssh/id_rsa": invalid format

OpenSSH 8.3p1 introduces the need of having a public SSH key otherwise is gonna show the warning

load pubkey "/root/.ssh/id_rsa": invalid format

# ssh -V
OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020

To supress this message we can put in place our SSH public key or generate it from our private key with:

@jesugmz
jesugmz / display-raw-images-from-google-drive.md
Last active March 8, 2024 20:47
Display raw images from Google Drive

Display raw images from Google Drive

https://drive.google.com/uc?export=view&id={fileId} where file ID is the unique hash Google Drive gives when the shared link is created.

@jesugmz
jesugmz / metricbeat-impact.md
Created January 31, 2020 15:16
Metricbeat impact

metricbeat-consumption

@jesugmz
jesugmz / benchmark.js
Last active January 16, 2020 16:00
Benchmark Redis clients for Node
'use strict';
const thunk = require('thunks')();
const nodeRedis = require('redis');
const IoRedis = require('ioredis');
// test in thunks(thunk base)
thunk(bench)(console.log.bind(console));
function * bench () {
@jesugmz
jesugmz / vim-spredsheet.md
Last active January 13, 2020 17:14
Vim spred sheet

Vim spread sheet

In the simplest way - at least for my perspective :)

Copy and Paste

  1. yy or Y to yank the current line, including the newline character at the end of the line
  2. P to paste before the cursor, or p to paste after

More info

@jesugmz
jesugmz / Deploy-Next.js-static-to-GitLab-pages.md
Last active April 9, 2024 14:33
Deploy Next.js static to GitLab pages

Deploy Next.js static to GitLab pages

Create a basic GitLab CI config:

$ cat .gitlab-ci.yml
image: node

before_script:
 - npm install