Skip to content

Instantly share code, notes, and snippets.

View daapp's full-sized avatar

Alexander Danilov daapp

View GitHub Profile
@daapp
daapp / service.md
Last active September 5, 2025 08:00 — forked from miromannino/service.md
Sample /etc/init.d script

Sample service script for debian/ubuntu/devuan with sysv-rc

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name
@daapp
daapp / smtpd.tcl
Created December 2, 2023 15:14
Quick hack in tcl_smtpd from tcllib to recognize AUTH command.
#!/usr/bin/env tclsh
## -*- tcl -*-
# tcl_smtpd - Copyright (C) 2001 Pat Thoyts <patthoyts@users.sourceforge.net>
### daapp
# Add AUTH PLAIN and AUTH LOGIN recognition. Turn on debug output.
# It is quick hack. For SMTP client testing only.
###
# Simple test of the mail server. All incoming messages are displayed to
# stdout.
#
{-# LANGUAGE OverloadedStrings #-}
module Encoding (convert, Encoding(..))where
import Data.List (elemIndex)
import Data.Maybe (fromMaybe)
data Encoding = CP1251
| KOI8R
cp1251 = "\192\193\194\195\196\197\168\198\199\200\201\202\203\204\205\206\207\208\209\210\211\212\213\214\215\216\217\218\219\220\221\222\223\224\225\226\227\228\229\184\230\231\232\233\234\235\236\237\238\239\240\241\242\243\244\245\246\247\248\249\250\251\252\253\254\255"