Skip to content

Instantly share code, notes, and snippets.

@jesugmz
jesugmz / multi-cloud-docker-swarm.md
Last active September 14, 2024 15:51
Create a simple multi cloud Docker cluster using Docker Swarm, Docker Machine and the three top cloud providers nowadays - Google Compute Engine, Microsoft Azure and AWS

Simple multi cloud Docker cluster using Docker Swarm

This guide explains how to create a simple multi cloud Docker cluster using Docker Swarm, Docker Machine and the three top cloud providers nowadays - Google Compute Engine, Microsoft Azure and AWS.

Prerequisites

This guide assumes you have a Linux host with Docker CE installed. If you are using Docker for Mac or Docker for Windows you can avoid the Docker Machine set up since it comes included.

Install Docker Machine

@jesugmz
jesugmz / Configure-SSH-with-multiple-git-accounts.md
Last active July 17, 2024 10:11
Configure SSH with multiple git accounts

Configure SSH with multiple git accounts

Scenario: same git provider, for this example GitHub (this trick is provider agnostic, has been tested with GitLab as well), and we want to have SSH configured for two different users (or more): jesugmz and myseconduser.

Step 1

Configure SSH config in order to get an alias with different configuration as follow:

$ cat ~/.ssh/config
@jesugmz
jesugmz / Python-docstring-restructuredtext-style.rst
Last active June 23, 2024 16:33
Python docstring reStructuredText style

Python docstring reStructuredText style

Python Signatures

Signatures of functions, methods and class constructors can be given like they would be written in Python.

@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
@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 / generate-docker-base64-auth-token.md
Created August 20, 2018 00:00
Generate Docker base64 auth token

docker login will produce a base64 digest if the binaries pass and secretservice are not present on Linux platforms (source).

To generate a base64 auth token:

echo -n 'username:password' | base64
@jesugmz
jesugmz / let-s-encrypt-certificate-for-dockerized-nginx-under-cloudflare.md
Last active October 19, 2023 08:23
Let’s Encrypt certificate for dockerized Nginx under Cloudflare
@jesugmz
jesugmz / 60-jetbrains.conf
Last active April 24, 2023 17:32
Avoid the message 'External file changes sync may be slow: The current inotify(7) watch limit is too low.' from JetBrains products
#
# Avoid the message 'External file changes sync may be slow: The current inotify(7) watch limit is too low.' from JetBrains products.
#
# 1. Create the file /etc/sysctl.d/60-jetbrains.conf and paste this code
# 2. Restart the sysctl service: sudo sysctl -p --system
# 3. Restart the IDE
#
# More info:
# https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
@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 / gnu-linux-debbuging-tools.md
Last active January 5, 2023 18:37
GNU/Linux Debbuging tools

GNU/Linux debbuging tools

top-like interface for container metrics.

DNS lookup utility.