Skip to content

Instantly share code, notes, and snippets.

View stalkerg's full-sized avatar
🎯
Focusing

Yury Zhuravlev stalkerg

🎯
Focusing
View GitHub Profile
@stalkerg
stalkerg / FuncAcceptArgtypes.cmake
Created September 2, 2015 17:13
CMake analog for ac_func_accept_argtypes.m4
include(CheckIncludeFiles)
include(CheckCSourceCompiles)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
if(HAVE_SYS_TYPES_H)
set(INCLUDE_SYS_TYPES_H "#include <sys/types.h>")
endif(HAVE_SYS_TYPES_H)
@stalkerg
stalkerg / gist:86a2197cf4707b2f1130
Created February 2, 2015 08:35
boycottsystemd.org
THE RUNDOWN
1. systemd flies in the face of the Unix philosophy: "do one thing and do it well," representing a complex collection of dozens of binaries1. Its responsibilities grossly exceed that of an init system, as it goes on to handle power management, device management, mount points, cron, disk encryption, socket API/inetd, syslog and other things.
2. systemd's journal files (handled by journald) are stored in a complicated binary format2, and must be queried using journalctl. This makes journal logs potentially corruptable. Oh, an embedded HTTP server is loaded to read them. QR codes are served, as well.
3. systemd's team is noticeably chauvinistic and anti-Unix, due to their open disregard for non-Linux software and subsequent systemd incompatibility with all non-Linux systems. Since systemd is very tightly welded with the Linux kernel API, this also makes different systemd versions incompatible with different kernel versions. This is an isolationist policy that essentially binds the Linux ecosystem i
@stalkerg
stalkerg / s3.py
Created January 12, 2015 13:09
Async Tornado S3 uploader with AWS4 sign
import hashlib
import hmac
import mimetypes
import binascii
from calendar import timegm
from datetime import datetime
import time
from email.utils import formatdate
from urllib.parse import quote, urlparse