Skip to content

Instantly share code, notes, and snippets.

@aschepis
aschepis / network_filter_tutorial.c
Last active August 29, 2015 14:07
OSMalloc Tag
#include <mach/mach_types.h>
#include <sys/systm.h>
#include <libkern/OSMalloc.h>
OSMallocTag tut_mtag = (OSMallocTag)NULL;
kern_return_t network_filter_tutorial_start(kmod_info_t * ki, void *d);
kern_return_t network_filter_tutorial_stop(kmod_info_t *ki, void *d);
kern_return_t network_filter_tutorial_start(kmod_info_t * ki, void *d) {
@aschepis
aschepis / Info.plist
Last active August 29, 2015 14:07
Blank Kernel Filter
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.aschepis.$(PRODUCT_NAME:rfc1034identifier)</string>
@aschepis
aschepis / example_contact.json
Created March 29, 2012 01:44
hypercontact curl logs
{
"name":"Peter Parker",
"address":"1 Two Three Lane",
"city":"New York",
"state":"NY",
"notes":"created during a Cloud Assault load test"
}
@aschepis
aschepis / gist:1605650
Created January 13, 2012 11:28
Does inline JSON in cofeescript have to be this ugly?
$.plot($("#responsePlaceholder"), responseData,
series:
shadowSize: 0,
color: "orange",
label: "Avg. Response Time (ms)"
,yaxis:
min: 0
,xaxis:
mode: "time",
timeformat: "%m/%d/%y %H:%M:%S%p",
@aschepis
aschepis / users_add_devise_confirmable_columns.rb
Created September 25, 2011 02:02
Add confirmable to existing devise user model
class UsersAddDeviseConfirmableColumns < ActiveRecord::Migration
def change
change_table :users do |t|
t.confirmable
end
end
end
@aschepis
aschepis / config.erl
Created August 24, 2011 17:37
Updating properties in a riak config file
#!/usr/bin/env escript
-export([main/1]).
main([]) ->
{ok,[AppConfig]} = file:consult("app.config"),
[Http] = get_config_value(AppConfig, riak_core, http),
io:format("HTTP Address: ~p~n", [Http]),
Updated = update_config_value(AppConfig, riak_core, http, [{"0.0.0.0", 8080}]),
io:format("Original Values:~n~p~n", [AppConfig]),
io:format("Updated Values:~n~p~n", [Updated]).