Skip to content

Instantly share code, notes, and snippets.

View omasanori's full-sized avatar

Masanori Ogino omasanori

View GitHub Profile
voluntas / webrtc.rst
Last active June 14, 2024 01:08
WebRTC コトハジメ
shafik /
Last active June 13, 2024 00:48
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

MawKKe /
Last active June 7, 2024 17:18
dm-crypt + dm-integrity + dm-raid = awesome!
#!/usr/bin/env bash
# Author: Markus (MawKKe)
# Date: 2018-03-19
# What?
# Linux dm-crypt + dm-integrity + dm-raid (RAID1)
JamieMason /
Last active June 6, 2024 14:23
Unfollow everyone on

Unfollow everyone on

  1. Go to
  2. Open the Developer Console. (COMMAND+ALT+I on Mac)
  3. Paste this into the Developer Console and run it
// Unfollow everyone on, by Jamie Mason (
osy /
Last active June 3, 2024 01:13
TPM provides zero practical security

TPM provides zero practical security

TPM (Trusted Platform Module) is as useful for preventing real attackers as the TSA is at preventing real terrorists. The architecture is fundamentally flawed and most existing implementations are completely broken. I thought this argument was settled decades ago[1] when "trusted computing" was introduced mostly as a way to provide DRM and ownership capabilities to organizations. It has largely failed to impact the consumer market when it was introduced back in the early 2000s. However, recently there seems to be a movement by certain parties to reintroduce this failed product back to the market. Microsoft argues that in order to use Windows 11, you need TPM 2.0 compatible hardware because[2]:

The Trusted Platform Module(TPM) requirement ena

DraTeots / ComPort over
Last active June 2, 2024 20:00
ComPort over Network
martijnvermaat /
Last active May 9, 2024 01:11
Installation of NixOS with encrypted root
hamano /
Last active April 9, 2024 09:38
unzip 6.0 日本語化パッチ(Shift_JISファイル名などに対応)
pbrisbin /
Created October 27, 2014 18:55
ZSH startup file headaches

Default behavior dictates the following order for ZSH startup files:

  • /etc/zshenv
  • ~/.zshenv
  • /etc/zprofile (if login shell)
  • ~/.zprofile (if login shell)
  • /etc/zshrc (if interactive)
  • ~/.zshrc (if interactive)
  • /etc/zlogin (if login shell)
  • ~/.zlogin (if login shell)
jgamblin / commonssids.txt
Created November 28, 2016 02:00
5000 most of common SSID names from
<no ssid>