Skip to content

Instantly share code, notes, and snippets.

View andris9's full-sized avatar
🇪🇪

Andris Reinman andris9

🇪🇪
View GitHub Profile
@andris9
andris9 / config.js
Created September 20, 2016 13:07
Ghost@Zone
// # Ghost Configuration
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment.
// Configure your URL and mail settings here
production: {
url: 'http://ghost.tahvel.info',
@andris9
andris9 / session.js
Created September 22, 2016 12:49
Simple in-memory session handler
/* eslint-env es6 */
'use strict';
const EventEmitter = require('events');
const crypto = require('crypto');
class Session extends EventEmitter {
constructor() {
super();
@andris9
andris9 / master.html
Created September 28, 2016 09:46
tick on every 50ms
<script>
let myWorker = new Worker('worker.js');
let prev = Date.now();
myWorker.onmessage = function(e) {
let now = Date.now();
console.log(now - prev);
prev = now;
}
</script>
First name Last name Email Phone Website Glass is half full Glass is half empty
Coty Harris [email protected] 694-013-6325 x7388 https://www.google.com/search?q=test1 Yes No
Mauricio Quitzon [email protected] 966.405.4548 x0839 https://www.google.com/search?q=test2 No true
Brody Bradtke [email protected] 1-979-543-4229 https://www.google.com/search?q=test3 false yes
Rusty Altenwerth [email protected] (374) 648-7517 x8968 https://www.google.com/search?q=test4 Yes 0
Tiffany Runolfsdottir [email protected] 808.105.1813 x577 https://www.google.com/search?q=test5 false true
Neha Emmerich [email protected] 1-760-394-7586 x760 https://www.google.com/search?q=test6 1
@andris9
andris9 / config.json
Created February 14, 2017 08:00
ZoneMTA DKIM plugin example
{
"plugins": {
"dkim": {
"enabled": "sender",
"domain": "example.com",
"selector": "test",
"path": "/path/to/private/key.pem"
}
}
}
@andris9
andris9 / index.md
Last active August 8, 2024 19:06
Retrieve UDP logs from ZoneMTA

Step 1. Install MessagePack module

ZoneMTA emits logs over UDP in MessagePack format, so a MessagePack parser is needed to read log messages

npm install msgpack-js

Step 2. Update MTA config

Edit your ZoneMTA application config to activate remote UDP logging. Add remote to the log section. Port and host should point to the server where logger.js app is running.

@andris9
andris9 / authplugin.toml
Last active May 11, 2022 06:25
zonemta authentication
# store to config/plugins/authplugin.toml
[authplugin]
enabled="receiver"

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@andris9
andris9 / customrouter.js
Created March 29, 2018 07:10
Custom routing plugin
// store as plugins/customrouter.js
'use strict';
module.exports.title = 'Custom router';
module.exports.init = function(app, done) {
// Set up custom MX for a delivery
app.addHook('sender:fetch', (delivery, next) => {
delivery.mx = [{
priority: 0,
@andris9
andris9 / forwarder.js
Last active February 13, 2024 07:33
Process emails without data loss
'use strict';
// $ npm install nodemailer mailsplit libmime
// $ node forwarder.js
const nodemailer = require('nodemailer');
const mailsplit = require('mailsplit');
const libmime = require('libmime');
const Transform = require('stream').Transform;