Source SO
Reuiqures: node-ffi
// handle parent death
(function(){
| /* | |
| * Strip unwanted HTML tags and unwanted attributes | |
| */ | |
| limitHTML = function(html){ | |
| var re = new RegExp("^(a|b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3||i|img|li|ol|p|pre|sup|sub|strong|strike|ul|br|hr)$"), | |
| attribs = { | |
| "img": new RegExp("^(src|width|height|alt|title)$"), | |
| "a": new RegExp("^(href|title)$") | |
| } | |
| var EventEmitter = require('events').EventEmitter, | |
| sys = require('sys'); | |
| this.Base64Stream = function(){ | |
| EventEmitter.call(this); | |
| this.current = ""; | |
| } | |
| sys.inherits(this.Base64Stream, EventEmitter); |
| var | |
| nodemailer = require('./extlib/andris9-Nodemailer-1034ae8/lib/mail'); | |
| if(true){ | |
| /* | |
| nodemailer.SMTP = { | |
| host: "localhost", | |
| port: 25, | |
| use_authentication: false, | |
| }*/ |
| var https = require('https'), | |
| fs = require('fs'), | |
| utillib = require('util'); | |
| var options = { | |
| key: fs.readFileSync('private_key.pem'), | |
| cert: fs.readFileSync('certificate.pem'), | |
| ca: [ | |
| fs.readFileSync('ESTEID-SK 2007.PEM.cer'), | |
| fs.readFileSync('ESTEID-SK.PEM.cer'), |
| function SimpleAJAX(url, body, callback){ | |
| if(!callback && typeof body=="function"){ | |
| callback = body; | |
| body = undefined; | |
| } | |
| var http = new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP"); | |
| http.open(body?'post':'get', url); |
| #!/bin/sh -e | |
| #git-cache-meta -- simple file meta data caching and applying. | |
| #Simpler than etckeeper, metastore, setgitperms, etc. | |
| #from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694 | |
| #modified by n1k | |
| # - save all files metadata not only from other users | |
| # - save numeric uid and gid | |
| # 2012-03-05 - added filetime, andris9 |
| DKIM | |
| openssl genrsa -out key.txt 768 | |
| openssl rsa -in key.txt -out pub.txt -pubout -outform PEM | |
| DNS | |
| namespace._domainkey.node.ee TXT v=DKIM1;k=rsa;t=s;p=PUBKEY |
| var net = require('net'), | |
| tls = require('tls'), | |
| fs = require("fs"); | |
| var targetHost = "imap.gmail.com", | |
| targetPort = "993", | |
| targetSecure = true, | |
| logfile = "log.txt", | |
| proxyPort = 143; |