Skip to content

Instantly share code, notes, and snippets.

View melvincarvalho's full-sized avatar
💭
I may be slow to respond.

Melvin Carvalho melvincarvalho

💭
I may be slow to respond.
View GitHub Profile
@melvincarvalho
melvincarvalho / openssh.js
Last active August 29, 2015 14:26
covert id_rsa and id_rsa.pub to x509 pem in javascript
var fs = require("fs");
var forge = require('node-forge');
var login = 'melvincarvalho';
var pubkeyfile;
var privkeyfile;
var pemfile;
// command line arguments
<https://melvincarvalho.com/#me> <http://xmlns.com/foaf/0.1/account> <https://github.com/melvincarvalho> .
@melvincarvalho
melvincarvalho / discovery.md
Last active September 25, 2015 10:09
SoLiD Discovery

SoLiD Discovery (Draft)

The following describes discovery in the SoLiD framework using HTTP link following aka "follow your nose".

Starting point -- WebID

The starting point of SoLiD discovery is a WebID user profile, which is a hash based URI, typically denoting a (FOAF) Agent. From this profile all of your storage can be found (discovery).

Storage Discovery

@melvincarvalho
melvincarvalho / hook.json
Created February 7, 2016 20:07
hook.json twtxt
{
"post_tweet_hook": "sleep 1 ; curl -H \"Content-Type: text/plain; charset=UTF-8\" --cert $CERT --key $CERT -X PUT --data-binary @/home/melvin/twtxt.txt https://melvin.databox.me/Public/twtxt/twtxt.txt",
"user": "melvincarvalho",
"twtfile": "/home/melvin/twtxt.txt",
"limit_timeline": "20",
"following": [
{
"user": "twtxt",
"uri": "https://buckket.org/twtxt_news.txt"
}
@melvincarvalho
melvincarvalho / solidauth.md
Last active February 9, 2016 00:25
Solid Auth

What I think would be helpful would be a table of auth mechanisms, something like:

This table should be used as a rough guide, not as black and white

Name URI used Verification Required Implemented
WebID TLS WebID TLS Y Y
Cookie implied Shared Secret Y Y
WebID RSA WebID Web Crypto API N Y
HTTP Signatures Public Key Web Crypto API N N
@melvincarvalho
melvincarvalho / hn.js
Last active October 10, 2016 23:40
hn.js
#!/usr/bin/env node
var debug = require('debug')('hn')
var request = require('request')
debug('starting hn')
var config = {}
config.defaultStories = 5

WebID TLS in Chrome/Chromium

  1. allow Key generation in chrome://settings/content chromium-key-generation
  2. register an account that will generate a cert - eg. https://databox.me/ creates user.crt
  3. on OSX
  • Under 'Keychains' on the left, select 'Login' then 'File' > 'Import Items...'
  • Select certificate in 'My Certificates' and set it to Always Trust osx-keychain
@melvincarvalho
melvincarvalho / sshToX509.js
Created February 6, 2018 22:25
sshToX509.js
var fs = require("fs");
var forge = require('node-forge');
var debug = require('debug')('converter');
var BigInteger = forge.jsbn.BigInteger;
// change as necessary
var countryName = 'UK';
var domain = 'http://databox.me/';
var localityName = 'London';
var organizationName = 'databox.me';
@melvincarvalho
melvincarvalho / databox.md
Last active May 2, 2022 18:53
How to get a WebID + TLS account on databox.me
@melvincarvalho
melvincarvalho / databox401.md
Last active February 7, 2018 17:29
How to login via 401 on databox.me

How to login via 401 on databox.me

  1. Go to a URI without access

  2. Login with webid and password