You can run a secure ad-hoc HTTP server with negligible effort.
sudo apt install -y busybox-static openssl socat
-module(assert_timers). | |
-export([start_trace/0, stop_trace/0]). | |
-export([no_timers/1, has_timer/1]). | |
%% @doc use a dbg handler to track active timers; see http://stackoverflow.com/a/4059587/8446 | |
start_trace() -> | |
ets:new(timer_trace, [public, named_table, bag]), | |
Fun = fun({'trace', Pid, 'call', {erlang, send_after, [Time, Dest, Msg]}} = _Msg, State) -> | |
lager:debug("~p erlang:send_after(~p, ~p, ~p)", [Pid, Time, Dest, Msg]), | |
State; |
CoenraadS.bracket-pair-colorizer | |
vscode-icons-team.vscode-icons | |
ms-vscode.cpptools | |
pgourlain.erlang | |
JakeBecker.elixir-ls | |
rust-lang.rust | |
serayuzgur.crates |
require 'find' | |
VERBOSE = false | |
mp3_files = [] | |
Find.find('.') do |f| | |
if File.extname(f) == '.flac' | |
flac = f | |
mp3 = "../Music/#{File.dirname(flac)}/#{File.basename(flac, '.flac')}.mp3" |
I needed to load-test an HTTP client, so I used nginx. I ran into some limits:
2018/10/17 23:44:09 [alert] 1860#1860: 768 worker_connections are not enough
To get around this, edit /etc/nginx/nginx.conf
and edit the events
section:
events {
worker_connections 5000;
# multi_accept on;
}
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <unistd.h> | |
#include <gnutls/x509.h> | |
#include <assert.h> |
sudo cat /proc/$PID/maps | perl -ne 'print sprintf("%10s", hex($2) - hex($1)), " ", $_ if /([0-9a-f]+)-([0-9a-f]+)/' |
// Problem: | |
// qpidd reports "[System] error SASL layer required!" | |
// amqpnetlite reports: "Authentication failed because the remote party has closed the transport stream." | |
// | |
// Reason: | |
// You're connecting to the plaintext qpidd port, and you don't have SASL configured. | |
// | |
// Solution: | |
// Pass scheme: "amqp" to the Address ctor ----------vvvv | |
var address = new Address("localhost", 5672, scheme: "amqp"); |
lists:sort(fun({_, X}, {_, Y}) -> X > Y end, | |
dict:to_list(lists:foldl( | |
fun(Pid, Dict) -> | |
InitialCall = case erlang:process_info(Pid, initial_call) of | |
{initial_call,{proc_lib,init_p,A}} -> | |
case erlang:process_info(Pid, dictionary) of | |
{dictionary, D} -> proplists:get_value('$initial_call', D, undefined); | |
_ -> {proc_lib,init_p,A} | |
end; | |
{initial_call,{erlang,apply,A}} -> |
function dump(o) { | |
switch (typeof(o)) { | |
case "table": | |
local table = ""; | |
foreach (k, v in o) { | |
if (table != "") { | |
table += ", " | |
} | |
table += dump(k) + ": " + dump(v); | |
} |