Skip to content

Instantly share code, notes, and snippets.

View julienbornstein's full-sized avatar

Julien Bornstein julienbornstein

View GitHub Profile
@julienbornstein
julienbornstein / dd.php
Created September 18, 2020 10:06
symfony/var-dumper dd() function for old versions
<?php
// in app_dev.php
if (!function_exists('dd')) {
function dd(...$vars)
{
foreach ($vars as $v) {
VarDumper::dump($v);
}
@julienbornstein
julienbornstein / docker-configure-tls.sh
Created April 22, 2020 09:24 — forked from ivan-pinatti/docker-configure-tls.sh
Enable TLS in Docker service running in Ubuntu - #docker #docker-tls #tls #ubuntu
#!/usr/bin/env bash
: ' Script that enables TLS for Docker service in Ubuntu 16.x
This script is intended to be run as root
It;
- Generates the keys
- Creates the daemon.json Docker config file
@julienbornstein
julienbornstein / HOWTO-ca.sh
Created April 15, 2020 20:58
Create a Certificate Authority and self signed your website certificates
# 1. Becoming a Certificate Authority
openssl genrsa -des3 -out ca.key 2048
openssl req -x509 -new -nodes -key ca.key -sha256 -days 1825 -out ca.pem
# Install the ca.pem in the Keychain app and set "Always Trust" in the trust section
# 2. Creating "CA-Signed" Certificates for our development websites
openssl genrsa -out localhost.key 2048
openssl req -new -key localhost.key -out localhost.csr
# Edit localhost.ext for SAN configuration
require 'sinatra'
require 'net/http'
require 'net/https'
require 'base64'
require 'json'
require 'encrypted_strings'
# This is an example token swap service written
# as a Ruby/Sinatra service. This is required by
# the iOS SDK to authenticate a user.
<table border="0" cellpadding="0" cellspacing="0" style="background-color:#ff3f89;border-radius:3px;">
<tbody>
<tr>
<td align="center" style="text-align:center;padding:10px;" valign="middle"><font face="Arial" size="2"><span style="font-size:14px"><a href="#" style="text-decoration:none;" target="_blank"><font color="white"><span style="display:block; font-weight:normal">Click Me</span></font></a> </span></font></td>
</tr>
</tbody>
</table>