2022-09-21

estimate-sol

Hoy publiqué una herramienta open-source que sirve para medir el tamaño de contratos de solidity. Está en pypi, y podés instalarla corriendo pip install estimate-sol. Este es el uso:

$ estimate-sol -h
usage: estimate-sol [-h] [--punctuations] [--encoding ENCODING] [--dependencies-multiplier DEPENDENCIES_MULTIPLIER]
[--assembly-multiplier ASSEMBLY_MULTIPLIER] [--week-size WEEK_SIZE] [-a] [-V]
files [files ...]

Estimate solidity audit sizes.

positional arguments:
files Files to be audited.

optional arguments:
-h, --help show this help message and exit
--punctuations, -p Use punctuations for counting (default: lines)
--encoding ENCODING, -e ENCODING
File encoding (default=utf-8).
--dependencies-multiplier DEPENDENCIES_MULTIPLIER, -d DEPENDENCIES_MULTIPLIER
Multiplier to estimate non-audited dependencies (default=1.0).
--assembly-multiplier ASSEMBLY_MULTIPLIER
Multiplier to estimate assembly code (default=1.0).
--week-size WEEK_SIZE, -w WEEK_SIZE
Number of items to audit per week. Defaults: (lines:1.0, punct:1.0)
-a, --absolute_paths Show all paths as absolute (by default relative paths are shown if inside current directory).
-V, --version show program's version number and exit
Y podés ver el anuncio original acá.

2022-09-09

chromium en snap via ssh

Me conecto a una VM por ssh, forwardeando X (ssh -X).

Instalo el snap de chromium (sudo snap install chromium).

Lo corro, y me da este error.

$ chromium
X11 connection rejected because of wrong authentication.
[2050513:2050513:0909/155104.874445:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY
[2050513:2050513:0909/155104.874518:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.
[1]+  Done                    XAUTHORITY=$HOME/.Xauthority chromium

Para arreglar el problema hay que setearle la variable de entorno de XAUTHORITY (¿por qué?).

Lo corro así y problema solucionado.

$ XAUTHORITY=$HOME/.Xauthority chromium