Skip to content

Instantly share code, notes, and snippets.

-module(stacktrace_filter).
-compile(export_all).
t() ->
try
sensitive_data_function()
catch
Error:Reason ->
{Error, Reason, erlang:get_stacktrace()}
end.
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad
20:37:37 ((detached from origin/develop)) ~/eth/cpp/webthree-umbrella/build
./libethereum/test/testeth -t StateTests/userDefinedFileState --singletest /home/gs/eth/tests/StateTests/stCallCreateCallCodeTest.json createNameRegistratorPreStore1NotEnoughGas --sealengine Homestead --vmtrace --verbosity 13
Running 1 test case...
ℹ 20:37:47.714|testeth Testing user defined test: /home/gs/eth/tests/StateTests/stCallCreateCallCodeTest.json
Test Case "userDefinedFileState":
100%
ℹ 20:37:47.763|testeth createNameRegistratorPreStore1NotEnoughGas
EVM 20:37:47.808|testeth
STACK
MEMORY
StateTest: createNameRegistratorPreStore1NotEnoughGas
VM STAT 24 OPs
PC 00000000: PUSH32 GAS: 55268 COST: 3
STACK = 0
MEM = 0
STORAGE = 0
PC 00000033: PUSH1 GAS: 55265 COST: 3
STACK = 1
0000: 6001600155601080600c6000396000f3006000355415600957005b6020356000
decode(Segment) ->
case Segment of
<< SourcePort:16, DestinationPort:16,
SequenceNumber:32,
AckNumber:32,
DataOffset:4, _Reserved:4, Flags:8, WindowSize:16,
Checksum:16, UrgentPointer:16,
Payload/binary>> when DataOffset>4
->
OptSize = (DataOffset - 5)*32,
%%%============================================================================
-spec bin_to_hexdigest(binary()) -> binary().
bin_to_hexdigest(Bin) when is_binary(Bin) ->
<<<<(binary:list_to_bin(
case length(S = integer_to_list(I, 16)) of 1 -> [48|S]; 2 -> S end
))/bytes>> || <<I>> <= Bin>>.
-spec hexdigest_to_bin(binary()) -> binary().
hexdigest_to_bin(BinHex) when is_binary(BinHex) ->
-module(crack).
-export([crack/0]).
-compile(export_all).
-define(CHAR_LIST, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW").
crack() ->
TryLength = 5,
MD5Hash = crypto:md5("12345"),
@Gustav-Simonsson
Gustav-Simonsson / gist:4564450
Created January 18, 2013 13:07
migrate_module
migrate_module(Module, Function, Arity, RemoteNode) ->
%% Assume Arity is 2, general arity solution needed.
RPCFun = fun(Arg1, Arg2) ->
rpc:call(RemoteNode, Module, Function, [Arg1, Arg2]) end,
meck:new(Module),
meck:expect(Module, Function, RPCFun).
@Gustav-Simonsson
Gustav-Simonsson / gist:4564310
Created January 18, 2013 12:35
migrate with rpc
5> el_pl:is_sublist([apa], [apa, varg]).
true
6> meck:new(el_pl).
ok
7> meck:expect(el_pl, is_sublist, fun(List1, List2) ->
rpc:call('nodeattmigreratill@vargarna.nu', el_pl, is_sublist, [List1, List2]) end).
ok
8>
// WARNING: WORK IN PROGRESS & UNTESTED
//
// @AUTHORS: Gustav Simonsson <gustav@ethdev.com>
// @DATE: 2015-10-30
// @VERSION: 0.1
// @LICENSE: GNUBL 2.0 (https://github.com/Gustav-Simonsson/GNUBL/blob/master/LICENSE)
//
// contract tracking versions added by designated signers.
// designed to track versions of geth (go-ethereum) recommended by the
// go-ethereum team. geth client interfaces with contract through ABI by simply