Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohsen Shamohammadi mhsenpc

View GitHub Profile
@mhsenpc
mhsenpc / Docker connect to remote server.md
Created Jun 1, 2021 — forked from kekru/Docker connect to remote server.md
Connect to another host with your docker client, without modifying your local Docker installation
View Docker connect to remote server.md

Run commands on remote Docker host

This is how to connect to another host with your docker client, without modifying your local Docker installation or when you don't have a local Docker installation.

Enable Docker Remote API

First be sure to enable the Docker Remote API on the remote host.

This can easily be done with a container.
For HTTP connection use jarkt/docker-remote-api.

@mhsenpc
mhsenpc / calc_ration.sql
Created Sep 30, 2020
Calculate Image ratio function for MySql and MariaDB
View calc_ration.sql
DELIMITER $$
DROP FUNCTION IF EXISTS calc_ratio;
CREATE FUNCTION calc_ratio(width int,
height int)
RETURNS VARCHAR(10)
DETERMINISTIC
BEGIN
DECLARE ratio VARCHAR(10);