Skip to content

Instantly share code, notes, and snippets.

View vstakhov's full-sized avatar

Vsevolod Stakhov vstakhov

  • Cambridge, UK
  • 04:50 (UTC)
View GitHub Profile
server {
listen <hidden>:443 ssl spdy;
listen [2a01:4f8:191:22a6::97]:443 ssl spdy;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options SAMEORIGIN;
add_header X-XSS-Protection "1; mode=block";
ssl on;
ssl_certificate /etc/ssl/certs/rspamd.com.ec.pem;
ssl_trusted_certificate /etc/ssl/certs/rspamd.com.ec.pem;
Index: route.c
===================================================================
--- route.c (revision 273822)
+++ route.c (working copy)
@@ -1535,7 +1535,10 @@
if ((rlen = write(s, (char *)&m_rtmsg, l)) < 0) {
if (errno == EPERM)
err(1, "writing to routing socket");
- warn("writing to routing socket");
+ else if (errno == ESRCH)
static int sslIdx() {
static int idx = -1;
if (idx == -1) {
idx = SSL_get_ex_new_index(0,
reinterpret_cast<void *>(const_cast<char *>("openssl sucks")),
NULL, NULL, NULL);
}
return idx;
rspamd_config.CHINA_MAIL = function(task)
local parts = task:get_text_parts()
if parts then
for _,p in ipairs(parts) do
local l = p:get_language()
if l and l == 'han' then
return true
end
end
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <sys/mman.h>
#include <unistd.h>
#include <time.h>
#include <arpa/inet.h>
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
Index: ifconfig.c
===================================================================
--- ifconfig.c (revision 277757)
+++ ifconfig.c (working copy)
@@ -141,6 +141,100 @@
exit(1);
}
+static void
+calcorders(struct ifaddrs *ifa, int *orders, int cnt)
Index: af_inet6.c
===================================================================
--- af_inet6.c (revision 277757)
+++ af_inet6.c (working copy)
@@ -167,6 +167,34 @@
}
static void
+in6_print_scope(uint8_t *a)
+{
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <string.h>
#include <xfs/xfs.h>
int
main(void)
{
@vstakhov
vstakhov / rspamd.com.sh
Created April 18, 2015 18:49
git post-receive hook
#!/bin/sh
HOME=/home/cebka
GIT_REPO=$HOME/rspamd.com.git
TMP_GIT_CLONE=/tmp/rspamd.com
PUBLIC_WWW=$HOME/rspamd.com
RSPAMD_REPO=$HOME/rspamd.git
TMP_RSPAMD=/tmp/rspamd
SED_SCRIPT="sed -e 's|^~~~\([a-zA-Z].*\)$|{% highlight \1 %}|' -e 's|^~~~$|{% endhighlight %}|' -e 's/.md)/.html)/g'"