Skip to content

Instantly share code, notes, and snippets.

View edsykes's full-sized avatar

Ed Sykes edsykes

View GitHub Profile
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"account_id": "",
"x509_cert_path": "",
"x509_key_path": ""
},
"builders": [
{
2016/05/20 20:49:28 ui: ==> amazon-instance: Uploading X509 Certificate...
==> amazon-instance: Uploading X509 Certificate...
2016/05/20 20:49:28 packer: 2016/05/20 20:49:28 Uploading file to '/tmp/cert.pem'
2016/05/20 20:49:30 packer: 2016/05/20 20:49:30 Uploading file to '/tmp/key.pem'
2016/05/20 20:49:32 ui: ==> amazon-instance: Bundling the volume...
==> amazon-instance: Bundling the volume...
2016/05/20 20:49:32 packer: 2016/05/20 20:49:32 [INFO] starting remote command: sudo -i -n ec2-bundle-vol -k /tmp/key.pem -u 970493245035 -c /tmp/cert.pem -r x86_64 -e /tmp/* -d /tmp -p image-1463773401 --batch --no-filter
2016/05/20 20:49:32 ui: amazon-instance: 'sudo' is not recognized as an internal or external command,
2016/05/20 20:49:32 packer: 2016/05/20 20:49:32 [INFO] command 'sudo -i -n ec2-bundle-vol -k /tmp/key.pem -u 970493245035 -c /tmp/cert.pem -r x86_64 -e /tmp/* -d /tmp -p image-1463773401 --batch --no-filter' exited with code: 1
amazon-instance: 'sudo' is not recognized as an internal or ex
@edsykes
edsykes / gist:6ded94fdb5f2abe73b1e
Created August 31, 2015 11:10
speed comparison of util.format vs array.join vs string concatenation in node version 0.12.2
var util = require('util');
var winston = require('winston');
for (var runs = 0; runs < 100; runs++) {
winston.profile('utilformat');
var output = "";
for (var i = 0; i < 10000; i++) {
output = util.format('%s: %d: %d: %d: %s: %s', 'testing', i, i, i, 'another', 'once more');
}
winston.profile('utilformat');
@edsykes
edsykes / gist:c82e1a54a8ccbde06ec9
Created July 21, 2015 16:18
kill all java processes running on port 9000
lsof -i -n -P | grep "java.*9000" | cut -c 11-16 | uniq | kill $(xargs)
@edsykes
edsykes / gist:8ebcbf93588277eb4f40
Created June 10, 2015 15:28
kill all processes listening to 5900-5909
lsof | grep "590.* (LISTEN)" | cut -c 12-16 | uniq | kill $(xargs)
@edsykes
edsykes / gist:04fe7951a7e08fcec417
Created June 5, 2015 17:05
find the index where a value would be inserted in a reverse sorted array
var reverseSortedIndex = function(array, value, predicate){
var result = -1;
var low = 0;
var high = array.length;
var current = 0;
var search = value;
while(low < high){
// uncomment these lines if you want to see how this algorithm works
//console.log('');
@edsykes
edsykes / gist:a422ec420558879a2f42
Created November 27, 2014 01:04
better shadow when you have alpha in source image
<filter x="-70%" y="-50%" id="drop-shadow" height="250%" width="380%">
&gt;<feComponentTransfer xmlns="http://www.w3.org/2000/svg">
<feFuncA type="linear" slope="10.7"></feFuncA><feFuncR type="linear" slope="-10"></feFuncR>
<feFuncG type="linear" slope="0">
</feFuncG>
<feFuncB type="linear" slope="0"></feFuncB>
</feComponentTransfer>
<feGaussianBlur stdDeviation="15"></feGaussianBlur>
@edsykes
edsykes / gist:ab6365d7d595846be564
Last active August 29, 2015 14:10
nice blur effect
<filter x="-50%" y="-50%" id="drop-shadow" height="250%" width="380%">
<feGaussianBlur in="SourceAlpha" stdDeviation="10" result="blur"></feGaussianBlur>
<feOffset in="blur" dx="0" dy="0" result="offsetBlur"></feOffset>
<feMerge>
<feMergeNode in="offsetBlur"></feMergeNode>
<feMergeNode in="SourceGraphic"></feMergeNode>
</feMerge>
</filter>
@edsykes
edsykes / gist:e9d29c1d9bbfa983376b
Created November 26, 2014 22:42
Simple SVG flood example
<svg>
<defs>
<filter id="flood-1">
<feFlood x="30" y="30" width="30" height="30" flood-color="#00f" result="flood"/>
</filter>
</defs>
<circle cx="50" cy="50" r="50" fill="#0f0" filter="url(#flood-1)" />
</svg>
Verifying that +edsykes is my openname (Bitcoin username). https://onename.io/edsykes