Skip to content

Instantly share code, notes, and snippets.

View robinkunde's full-sized avatar

Robin Kunde robinkunde

View GitHub Profile
@ruurdadema
ruurdadema / NetworkConnection.swift
Last active April 1, 2024 18:09
Swift networking with Apple's NWListener and NWConnection
//
// NetworkConnection.swift
// Listen
//
// Created by Ruurd Adema on 13/12/2019.
// Copyright © 2019 Ruurd Adema. All rights reserved.
//
import Foundation
import Network
@rygorous
rygorous / gist:e0f055bfb74e3d5f0af20690759de5a7
Created May 8, 2016 06:54
A bit of background on compilers exploiting signed overflow
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.
@rcackermanCC
rcackermanCC / request_builder.md
Last active January 31, 2020 18:24
S3 request

To know what you want in a secure way, S3 requires a signature. The signature is created by:

  1. assembling a canonical requst
  2. putting together some parts of the request together with a hashed version of the full request - this is the string to sign
  3. creating a signing key
  4. using the signing key to create a signature from the string to sign

Step 1

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active April 21, 2024 03:30
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront