Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
echo "RENEWED_LINEAGE: ${RENEWED_LINEAGE}"
# requires `yq` and `jq` cli tools
OKTA_API_TOKEN=$(yq --raw-output .okta.client.token ~/.okta/okta.yaml)
API_URL="${1}/api/internal/v1/custom-url-domain/certificate"
CERT=$(cat "${RENEWED_LINEAGE}/cert.pem")
KEY=$(cat "${RENEWED_LINEAGE}/privkey.pem")
CHAIN=$(cat "${RENEWED_LINEAGE}/chain.pem")
Originally from: http://erlang.org/pipermail/erlang-questions/2017-August/093170.html
For a safe and fast Erlang SSL server, there's a few
configuration values you might want by default:
[{ciphers, CipherList}, % see below
{honor_cipher_order, true}, % pick the server-defined order of ciphers
{secure_renegotiate, true}, % prevent renegotiation hijacks
{client_renegotiation, false}, % prevent clients DoSing w/ renegs
{versions, ['tlsv1.2', 'tlsv1.1']}, % add tlsv1 if you must
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
config :my_app, :twitter_api,
client: Twitter.SandboxClient
@brweber2
brweber2 / view_helpers.ex
Last active September 30, 2015 01:54
Phoenix View Helpers for select boxes
defmodule Clockout.MyViewHelpers do
def display_name(:client, id) do
Clockout.Client |> display_name_by_id(id)
end
def display_name(:person, id) do
Clockout.Person |> display_name_by_id(id)
end
@jeremyschulman
jeremyschulman / trace-route-ldp.rb
Last active December 11, 2015 05:08
A simple example tracking down a routing path through a BGP/MPLS/LDP Junos network.
require 'highline/import'
require 'net/netconf/jnpr'
target = ARGV[0] || begin
puts "You must specify a starting target device"
exit 1
end
dst_route = ARGV[1] || begin
puts "You need to specify a destination route"
@MonkeyIsNull
MonkeyIsNull / plop.rb
Created March 22, 2012 00:15
Watches for the Plops of Twitter dropping your friends
require 'rubygems'
require 'twitter'
require 'Getopt/Declare'
class Plop
attr_accessor :who, :seed_file, :peep_list
def initialize(who, seed_file='./plop.seed')
@who = who
(function(__global){
if (!__global.console || (__global.console && !__global.console.log)) {
__global.console = {
log: (__global.opera && __global.opera.postError)
? __global.opera.postError
: function(){ }
}
}
})(this);
@voodootikigod
voodootikigod / pp.js
Created January 17, 2011 00:27
Wrapper for printing in JavaScript
function pp (t) {
if (typeof console == "object" && typeof console.log == "function")
console.log(t);
else
print(t);
}