Skip to content

Instantly share code, notes, and snippets.

View jedisct1's full-sized avatar

Frank Denis jedisct1

View GitHub Profile
@jedisct1
jedisct1 / a.c
Created September 24, 2019 11:23
// Test case for Xcode 11 broken stack alignment
// See https://forums.developer.apple.com/thread/121887
// Compile with cc -mavx -O2 a.c
#include <fcntl.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@jedisct1
jedisct1 / a.diff
Last active September 4, 2019 17:52
diff --git a/src/write/macho.rs b/src/write/macho.rs
index dbbe5df..48f7b6b 100644
--- a/src/write/macho.rs
+++ b/src/write/macho.rs
@@ -137,6 +137,17 @@ impl Object {
let mut strtab = StringTable::default();
let mut symbol_offsets = vec![SymbolOffsets::default(); self.symbols.len()];
let mut nsyms = 0;
+
+ let prefixed_symbols: Vec<_> = self
@jedisct1
jedisct1 / xcode-11b6.c
Created August 26, 2019 13:42
Stack alignment bug in Xcode 11 with AVX optimizations
#include <fcntl.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
typedef struct {
char d[16];
void *e;
struct { char b[5536]; } f;
@jedisct1
jedisct1 / cmake.diff
Created July 23, 2019 20:39
cmake.diff
--- Findsodium.cmake 2019-07-23 22:22:23.000000000 +0200
+++ zok.cmake 2019-07-23 22:22:17.000000000 +0200
@@ -18,7 +18,6 @@
# Once done the following variables will be defined:
#
# sodium_FOUND sodium_INCLUDE_DIR sodium_LIBRARY_DEBUG sodium_LIBRARY_RELEASE
-# sodium_VERSION_STRING
#
# Furthermore an imported "sodium" target is created.
#
@jedisct1
jedisct1 / centos5-docker-dnscrypt-server.sh
Last active June 29, 2019 20:58
dnscrypt server installation on CentOS 5 (Vultr)
#!/bin/sh
yum -y update
# Replace with SERVER="your host name" for a custom host name
SERVER="$(hostname)"
export SERVER
SERVER_IP="$(ip route get 1 | awk '{print $NF;exit}')"
export SERVER_IP
echo "$SERVER"
@jedisct1
jedisct1 / iptables
Created June 29, 2019 18:26
dnscrypt-proxy iptables firewall rules
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p udp --dport 443 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -s 127.0.0.1 -j ACCEPT
___chkstk_darwin
___chkstk_darwin_probe
_argon2_ctx
_argon2_decode_string
_argon2_encode_string
_argon2_fill_memory_blocks
_argon2_fill_segment_avx2
_argon2_fill_segment_avx512f
_argon2_fill_segment_ref
_argon2_fill_segment_ssse3
_PBKDF2_SHA256
_alloc_region
_argon2_ctx
_argon2_hash
_argon2_pick_best_implementation
_argon2_verify
_argon2i_hash_encoded
_argon2i_hash_raw
_argon2i_verify
_argon2id_hash_encoded
_PBKDF2_SHA256
___chkstk_darwin
___chkstk_darwin_probe
_alloc_region
_argon2_ctx
_argon2_hash
_argon2_pick_best_implementation
_argon2_verify
_argon2i_hash_encoded
_argon2i_hash_raw
@jedisct1
jedisct1 / foo.c
Last active April 25, 2019 16:34
#define _GNU_SOURCE
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
static void
handler(int sig)
{