Skip to content

Instantly share code, notes, and snippets.

View AlexxNica's full-sized avatar
🚀

Alexandre Nicastro AlexxNica

🚀
View GitHub Profile
@AlexxNica
AlexxNica / filecoinplus-reference.md
Last active March 22, 2023 22:45
Filecoin Plus reference documentation

Filecoin Plus - Reference

This is a draft while we consolidate information from multiple sources into a single and concise reference document.

Workflows

Common Workflow (Client & Notary)

Client-specific Workflow

  1. DataCap allocation requested
@AlexxNica
AlexxNica / vscode-tips.md
Created March 19, 2023 15:59
VSCode Tips

VSCode Tips

Delete Duplicate Lines

Find: ^(.*)(\r?\n\1)+$

Replace: $1

Remove empty lines

@AlexxNica
AlexxNica / macos-tips.md
Last active March 19, 2023 15:53
macOS Tips

macOS Tips

These are commands and tips from a couple of years ago. Please make sure to do your own research to see if they're still valid and working as intended.

Time Machine

Disable TimeMachine throttling

defaults write com.apple.TimeMachine _DisableThrottling -bool TRUE

Include system files on time machine backups

defaults write com.apple.TimeMachine IncludeSystemFiles -bool TRUE

@AlexxNica
AlexxNica / fvm-deal-making-mvp.md
Created February 21, 2023 01:14
FVM Deal Making MVP

FVM Deal Making MVP

The FVM team is looking for a way to support storage clients being able to upload to a data depot (e.g. some HTTP server like Vercel) that generates a permalink to the CAR file, for SPs to download. The higher-level use case is for a smart contract to be able to create a storage deal (without having to know the SP beforehand). But we could also just do this as separate tool / example.

  • Yes, this is needed for a proof-of-concept / community example to support and e2e workflow of FVM deal making from a smart contract.
  • Yes, it would also do the CAR conversion, so users can just upload data (< 5GiB).
  • Here are some specs for a website + web server:
    • MVP:

Overview

Stakeholders

graph TB
  subgraph Stakeholders
    Notary[Notary]
    Client[Client]
    Root_Key_Holder[Root Key Holder]
@AlexxNica
AlexxNica / array_iteration_thoughts.md
Created January 10, 2020 18:06 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

'use strict';
const originalArray = [1, 2, 3, 4];
const sumArray = (arr: number[], times: number) => {
const totalNumber = Number(arr.join(''));
const numberSummed: number = totalNumber + times;
const arrayAfterSum = numberSummed.toString().split('');
console.log('totalNumber:', totalNumber);
console.log('numberSummed:', numberSummed);
@AlexxNica
AlexxNica / vyos-packet.md
Created February 8, 2018 08:58
Install Vyos on Packet.net

Vyos Install on Packet.net

VyOS defaults to a console rate of “9600”, which is not compliant with packet.net’s SOS. As such, the squashfs image will need to be unpacked, config.boot.default updated to the correct serial number/BAUD rate, and squashfs image recreated.

VyOS 1.8 (stable) or above is required due to the following vyos-legacy/live-initramfs#1 issue where the “fetch” command is ran prior to network loading

#install tools we need
sudo apt update &amp;&amp; sudo apt install squashfs-tools
@AlexxNica
AlexxNica / make-keys.bat
Created January 25, 2018 18:33 — forked from codingoutloud/make-keys.bat
Handy OpenSSL command-line combinations I've used - they might've been hard to find or come up with, so capturing them here.
@echo off
if _%1_==__ goto USAGE
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name"
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint
openssl x509 -in mycert.pem -noout -fingerprint