Mou, the missing Markdown editor for web developers.
# read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
# your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
# $ nginx -c /etc/nginx/nginx.conf -t | |
server { | |
# public key, contains your public key and class 1 certificate, to create: | |
# (example for startssl) | |
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769
Note the running on port
for epmd
itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:
$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
#!/usr/bin/env escript | |
-module(dist). | |
-compile([export_all]). | |
% optimized combinators | |
int(true) -> 1; | |
int(_) -> 0. | |
rev(L) -> lists:reverse(L). | |
rtr(L) -> rev(tl(rev(L))). |
<html> | |
<head> | |
<style> | |
#canvas { | |
width:100%; | |
} | |
</style> | |
</head> | |
<body> | |
<canvas id="canvas" width="800" height="600" resize /> |
function functionReplacer(key, value) { | |
if (typeof(value) === 'function') { | |
return value.toString(); | |
} | |
return value; | |
} | |
function functionReviver(key, value) { | |
if (key === "") return value; | |
-module(pipe). | |
-compile(export_all). | |
parse_transform(Forms, Options) -> | |
Forms2 = replace(Forms), | |
io: format("~p~n", [Forms2]), | |
Forms2. | |
replace({lc, Line, {atom, Line2, '|>'}, Path}) -> | |
pipe(Path); |
-define(IS_ALPHA(C), | |
(C =:= $a) or (C =:= $b) or (C =:= $c) or (C =:= $d) or (C =:= $e) or | |
(C =:= $f) or (C =:= $g) or (C =:= $h) or (C =:= $i) or (C =:= $j) or | |
(C =:= $k) or (C =:= $l) or (C =:= $m) or (C =:= $n) or (C =:= $o) or | |
(C =:= $p) or (C =:= $q) or (C =:= $r) or (C =:= $s) or (C =:= $t) or | |
(C =:= $u) or (C =:= $v) or (C =:= $w) or (C =:= $x) or (C =:= $y) or | |
(C =:= $z) or | |
(C =:= $A) or (C =:= $B) or (C =:= $C) or (C =:= $D) or (C =:= $E) or | |
(C =:= $F) or (C =:= $G) or (C =:= $H) or (C =:= $I) or (C =:= $J) or | |
(C =:= $K) or (C =:= $L) or (C =:= $M) or (C =:= $N) or (C =:= $O) or |
The intention of this post is to provide a solution (with examples) to a somewhat uncommon issue in Erlang. I hate searching for answers to the same problems over and over, and I had a hard time finding answers to this particular problem, so I wrote it all down once I figured it out. If one day you decide to read and write data through fifo's (named pipes) and then decide you want to read or write the other end of the pipe from Erlang, this post is for you.
I wanted to read and write to a fifo from a C/C++ app and have an Erlang app communicate over the other end of that fifo. Put simply, Erlang doesn't really support what I was trying to do. You cannot just file:open/2
a fifo, or any special device for that matter, in Erlang and expect it to work. This is documented in Erlang's FAQ.
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Updated: 2010/12/05 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it) | |
// | |
// Permission is hereby granted, free of charge, to any person |