Skip to content

Instantly share code, notes, and snippets.

@mjuric
mjuric / DockerUserNamespacesOnCentOS74.md
Last active September 6, 2023 18:31
Setting up Docker with user namespaces on CentOS 7.4

Setting up Docker with user namespaces on CentOS 7.4

The procedure below has been tested on a Digital Ocean VM with CentOS 7.4

# Install docker from RHEL’s standard repos
yum install -y docker

#
# We’ll activate the ‘user namespaces’ feature that defends against
@GuilhermeHideki
GuilhermeHideki / coalesce.py
Created April 27, 2016 07:31
Python coalesce
def coalesce(*args):
"""Returns the first not None item. Similar to ?? in C#.
It's different from a or b, where false values are invalid.
:param args: list of items for checking
:return the first not None item, or None
"""
return next((arg for arg in args if arg is not None))
@FiloSottile
FiloSottile / 32.asm
Last active May 16, 2024 19:56
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4