Skip to content

Instantly share code, notes, and snippets.

View gurneesh's full-sized avatar

Gurneesh Singh Chahal gurneesh

View GitHub Profile
@gurneesh
gurneesh / gist:82608de6a3f7134a81406b9e2a44e2df
Created September 23, 2021 07:19
Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number. Example createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890" The returned format must be correct in order to complete this challenge. Don't forget the space after the closing p…
function createPhoneNumber(numbers){
return "(" + numbers.slice(0,3).join('') + ")" + " " + numbers.slice(3,6).join('') + "-" + numbers.slice(6).join('')
}

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

@gurneesh
gurneesh / Docker connect to remote server.md
Created September 11, 2020 11:38 — forked from kekru/Docker connect to remote server.md
Connect to another host with your docker client, without modifying your local Docker installation

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.

const express = require('express');
const morgan = require('morgan');
const cors = require('cors');
const app = express();
app.use(morgan('dev'));
app.use(cors());
app.get('/', (req, res) => {