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 / 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
@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 / 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 / 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

<https://melvincarvalho.com/#me> <http://xmlns.com/foaf/0.1/account> <https://github.com/melvincarvalho> .
@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;
@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 / 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'
@nickretallack
nickretallack / test_spkac.sh
Last active January 23, 2018 05:28
This should work, right?
openssl genrsa -out private.pem 4096
openssl spkac -key private.pem > public.spkac
echo "CN=test" >> public.spkac
openssl ca -config openssl.conf -extensions client -spkac public.spkac -out signed.pem -batch
openssl pkcs12 -nodes -export -inkey private.pem -in signed.pem -out cert.p12
# No certificate matches private key