Skip to content

Instantly share code, notes, and snippets.

@jeamland
jeamland / shuttle.swift
Created November 17, 2016 22:51
My stunning adventures in Swift
import Foundation
import IOKit
import IOKit.hid
import Quartz
let ioman = IOHIDManagerCreate(kCFAllocatorDefault,
IOOptionBits(kIOHIDOptionsTypeNone))
let runloop : CFRunLoop = CFRunLoopGetCurrent()
let devices = [
kIOHIDVendorIDKey: 0x0b33,
> uname -a
Darwin usxxriceb2m1.corp.emc.com 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
> cat hypot.c
#include <math.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
Index: sys/kern/vfs_bio.c
===================================================================
--- sys/kern/vfs_bio.c (revision 280152)
+++ sys/kern/vfs_bio.c (working copy)
@@ -3611,6 +3611,7 @@
bp->bio_flags |= BIO_UNMAPPED;
start = trunc_page((vm_offset_t)bp->bio_data);
end = round_page((vm_offset_t)bp->bio_data + bp->bio_length);
+ bp->bio_data = unmapped_buf;
pmap_qremove(start, OFF_TO_IDX(end - start));
(ada0:ata2:0:0:0): READ_DMA. ACB: c8 00 00 bc 9d 40 00 00 00 00 80 00
(ada0:ata2:0:0:0): CAM status: ATA Status Error
(ada0:ata2:0:0:0): ATA status: 51 (DRDY SERV ERR), error: 40 (UNC )
(ada0:ata2:0:0:0): RES: 51 40 00 bc 9d 00 00 00 00 80 00
(ada0:ata2:0:0:0): Retrying command
(ada0:ata2:0:0:0): READ_DMA. ACB: c8 00 00 bc 9d 40 00 00 00 00 80 00
(ada0:ata2:0:0:0): CAM status: ATA Status Error
(ada0:ata2:0:0:0): ATA status: 51 (DRDY SERV ERR), error: 40 (UNC )
(ada0:ata2:0:0:0): RES: 51 40 00 bc 9d 00 00 00 00 80 00
(ada0:ata2:0:0:0): Retrying command
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 65535 bytes
20:23:38.705086 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 112) fe80::1:1 > ff02::1: [icmp6 sum ok] ICMP6, router advertisement, length 112
hop limit 64, Flags [other stateful], pref medium, router lifetime 30s, reachable time 0s, retrans time 0s
prefix info option (3), length 32 (4): 2601:8:9a80:69d::/64, Flags [onlink, auto, router], valid time 86400s, pref. time 14400s
0x0000: 40e0 0001 5180 0000 3840 0000 0000 2601
0x0010: 0008 9a80 069d 0000 0000 0000 0000
rdnss option (25), length 24 (3): lifetime 10s, addr: 2601:8:9a80:69d:20d:b9ff:fe34:c61a
0x0000: 0000 0000 000a 2601 0008 9a80 069d 020d
0x0010: b9ff fe34 c61a
unknown option (31), length 24 (3):
# Automatically Generated, do not edit
# Generated config for dhcp6 delegation from wan on lan
interface re2 {
AdvSendAdvert on;
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvLinkMTU 1500;
AdvOtherConfigFlag on;
prefix 2601:8:9a80:69d::/64 {
AdvOnLink on;
@jeamland
jeamland / gist:11284662
Created April 25, 2014 10:20
Bluetooth LE on OS X via Python
import select
import socket
import sys
import objc
from PyObjCTools import AppHelper
objc.loadBundle("CoreBluetooth", globals(),
bundle_path=objc.pathForFramework(u'/System/Library/Frameworks/IOBluetooth.framework/Versions/A/Frameworks/CoreBluetooth.framework'))

Keybase proof

I hereby claim:

  • I am jeamland on github.
  • I am benno (https://keybase.io/benno) on keybase.
  • I have a public key whose fingerprint is A9EE CFD4 5F9E 4F9B B2EB CDD2 4C06 467A 2B37 8974

To claim this, I am signing this object:

"use strict";
var diffViewerApp = angular.module('diffViewerApp', ['ngRoute']);
diffViewerApp.config(function ($routeProvider, $locationProvider) {
$routeProvider.when('/', {
templateUrl: 'dir.html',
controller: 'DiffViewerCtrl'
});
package main
import "database/sql"
import "flag"
import "fmt"
import "log"
import _ "github.com/jbarham/gopgsqldriver"
func main() {