Skip to content

Instantly share code, notes, and snippets.

___ _____ ___ _ _ __ _ _ ___ _ _ ___ _ _ _
/_\ \ / / __| ___ / __|___ _ _| |_(_)/ _(_)___ __| | / __| ___ __ _ _ _ _(_) |_ _ _ / __|_ __ ___ __(_)__ _| | |_ _ _
/ _ \ \/\/ /\__ \ |___| | (__/ -_) '_| _| | _| / -_) _` | \__ \/ -_) _| || | '_| | _| || | \__ \ '_ \/ -_) _| / _` | | _| || |
/_/ \_\_/\_/ |___/ \___\___|_| \__|_|_| |_\___\__,_| |___/\___\__|\_,_|_| |_|\__|\_, | |___/ .__/\___\__|_\__,_|_|\__|\_, |
|__/ |_| |__/
Notes taken in Mar-2018, from acloud.guru and AWS FAQ
___ _ _ _ __ _
/ __| ___ __ _ _ _ _(_) |_ _ _ / |/ \/ |
@pietro
pietro / digest.rs
Last active February 3, 2017 18:38
// Copyright 2015-2016 Brian Smith.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@pietro
pietro / local.sh
Created May 17, 2016 16:22
Ring build script
#!/bin/bash
set -eux -o pipefail
IFS=$'\n\t'
$CC_X --version
$CXX_X --version
make --version
cargo version
@pietro
pietro / gist:8712454
Created January 30, 2014 16:25
Horde 3 security patches
diff --git a/lib/Horde/Form/Renderer.php b/lib/Horde/Form/Renderer.php
index b7404e4..5db7626 100644
--- a/lib/Horde/Form/Renderer.php
+++ b/lib/Horde/Form/Renderer.php
@@ -217,7 +217,7 @@ try {
}
}
require_once 'Horde/NLS.php';
- echo '<input type="hidden" name="_formvars" value="' . @htmlspecialchars(serialize($vars), ENT_QUOTES, NLS::getCharset()) . '" />';
+ echo '<input type="hidden" name="_formvars" value="' . htmlspecialchars(json_encode($vars)) . '" />';
@pietro
pietro / gist:5009340
Last active December 14, 2015 01:49 — forked from anonymous/gist:5009334
a = <<EOS
<head>
<meta charset='utf-8' />
<link href='/styles.css?1333128600' rel='stylesheet' type='text/css' />
<link href='/images/favicon.png' rel='shortcut icon' />
<link href='/opensearch.xml' rel='search' title='Look up a Redis command' type='application/opensearchdescription+xml' />
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
<script async='async' defer='defer' src='/app.js?1295969397'></script>
<meta content='width=device-width, minimum-scale=1.0, maximum-scale=1.0' name='viewport' />
<title>
@pietro
pietro / dynamic_try.rb
Created February 1, 2013 19:18
This is one idea for dynamic Object#try. This doesn't mean it's a good one.
def method_missing(method_name, *args)
if method_name.to_s =~ /(.*)(_i_s)$/
i_s($1, *args)
else
super
end
end
def i_s(meth, *args)
try(meth.to_sym, *args)