sábado, 5 de septiembre de 2020

Radicle: Secure peer-to-peer code collaboration without intermediaries

That's a pretty neat project I've stumbled upon. Radicle.

It tries to do a really distributed code management solution by building upon a few concepts I consider super interesting and rock solid. 

I'm gonna be throwing a few keywords that lighted up when reading about it (they might or might not appear as direct references in radicle's articles).: 

  • Git 
  • Merkle trees 
  • P2P 
  • gossip protocols 
  • IPFS 
  • Scuttlebut 
  • pijul 
  • nix 
  • Rust 

 

That's a lot of cool stuff! I wish I had a bit more time, but lately I'm so much into Red language that I devote 80% of my free time to it. Still learning the basics of its toolchain, but it seems very impressive to me so far.

 

And here is something totally unrelated, but I enjoyed it so much I have to post it somewhere. A reverse engineering video of Contra (NES videogame from the 80's), with explanation of the konami code.

lunes, 20 de julio de 2020

tangling files with org-mode

I've been inspecting this repo https://github.com/kinnala/nixpkgs, and it was the first time I looked at the org tangling. Quite simple to do so:

Mostly using ":mkdirp yes :tangle path", is like doing a "cat block >>path". And you use (org-babel-tangle) as the exporter

#+begin_src elisp :mkdirp yes :tangle ~/.emacs
(org-babel-tangle)
#+end_src

jueves, 16 de julio de 2020

export all variables in bash

If you have a prefix, the coolest way is like the following:

export ${!KONG_*}

If you want everything:

eval $(printenv | awk -F= '{ print "export " $1 }')

miércoles, 8 de julio de 2020

so JIT, WOW

This is so amazing I don't want to lose it:


A Smalltalk-80 VM written in LuaJIT, that boots the images from the eighties:
https://github.com/rochus-keller/Smalltalk#a-smalltalk-80-interpreted-virtual-machine-on-luajit

Approachable tutorial on JITs. The second part talks about metatracing.
https://news.ycombinator.com/item?id=23740655

I recently discovered this guy and he's awesome. Haven't particularly examined this repo, but please, also check out his other stuff.
https://github.com/spencertipping/jit-tutorial

lunes, 29 de junio de 2020

Checking Password Strength in 10 Lines

Talking about dependencies, there's this simple case:

To check password strength, we want different min lenghts for passwords depending if they have lower, upper, numbers, and simbols.

For this, there's passwdqc that allows you to do it in a very simple way,  but, do you really need a library?
Here's the minimalistic implementation I came up with, which I think is pretty decent, and again, has some nice property I can't quite describe.  The code is lua, but it can of course be translated to anything.

It has minimum lenghts for the passwords depending on the amount of different classes of characters it contains. If it only contains 1 type, we don't accept. for 2, minimum length 24,....
   local str = io.read('*l')
   local d = str:match("[0-9]") and 1 or 0
   local down = str:match("[a-z]") and 1 or 0
   local up = str:match("[A-Z]") and 1 or 0
   local s = str:match("[!@#$^&*()_=+-]") and 1 or 0
   local l = #str
   local defs = {math.huge, 24, 11, 9}
   print(d,down,up,s,l,l>=defs[d+down+up+s])

viernes, 26 de junio de 2020

Some Thoughts on Ergonomics and Compression

A recent personal take on ergonomics and compression:

Why is vim so addictive, and somehow it's difficult to explain to non vim fanatics? I think it's a reification of the process of walking through a text file and doing stuff to it. A concrete way to talk about processes onto text files. Some feel it is strictly superior to GUIs because you can get ahold of it. you can write it down, put it in a postcard, and you have a handle to it. You type it again and it works. there's no syntax or fuzziness or stuff that can go wrong (TM).

Next question: Can you ahold an algorithm in your head? in the same concrete way you hold 'yypVr-'?

I'm lately quite interested in Array Languages and I'm reading some snippets of Apl/J/K. And the feeling is the same. Everything else looks so wasteful and error prone like the point-and-click looks to vimmers.

Example:
Shuffling a vector – breaking ⍵ down into ⍺ pieces from which another vector is built by merging. E.g. if is 'abcdefghij' and is 3, the pieces are 'abcd', 'efg', and 'hij', and the result is 'aehbficgjd':

⍵[⍋⍋(⍴⍵)⍴⍳⍺]

The ergonomics are pretty different from what we're used to, but there's definitely an emergent property there. It's not just "it's shorter to type".