Skip to content

Instantly share code, notes, and snippets.

@caligin
caligin / README.md
Created October 16, 2020 10:57
template for case studies

title of case study

date: (even if you have git) contact: (for context) status: draft | published | review (inspiration from RFC?)

context

...

constraints

@caligin
caligin / gist:f908c06e21a8f1c42d11ad8a3e0083d0
Created July 20, 2020 23:46
do digitalocean_container_registry_docker_credentials trace log redacted
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: -----------------------------------------------------
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: 2020/07/21 00:26:48 [DEBUG] DigitalOcean API Request Details:
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: ---[ REQUEST ]---------------------------------------
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: GET /v2/registry/docker-credentials?expiry_seconds=2147483647&read_write=false HTTP/1.1
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: Host: api.digitalocean.com
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: User-Agent: Terraform/0.12.28 godo/1.36.0
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v1.21.0: Accept: application/json
2020-07-21T00:26:48.053+0100 [DEBUG] plugin.terraform-provider-digitalocean_v

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@caligin
caligin / README.md
Last active March 29, 2018 12:17
documentation repo readme template

documentation

architecture decision records (ADRs), diagrams, explanation of processes, any other reference material and reports of past issues never solved

table of contents

  • architecture-decision-records

TODO: this can probably become a template+makefile combo (see actual-cookbook for reference)

[
{ "keys": ["ctrl+shift+up"], "command": "duplicate_line" },
{ "keys": ["ctrl+shift+down"], "command": "duplicate_line" },
{ "keys": ["alt+shift+up"], "command": "swap_line_up" },
{ "keys": ["alt+shift+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+s"], "command": "save_all" },
{ "keys": ["ctrl+e"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
{ "keys": ["ctrl+1"], "command": "focus_side_bar" }
]
@caligin
caligin / ps1
Created October 27, 2016 16:32
function __hg_ps1 ()
{
if [ "$(hg root 2> /dev/null)" ]; then
echo -en "(hg:$(hg branch))"
fi
}
function __git_ps1 ()
{
if [ "$(git rev-parse --show-toplevel 2> /dev/null)" ]; then
echo -en "(git:$(git branch | tr '\n' ',' | rev | cut -c 2- | rev | sed 's/,/, /g'))"
version: "2"
services:
bastion:
image: caligin/shepherd_bastion
fip: <redacted>
links:
- app:shepherd
ports:
- "6022:22"
app:
-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=*:5005,suspend=y
Stream.of(((URLClassLoader)ClassLoader.getSystemClassLoader()).getURLs()).map(URL::getFile).forEach(System.out::println);
javascript:(function() {
var size_amplification_factor = 1.1;
var possible = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
Array.prototype.slice.call(document.querySelectorAll('body *:not(iframe)')).reduce(function(m, n){ return m.concat(Array.prototype.slice.call(n.childNodes)); },[]).filter(function(n) {
return n.nodeType === Node.TEXT_NODE && n.parentElement.nodeName !== 'SCRIPT' && n.parentElement.nodeName !== 'STYLE' && n.nodeValue.trim() != '';
}).forEach(function(n) {
var new_content = '';
for(var i = 0; i< (n.nodeValue.trim().length * size_amplification_factor); i++) {
new_content += possible.charAt(Math.floor(Math.random() * possible.length));
}