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 / .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
@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",

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:

@kav2k
kav2k / godville.user.js
Last active June 7, 2016 13:07
A quick'n'dirty fix for current chat CSS problems at godville.net (Chrome)
// ==UserScript==
// @name Godville chat fix (Chrome)
// @version 1.1
// @namespace tag:Xanos
// @description Fixes wraparound in Godville chat
// @include http://godville.net/*
// @include https://godville.net/*
// ==/UserScript==
document.styleSheets[0].insertRule('.fr_msg_l { white-space:normal !important; }', 0);
// 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 / 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.
@kav2k
kav2k / g3sub.pl
Last active December 29, 2015 06:09
Gamers 3 subtitle translation converter. Usage: 1) Download the worksheet as plain text (will result in a TSV, Tab-Separated Values file) 2) Feed the file, with the column name containing the required language, to the script, example: `perl g3sub.pl E < worksheet.tsv > subtitles.srt` will produce English subtitles
#!perl -w
#
# Gamers 3 Subtitle File processing
# (c) Alexander Kashev, 2013
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
@kav2k
kav2k / godville_chat_fix.css
Created April 29, 2013 14:17
CSS file for Godville chat fix
.fr_msg_l { white-space:normal !important; }