Skip to content

Instantly share code, notes, and snippets.

View janl's full-sized avatar
🛋️
Drop ICE

Jan Lehnardt janl

🛋️
Drop ICE
View GitHub Profile
@janl
janl / log
Last active August 29, 2015 14:12
> echo '{"a":1}' | ../node_query_server/bin/qs2
net.js:614
throw new TypeError('invalid data');
^
TypeError: invalid data
at WriteStream.Socket.write (net.js:614:11)
at null._onTimeout (/Users/jan/Work/qs2/node_query_server/index.js:17:20)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
- var hash = crypt.createHash('sha256');
- hash.update(assetData);
- return hash.digest('hex');
+ return crypt.createHash('sha256')
+ .update(assetData)
+ .digest('hex');
@janl
janl / secadv_20150319.txt
Created March 19, 2015 14:20
mirror because original at secadv_20150319.txt is slooooow
OpenSSL Security Advisory [19 Mar 2015]
=======================================
OpenSSL 1.0.2 ClientHello sigalgs DoS (CVE-2015-0291)
=====================================================
Severity: High
If a client connects to an OpenSSL 1.0.2 server and renegotiates with an
invalid signature algorithms extension a NULL pointer dereference will occur.

@ppk asks: “OK, suggestions for my next bit of research?” — https://twitter.com/ppk/status/587545743625478144

@rem replies: “@ppk storage. What works in browser, what browsers, what phones, how it changes when *added to home screen", limits, etc. How's that?” — https://twitter.com/rem/status/587566978065367040

Here’s what I whipped up, please add more in the comments:

APIs:

@janl
janl / checkbashisms.log
Last active August 29, 2015 14:23
You had one job
> head -1 configure
#!/bin/sh
> checkbashisms -f configure
> echo $?
0
> head -1 configure
#!/bin/bash
@janl
janl / test.sh
Last active August 29, 2015 14:23
string interpolation / variable substitution
#!/bin/sh -ex
# I have a variable that’s a string, that includes the expansion for another variable, albeit quited: `\${foo}`
# how can I get a string that is that original string, but with the variable expanded?
# no bashisms allowed, this needs to be stock-sh.
var1=foo
var2=\${var1}/bar
# insert magic here
This file has been truncated, but you can view the full file.
12006 silly gunzTarPerm extractEntry LICENSE
12007 silly gunzTarPerm extractEntry writable.js
12008 silly install resolved []
12009 verbose about to build /usr/local/lib/node_modules/hoodie-cli/node_modules/insight/node_modules/request/node_modules/qs
12010 info build /usr/local/lib/node_modules/hoodie-cli/node_modules/insight/node_modules/request/node_modules/qs
12011 silly gunzTarPerm extractEntry index.js
12012 silly gunzTarPerm extractEntry test.js
12013 info preinstall minimist@0.0.10
12014 silly gunzTarPerm extractEntry LICENSE
12015 silly gunzTarPerm extractEntry writable.js
var till = "awesome";
fun({Doc}) ->
case {proplists:get_value(<<"id">>, Doc)} of
{undefined} ->
ok;
{Id} ->
Emit(Id, Doc);
_ ->
ok
end
end.
> rake
(in /Users/jan/Work/mustache.js)
..FFFFFFFFFFFF....FFF.F.FFFFFFFFFF.F.FFFFFFFFFFFFFFFFFFF
1)
'mustache array_of_strings should generate the correct html' FAILED
expected: "hello world \n",
got: "\n hello world \n" (using ==)
./test/mustache_spec.rb:71: