Skip to content

Instantly share code, notes, and snippets.

Avatar

Natanael Copa ncopa

View GitHub Profile
View close-fds.c
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
int close_fds(int from_fd, int max_fd)
View gist:c7946c12f599db14116bdda98804e589
- New macro XDT_VERSION_INIT(SEMVER[, TAG])
This macro takes care of setting up the version numbering.
It will define the following macros based on SEMVER and TAG:
- xdt_version
- xdt_version_major
View gist:0d0d9643b1f0b93e5c67d7ea91015655
dnl XDT_VERSION_INIT(SEMVER, [TAG])
dnl
dnl This macro takes care of setting up the version numbering.
dnl
dnl it will define the following macros based on SEMVER and SUFFIX:
dnl
dnl - xdt_version_full
dnl - xdt_version_major
dnl - xdt_version_minor
dnl - xdt_version_micro
View gist:6c7995e1fe0f854e176d38f53e4554bf
#0 EVP_MD_CTX_cleanup (ctx=ctx@entry=0x0) at evp/digest.c:379
#1 0x00000e63729fdd42 in EVP_MD_CTX_free (ctx=0x0) at src/mongoc/mongoc-crypto-openssl.c:51
#2 0x000069e0cdee69e5 in tls1_handshake_hash_free (s=s@entry=0xe63760a9f40) at t1_hash.c:109
#3 0x000069e0cdecae68 in ssl3_clear (s=s@entry=0xe63760a9f40) at s3_lib.c:1638
#4 0x000069e0cdee6b97 in tls1_clear (s=0xe63760a9f40) at t1_lib.c:174
#5 0x000069e0cdecac6d in ssl3_new (s=s@entry=0xe63760a9f40) at s3_lib.c:1578
#6 0x000069e0cdee6b4f in tls1_new (s=0xe63760a9f40) at t1_lib.c:155
#7 0x000069e0cded7f7b in SSL_new (ctx=ctx@entry=0xe63760a73e0) at ssl_lib.c:358
#8 0x000069e0cdec3c62 in BIO_new_ssl (ctx=ctx@entry=0xe63760a73e0, client=client@entry=1) at bio_ssl.c:545
#9 0x00000e63729fcf6a in mongoc_stream_tls_openssl_new (base_stream=0xe63760a7340, host=host@entry=0x0, opt=0x74814cf2fb98, client=1)
View gist:be27252cb911591dab025e5e7eb0a2c2
diff --git a/thread_pthread.c b/thread_pthread.c
index 951885ffa0..6c9241dd58 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -530,9 +530,6 @@ hpux_attr_getstackaddr(const pthread_attr_t *attr, void **addr)
# define MAINSTACKADDR_AVAILABLE 0
# endif
#endif
-#if MAINSTACKADDR_AVAILABLE && !defined(get_main_stack)
-# define get_main_stack(addr, size) get_stack(addr, size)
View gist:8637c7735a3076c0dd895fe2124d3bf1
>>> lz4: abuild 3.1.0-r4
>>> lz4: Checking sanity of /home/buildozer/aports/main/lz4/APKBUILD...
>>> lz4: Analyzing dependencies...
>>> lz4: Installing for build: build-base diffutils
(1/2) Installing diffutils (3.6-r0)
(2/2) Installing .makedepends-lz4 (0)
Executing busybox-1.27.2-r7.trigger
OK: 222 MiB in 110 packages
>>> lz4: Cleaning temporary build dirs...
>>> lz4: Fetching lz4-1.8.1.tar.gz::https://github.com/lz4/lz4/archive/v1.8.1.tar.gz
View thread-stack-size.py
import threading
import sys
def f(n=0):
try:
print(n)
f(n+1)
except Exception:
print("we hit recursion limit")
sys.exit(0)
@ncopa
ncopa / code-of-conduct-EN.md
Last active Nov 16, 2017 — forked from kaniini/code-of-conduct-EN.md
Alpine CoC public draft v2 to v3 changes
View code-of-conduct-EN.md

Alpine Linux Code of Conduct

This Code of Conduct applies to participants in Alpine projects, such as the Alpine Linux distribution.

Diversity and inclusion make the Alpine community strong. Anybody who wishes to participate in the Alpine community are welcome as long as they follow this Code of Conduct.

View config-vanilla-x86_84-toppc64le.diff
--- config-vanilla.x86_64
+++ config-vanilla.ppc64le
@@ -1,52 +1,74 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/x86_64 4.9.13 Kernel Configuration
+# Linux/powerpc 4.4.43 Kernel Configuration
#
+CONFIG_PPC64=y
+
View ncftp.diff
--- a/ncftp-3.2.6/Strn/DStrInternal.h
+++ b/ncftp-3.2.6/Strn/DStrInternal.h
@@ -1,7 +1,7 @@
/* DStrInternal.h */
-#ifndef _DStrInternal_h_
-#define _DStrInternal_h_ 1
+#ifndef DStrInternal_h
+#define DStrInternal_h 1
You can’t perform that action at this time.