Skip to content

Instantly share code, notes, and snippets.

@kekru
kekru / 1-Enable Docker Remote API with TLS client verification.md
Last active January 11, 2024 18:21
Docker Remote API with client verification via daemon.json

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

@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@james2doyle
james2doyle / vue.pretty-bytes.filter.js
Last active November 28, 2021 01:07
Vue.js pretty bytes filter. This filter formats bytes into human readable formats
// usage: {{ file.size | prettyBytes }}
Vue.filter('prettyBytes', function (num) {
// jacked from: https://github.com/sindresorhus/pretty-bytes
if (typeof num !== 'number' || isNaN(num)) {
throw new TypeError('Expected a number');
}
var exponent;
var unit;
var neg = num < 0;
@hroling
hroling / gist:85f36e86d48285f08161
Last active March 28, 2021 02:42
Apache 2.4 SSL config for A+ on SSLLabs.com
OLD stuff. This was not enough for an A+ anymore.
@hpatoio
hpatoio / gist:4398399
Last active March 15, 2021 02:46
Create a MySQL database and create a user with all grant on it
CREATE USER 'DB_USERNAME'@'localhost' IDENTIFIED BY 'DB_PASSWORD';
GRANT USAGE ON * . * TO 'DB_USERNAME'@'localhost' IDENTIFIED BY 'DB_PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE IF NOT EXISTS `DB_USERNAME` ;
GRANT ALL PRIVILEGES ON `DB_USERNAME` . * TO 'DB_USERNAME'@'localhost';
#For connection from everywhere
GRANT USAGE ON * . * TO 'DB_USERNAME'@'%' IDENTIFIED BY 'DB_PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0
GRANT ALL PRIVILEGES ON `DB_USERNAME` . * TO 'DB_USERNAME'@'%';
@jimeh
jimeh / mustache.js
Created March 15, 2010 11:41
mustache.js — Super-simple Mustache-style text-replacement.
/*
Super-simple Mustache-style text-replacement.
Example:
var data = {name: "James", location: "Mars"};
mustache("Welcome to {{location}}, {{ name }}.", data); // => Welcome to Mars, James.
*/
function mustache(string, data){