Skip to content

Instantly share code, notes, and snippets.

View moisseev's full-sized avatar
:octocat:
🎖🎖🎖

Alexander Moisseev moisseev

:octocat:
🎖🎖🎖
View GitHub Profile
@moisseev
moisseev / cached_interactive.diff
Created March 18, 2018 18:57
Cache interactivity checks in rspamd_stat
diff --git a/utils/rspamd_stats.pl b/utils/rspamd_stats.pl
index 3a8affce1..a8d65e36b 100755
--- a/utils/rspamd_stats.pl
+++ b/utils/rspamd_stats.pl
@@ -81,6 +81,7 @@ my %scanTime = (
total => 0,
);
my %bidir_match;
+my %fh_cache; # Cache for sub interactive
@moisseev
moisseev / .git-commit-template.txt
Created March 9, 2018 10:13
git hook which adds the value of GH_TAGNAME from Makefile to a commit message
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
#Update to [GH_TAGNAME]
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
@moisseev
moisseev / wmi-memory.cmd
Last active November 8, 2017 08:14
Munin Node for Windows external plugin - Physical memory and paging file usage
@echo off
rem Munin Node for Windows external plugin wrapper
rem Low physical memory warnings
rem
rem The default thresholds (usage in percents) are warning=80 critical=90 .
rem Set environment variables as shown below to override the defaults.
rem
rem set mem_used.warning=80
@moisseev
moisseev / bl-asn.map
Last active January 10, 2020 08:13
ASN and IP blacklists using multimap. OBSOLETE, up-to-date example: https://github.com/moisseev/rspamd-multimap-bl
16276 # OVH
44493 # Chelyabinsk-Signal
46606 # UNIFIEDLAYER-AS-1
48666 # MAROSNET Telecommunication Company Network
49505 # SELECTEL-NET
133165 # DIGITALOCEAN
201229 # DIGITALOCEAN
202018 # DIGITALOCEAN
200130 # DIGITALOCEAN
21100 # ITLDC-NL (UA)
@moisseev
moisseev / vss_mirror.cmd
Created November 7, 2016 15:05
On-the-fly Windows directory mirroring using VSS snapshot with ShadowSpawn and robocopy
@echo off
rem On-the-fly Windows directory mirroring using VSS snapshot
rem with ShadowSpawn (https://github.com/candera/shadowspawn) and robocopy
rem This script mirrors SRC directory contents into DST directory
set SHADOWSPAWN="C:\Program Files\ShadowSpawn\ShadowSpawn.exe"
@moisseev
moisseev / Postfix-SASL-client.md
Last active October 28, 2022 09:15
Replacing the default FreeBSD system mailer Sendmail with Postfix using SMTP AUTH, acting as mail client

Replacing the default FreeBSD system mailer Sendmail with Postfix using SMTP AUTH, acting as mail client

Replacing Sendmail with Postfix

# pkg install postfix-sasl1

Would you like to activate Postfix in /etc/mail/mailer.conf [n]? y2

# service sendmail stop

@moisseev
moisseev / dkim-test.sh
Last active March 17, 2017 05:48
Check DKIM signatures of messages stored in a Maildir
#!/bin/sh
MAILDIR="/vmail/example.com/test/Maildir"
DIR_BAD="$MAILDIR/.dkim_bad/new"
DIR_GOOD="$MAILDIR/.dkim_good/new"
DIR_NO_SIG="$MAILDIR/.dkim_no_sig/new"
#-------------------------------
@moisseev
moisseev / TB_Chat_auth.md
Last active September 16, 2022 15:05
Using Thunderbird's Chat to connect to IRC servers requiring authentication

There are two ways to authenticate on IRC server:

  1. Identify nick with NickServ;
  2. Using the PASS command in the IRC protocol (not supported in the Thunderbird UI).

If your server or bouncer requires [2], set the following preferences as string values:

messenger.account.accountN.options.serverPassword
messenger.account.accountN.options.username
@moisseev
moisseev / 01-overview.jpg
Last active June 13, 2016 11:57
How to install 2.5" HDD/SSD into 3.5" hot-swap bay.
01-overview.jpg
@moisseev
moisseev / patch-source3_modules_vfs__shadow__copy2.c
Last active May 16, 2017 13:31
[partial fix] CVE-2015-5299 denies access to ZFS snapshots due to overly strict condition checking (the patch is against Samba 4.4.13)
--- source3/modules/vfs_shadow_copy2.c.orig 2017-04-02 08:19:24 UTC
+++ source3/modules/vfs_shadow_copy2.c
@@ -1533,7 +1533,7 @@ static bool check_access_snapdir(struct
&smb_fname,
false,
SEC_DIR_LIST);
- if (!NT_STATUS_IS_OK(status)) {
+ if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
DEBUG(0,("user does not have list permission "
"on snapdir %s\n",