Skip to content

Instantly share code, notes, and snippets.

View arkku's full-sized avatar

Kimmo Kulovesi arkku

View GitHub Profile
@arkku
arkku / convert-certs.sh
Last active July 21, 2017 12:16
Converting Apple Push Notification Services certificates
#!/bin/bash
#
# Obtaining Apple Push Notification Services certificates:
#
# 1) In developer.apple.com go to the App Id, and configure the push
# certificates. Follow Apple's instructions for creating the signing
# requests and generating the certificates.
#
# 2) Download the certificates and import them into the local keychain.
#
@arkku
arkku / tmx
Last active October 5, 2017 15:10
Arkku's tmux wrapper script
#!/bin/sh
# A wrapper for running tmux. Takes on (optional) main session name as
# argument, creates it if it doesn't exist. Then (in either case),
# a new slave session is created and attached to the main session.
# The slave session is configured to be destroyed automatically when
# detached, but the main session stays alive. This arrangement allows
# each slave session to have independent control over active windows/panes.
#
# (Make sure ~/.tmux.conf does not interfere by having something like
# `new-session` or `attach-session` in it.)
@arkku
arkku / ror_puzzle.c
Last active August 29, 2015 14:25
ROR puzzle
uint32_t ror(const uint32_t w, const unsigned rot) { // ROtate Right (bits move `rot` places right w/ wraparound)
return (w >> rot) | (w << (32 - rot));
}
uint32_t a; // = ?
uint32_t rotation = 13;
uint32_t b = 0x29d34b82;
// b == a ^ ror(a, rotation)