[root@receiver]# curl -v -O https://example.com/upload/
...
Location: https://example.com/upload/XXXXXX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
portal <- read.table("portal.log", sep="¥t", header=TRUE) | |
portal.sub <- portal[sample(length(portal[,1]), 9000), ] | |
ip.order <- data.frame(median=tapply(portal.sub$us, portal.sub$ip, median)) | |
ip.order$order <- order(ip.order) | |
portal.sub$ip.o <- ip.order[portal.sub$ip, 2] | |
with(portal.sub, cor(us, ip.o, method="spearman")) | |
# 0.5039202 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(bench). | |
-export([run/0]). | |
-define(SEED, {1393,433335,396007}). | |
-define(LENGTH, trunc(math:pow(2, 14))). | |
-define(TIMES, 3). | |
-include_lib("eunit/include/eunit.hrl"). | |
gen() -> | |
random:seed(?SEED), | |
lists:map(fun(_) -> random:uniform() end, lists:duplicate(?LENGTH, 0)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gen(chirp, Options) -> | |
FirstFrequency = proplists:get_value(first_frequency, Options), | |
LastFrequency = proplists:get_value(last_frequency, Options), | |
SamplingFrequency = proplists:get_value(sampling_frequency, Options), | |
Count = proplists:get_value(count, Options), | |
Samples = lists:map(fun(I) -> | |
Frequency = FirstFrequency + (LastFrequency - FirstFrequency) / Count * I, | |
math:sin(2 * math:pi() * Frequency / SamplingFrequency * I) | |
end, | |
lists:seq(1, Count)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(rstats). | |
-export([plot/1]). | |
-define(TMP_FILE, "/tmp/erlstats.data"). | |
-define(R_FILE, "/tmp/erlstats.R"). | |
plot(Points) -> | |
ok = file:write_file(?TMP_FILE, | |
[io_lib:format("~p~n", [X]) || X <- Points], | |
[write]), | |
Rprogram = ["erl <- read.table(\"", ?TMP_FILE, "\")", "\n", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(fir). | |
-export([convolute/2]). | |
convolute_acc(F, G, Acc) when length(F) =:= 2 * length(G) - 1 -> | |
lists:reverse(Acc); | |
convolute_acc(F, G, Acc) -> | |
V = lists:sum(lists:map(fun({A, B}) -> A * B end, | |
lists:zip(lists:sublist(F, length(G)), G))), | |
convolute_acc(tl(F), G, [V | Acc]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(iir). | |
-export([gen_filter/2, filter/3]). | |
-export([loop/4, aggregate_filtered/2, apply_filter/3]). | |
-compile({nowarn_unused_function, [aggregate/1, | |
aggregate_buffered_acc/3, | |
aggregate_buffered/2, | |
aggregate_filtered_acc/3]}). | |
-define(PI, math:pi()). | |
-include_lib("eunit/include/eunit.hrl"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(lcm). | |
-export([start_loop/1, start_loop/0]). | |
-export([loop/5]). | |
cut_off_bucket(Counter, BucketSize) -> | |
Counter2 = lists:filter(fun({_Label, {Count, Bucket}}) -> | |
Count =< BucketSize - Bucket | |
end, | |
Counter), | |
Counter2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(metrics_http). | |
-export([start_loop/1, stop/0]). | |
-export([loop/1]). | |
-export([measure_tat/1]). | |
-export([add/1, update/2]). | |
-export([loop_query/1, start_querier/1, start_querier/0]). | |
-include_lib("eunit/include/eunit.hrl"). | |
-define(CONNECTION_TIMEOUT, 10 * 1000). | |
-define(TIMEOUT, 10 * 1000). | |
-define(USER_AGENT, "MetricsHttp/0.1"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -s | |
use utf8; | |
use strict; | |
use warnings; | |
use Time::HiRes qw( sleep ); | |
use constant LINES_PER_SECOND => 100; | |
our $lps ||= LINES_PER_SECOND; | |
our $h; |
OlderNewer