Skip to content

Instantly share code, notes, and snippets.

View andris9's full-sized avatar
🇪🇪

Andris Reinman andris9

🇪🇪
View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@andris9
andris9 / authplugin.toml
Last active May 11, 2022 06:25
zonemta authentication
# store to config/plugins/authplugin.toml
[authplugin]
enabled="receiver"
@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 / 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"
}
}
}
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 / 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>
@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 / 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 / install.md
Last active October 18, 2016 12:55
Mailtrain install Zone serveris

Mailtrain install Zone serveris

1. Tekita vajalikud failid

Logi SSH kaudu oma virtuaalhosti sisse ja tekita oma juurkausta (st. see kuhu peale ssh logimist satud, n. /data01/virt12345) allpool näidatud failid mailtrain.json ja mailtrain.toml (viimast faili tuleks enne salvestamist veidi muuta, nimelt tuleks üle vaadata MySQL ja Redis parameetrid vastavalt oma konto seadistusele).

Andmebaasitabeleid seadistada vms. ei ole vaja, seda teeb Mailtrain esimesel käivitusel automaatselt.

2. Lae alla Mailtraini kood

@andris9
andris9 / USAGE.md
Created September 1, 2016 08:43
Replace domain name in Wordpress database dump

wp-domain-change

Simple script to replace domain name in a Wordpress MySQL dump file. In addition to replacing domain names in standard string values, the script is able to correctly replace strings in serialized PHP values. This means that it should be safe to operate on data from wp_options table where plugins store data as serialized PHP

Usage

Run the script from command line. First argument is the domain name to replace and the second is the replacement. SQL dump is read from stdin and written to stdout

node wp-domain-change.js "http://source.domain" "http://dest.domain" < input.sql > output.sql