Skip to content

Instantly share code, notes, and snippets.

View kav2k's full-sized avatar

Alexander Kashev kav2k

  • DSL, University of Bern
  • Bern, Switzerland
  • X @kav2k
View GitHub Profile
@kav2k
kav2k / not-spam.md
Last active December 18, 2017 21:04
Short intro to convincingly telling other mail servers "I'm not a spammer, honest!"

First off, I would like to apologize if any of the information presented here comes off as obvious and an insult to anyone's intelligence / knowledge. This is not the intention by any stretch — I simply have to go on no assumptions of relevant knowledge and as such try to explain, at least briefly, most concepts involved.

So, how does sending mail between servers actually work? The sending server (acting as a Mail Transfer Agent, or MTA) connects to another MTA using SMTP (Simple Mail Transfer Protocol). The negotiation starts by a EHLO command where the sender tells the receiver its identity, and then tells what "From" address it's sending for.

In case of your server, it says:

"Hello, I'm server.example.net, and I'm sending mail on behalf of admin@example.org"

Generally, the receiver doesn't have a confirmation (from this connection alone) to go along with this; all it sees from the connection is the IP of the sender (in your case, 11.22.33.44).

@kav2k
kav2k / .eslintrc.json
Last active September 9, 2017 21:19
My usual linter configuration (for browser extensions)
{
"env": {
"browser": true,
"webextensions": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
// Allow console
"no-console": "off",
@kav2k
kav2k / .bash_prompt
Last active May 14, 2019 15:04
My personal Bash prompt template
# My personal bash prompt template
# (c) Alexander Kashev, 2017-2019
# To use, copy to home and add to .bashrc:
#
# if [ -f $HOME/.bash_prompt ]; then
# # For cluster machines: appends suffix if short hostname not equal to it
# PS1_CLUSTER_NAME=''
# . $HOME/.bash_prompt
# fi

Keybase proof

I hereby claim:

  • I am kav2k on github.
  • I am xan (https://keybase.io/xan) on keybase.
  • I have a public key whose fingerprint is 26A1 F3B5 40E3 7E09 AE2D 7446 7682 C236 DA8C 7215

To claim this, I am signing this object:

// April Fools '11
// From dA Message Notifier
function romanize(input) {
var output = input;
output = output.toUpperCase();
output = output.replace(/J/g,'I');
output = output.replace(/U/g,'V');
//output = output.replace(/W/g,'VV');
output = output.replace(/([0-9]+)/g, romanNumeral);
@kav2k
kav2k / gist:8e43cc175ec6301b61b3
Created January 5, 2015 18:05
Mare Internum RSS autodicovery tag
<!-- This goes into the head of every comic page / main page -->
<link rel="alternate" type="application/rss+xml" title="Mare Internum RSS" href="/feed">
function sanitize(str){
str = str.replace(/[<>:?*"\/\\|]/, "_", "g");
str = str.replace(/^(CON|PRN|AUX|NUL|COM\d|LPT\d)$/, "_", "i");
str = str.replace(/[. ]+$/, "_");
return str;
}
var openPorts = ( function() {
var index = 0;
var ports = {};
var op = {
getPorts: function() {
var result = {};
for(var id in ports){
result[id] = ports[id];
}
return result;
@kav2k
kav2k / button_interrupt.ino
Last active December 31, 2015 20:19
This sketch demonstrates how to set up and use Pin Change Interrupt to catch button presses on BlinkyTape.
// Example sketch for using interrupt-based button press detection
// It will check button state every 500ms and display it along with the push count
// It also sends this information over serial
#include <FastSPI_LED2.h>
#define LED_COUNT 60
struct CRGB leds[LED_COUNT];
#define LED_OUT 13
@kav2k
kav2k / holiday.ino
Last active December 31, 2015 06:09 — forked from Threeethan/gist:7938597
// This is the example sketch that gets loaded on every BlinkyTape during production!
#include <FastSPI_LED2.h>
#include <Animation.h>
#define LED_COUNT 60
struct CRGB leds[LED_COUNT];
#ifdef REVB // RevB boards have a slightly different pinout.