Skip to content

Instantly share code, notes, and snippets.

View SaveTheRbtz's full-sized avatar

Alexey Ivanov SaveTheRbtz

View GitHub Profile
@SaveTheRbtz
SaveTheRbtz / boringssl.diff
Last active May 6, 2019 22:55
Re-enable AVX2/SHA extensions that were disabled after OpenSSL->BoringSSL fork.
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index 73db3c2b..ab517119 100755
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -84,8 +84,8 @@ die "can't locate x86_64-xlate.pl";
# output, so this isn't useful anyway.
#
# TODO(davidben): Enable these after testing. $avx goes up to 2 and $addx to 1.
-$avx = 0;
-$addx = 0;
@SaveTheRbtz
SaveTheRbtz / userspaceswap.c
Last active December 5, 2016 22:20
Ugly hack to redirect all malloc calls to a mmap(2)'ed file.
/*
* Redirect malloc(3) calls to a mmap(2)'ed file.
*
* Example of usage:
* $ cc -shared -o userspaceswap.dylib ./userspaceswap.c && \
* DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=./userspaceswap.dylib ffmpeg
*/
#include <dlfcn.h>
#include <errno.h>
@SaveTheRbtz
SaveTheRbtz / ip_vs_sch.c
Last active July 12, 2018 12:01
Consistent source hashing scheduler for IPVS (SH-derivative, GPL)
/*
* IPVS: Source Consistent Hashing scheduling module
*
* Authors: Jonathan Lee <jonlee@dropbox.com>
*
* Changes:
*
*/
#define KMSG_COMPONENT "IPVS"
@SaveTheRbtz
SaveTheRbtz / init.c
Created October 4, 2016 01:02 — forked from rofl0r/init.c
minimal init daemon by rich felker, author of musl libc
#define _XOPEN_SOURCE 700
#include <signal.h>
#include <unistd.h>
int main()
{
sigset_t set;
int status;
if (getpid() != 1) return 1;
@SaveTheRbtz
SaveTheRbtz / keybase.md
Created September 20, 2016 06:31
keybase.md

Keybase proof

I hereby claim:

  • I am savetherbtz on github.
  • I am savetherbtz (https://keybase.io/savetherbtz) on keybase.
  • I have a public key ASCGtsoiMtRWkLHGrOq-_5DL-i1kI5X0R-QwYn6FHG6w-Qo

To claim this, I am signing this object:

#!/bin/bash
while read line; do
if [ "${line//END}" != "$line" ]; then
txt="$txt$line\n"
printf -- "$txt" | openssl x509 -subject -issuer -noout
txt=""
else
txt="$txt$line\n"
fi
done < $@
/*
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2010 Luis R. Rodriguez <lrodriguez@atheros.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#!/bin/bash
#
# https://www.redhat.com/archives/rhl-list/2007-September/msg03735.html
# https://github.com/hiboma/hiboma/blob/master/kernel/net/softnet_stat.md
#
cmd="${0##*/}"
usage() {
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 615b20b..12f4c26 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -924,6 +924,7 @@ struct netns_ipvs {
int sysctl_nat_icmp_send;
int sysctl_pmtu_disc;
int sysctl_backup_only;
+ int sysctl_tun_src_client_copy;
@SaveTheRbtz
SaveTheRbtz / README
Last active November 25, 2016 14:29
Locality-Based Least-Connection Scheduling module for nginx
Locality-based Least connection scheduling module for nginx.
Based on logic[1] from IPVS lblc module.
[1] http://kb.linuxvirtualserver.org/wiki/Locality-Based_Least-Connection_Scheduling
Configuration directives:
lblc