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 / post to ldpc and acl
Created February 1, 2015 10:18
post to ldpc and acl
# init
#LDPC="https://localhost:8888/test/put/"
#LDPC="https://melvin.rww.io/workspace/blog/ch5/"
LDPC=$(git config webid.weblog)
KEYFILE=$(git config webid.keyfile)
WEBID=$(git config user.webid)
NAME=$(git config user.name)
DEPICTION=$(git config user.depiction)
USER_AGENT='User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/39.0.2171.65 Chrome/39.0.2171.65 Safari/537.36'
@melvincarvalho
melvincarvalho / log.js
Last active August 29, 2015 14:14
log gitter to file and ldp
var https = require('https');
var fs = require('fs');
var roomId = process.env.ROOM_ID;
var token = process.env.TOKEN;
var heartbeat = " \n";
console.log('logging room : ' + roomId);
var gitter = {
@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
@melvincarvalho
melvincarvalho / publickey.js
Last active August 29, 2015 14:26
convert openssh id_rsa.pub to modulus and exponent
#!/usr/bin/env node
// requires
var forge = require('node-forge');
var fs = require("fs");
// init
var sshpubkey = {};
var pubkey;
<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