Skip to content

Instantly share code, notes, and snippets.

View adammw's full-sized avatar
👨‍💻
Hacking on Kubernetes Platform @ Zendesk

Adam Malcontenti-Wilson adammw

👨‍💻
Hacking on Kubernetes Platform @ Zendesk
View GitHub Profile
#ifdef __APPLE__
#include <machine/endian.h>
#include <libkern/OSByteOrder.h>
#define le32toh(x) OSSwapLittleToHostInt32(x)
#else
#include <endian.h>
#endif
#include "main.h"
@adammw
adammw / bootstrap.sh
Created June 29, 2021 04:46
/usr/local/share/eks/bootstrap.sh
#!/usr/bin/env bash
# CLOUD_IMG: This file was created/modified by the Cloud Image build process
#
# This file is part of the Ubuntu EKS image. This is a customized version of the
# Amazon bootstrap script for the use with Ubuntu EKS images.
#
# Copyright (C) 2020 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 3, as published by the
@adammw
adammw / main.swift
Created July 17, 2020 22:55
App to map next track button to input mute toggle
//
// main.swift
// mediakeymute
//
// Created by Adam Malcontenti-Wilson on 16/6/20.
// Copyright © 2020 Adam Malcontenti-Wilson.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
require 'aws-sdk-kinesis'
require 'fluent/output'
require 'fluent/test'
require 'fluent/test/driver/output'
require 'fluent/plugin/kinesis'
require 'fluent/plugin/kinesis_helper/aggregator'
require 'fluent/plugin/kinesis_helper/api'
require 'fluent/plugin/kinesis_helper/client'
require 'pry'

Keybase proof

I hereby claim:

  • I am adammw on github.
  • I am adammw (https://keybase.io/adammw) on keybase.
  • I have a public key ASAj2QwCXw7NPU4w60wy73UWlJav6FHy84J7OcLpmYk6Hgo

To claim this, I am signing this object:

@adammw
adammw / wifi_inject.c
Created November 1, 2016 05:00
WiFi raw packet injection
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/nl80211.h>
#include <linux/genetlink.h>
// Simple script to extract raw grade data from turnitin
// Replace the variables below and execute in a JS console on api.turnitin.com
var API_BASE = 'https://api.turnitin.com/';
var sessionId = 'REPLACE_ME';
var assignmentId = 'REPLACE_ME';
var rubricCriterion = {};
fetch(`${API_BASE}/assignment/${assignmentId}?&lang=en_us&output=json&session-id=${sessionId}`)
.then((resp) => { return resp.ok && resp.json() })

dpif, the DataPath InterFace.

In Open vSwitch terminology, a "datapath" is a flow-based software switch. A datapath has no intelligence of its own. Rather, it relies entirely on its client to set up flows. The datapath layer is core to the Open vSwitch software switch: one could say, without much exaggeration, that everything in ovs-vswitchd above dpif exists only to make the correct decisions interacting with dpif.

# Simple Blackboard Web Services Client
# Copyright (C) 2016, Adam Malcontenti-Wilson.
# Based on Blackboard Soap Web Services Python sample code, as licensed below
#
# Copyright (C) 2015, Blackboard Inc.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# -- Redistributions of source code must retain the above copyright
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/nl80211.h>
#include <linux/genetlink.h>