We'll be comparing the following:
Application.put_env(:elixir, :ansi_enabled, true) | |
# IEx shell customization for color | |
# - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/ | |
# - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/ | |
# - Can add to a specific project or can put in the User home folder as a global config. | |
# Updates from: | |
# - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs | |
timestamp = fn -> | |
{_date, {hour, minute, _second}} = :calendar.local_time |
defmodule CertChecker do | |
alias X509.Certificate, as: Cert | |
def check_file(file) do | |
[cert | chain] = read_pem_file(file) | |
check_certs(cert, chain) | |
end | |
def check_certs(cert, chain) do | |
cert_map = chain |> map_by_subject() |
VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated
use actix::prelude::*; | |
/// Define message | |
#[derive(Message)] | |
#[rtype(result = "Result<String, std::io::Error>")] | |
struct WhatsYourName; | |
#[derive(Message)] | |
#[rtype(result = "()")] | |
struct SetYourName { |
This repo is my experiment in deploying a basic Phoenix app using the
release
feature from elixir 1.9 (https://elixir-lang.org/blog/2019/06/24/elixir-v1-9-0-released/)
and docker, via a multi-stage Dockerfile (https://docs.docker.com/develop/develop-images/multistage-build/)
leveraging bitwalker's docker images for Elixir and Phoenix.
The simplest way to manage Elixir versions is to use asdf
.
require 'aws-sdk' | |
require 'active_support' | |
require 'active_support/core_ext' | |
# http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Object.html#copy_to-instance_method | |
COPY_TO_OPTIONS = [:multipart_copy, :content_length, :copy_source_client, :copy_source_region, :acl, :cache_control, :content_disposition, :content_encoding, :content_language, :content_type, :copy_source_if_match, :copy_source_if_modified_since, :copy_source_if_none_match, :copy_source_if_unmodified_since, :expires, :grant_full_control, :grant_read, :grant_read_acp, :grant_write_acp, :metadata, :metadata_directive, :tagging_directive, :server_side_encryption, :storage_class, :website_redirect_location, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :ssekms_key_id, :copy_source_sse_customer_algorithm, :copy_source_sse_customer_key, :copy_source_sse_customer_key_md5, :request_payer, :tagging, :use_accelerate_endpoint] | |
Aws.config.update({ | |
region: 'us-east-1', | |
credentials: Aws::Credentials.new(AWS_ACCESS_KEY, AWS_SECRET_KEY) |
child_pid = spawn "psrecord #{Process.pid} --plot plot_#{Time.now.strftime('%H_%M_%S')}.png" | |
a = [] | |
10_000_000.times { |i| a << i.to_s } | |
puts Process.kill('SIGINT', child_pid) | |
puts "continue scripting" |
Recently, Let's Encrypt launched free wildcard certificates. While this is good news in and of itself, as it removes one of the last remaining reasons for expensive commercial certificates, I've unfortunately seen a lot of people dangerously misunderstand what wildcard certificates are for.
Therefore, in this brief post I'll explain why you probably shouldn't use a wildcard certificate, as it will put your security at risk.
It's generally pretty poorly understood (and documented!) how TLS ("SSL") works, so let's go through a brief explanation of the parts that are important here.
The general (simplified) idea behind how real-world TLS deployments work, is that you: