Skip to content

Instantly share code, notes, and snippets.

@adamf
adamf / test_comcast.sh
Created August 9, 2017 01:55
A script to track when my internet goes up and down
#!/bin/bash
set -x
SERVERIP=8.8.8.8
LOGFILE=pings.txt
STATE=U
END=5000000
for ((i=1;i<=END;i++)); do
foo=`date`
@adamf
adamf / Gyroscope.m
Created March 8, 2017 20:24
Gyroscope
#import <Gyroscope/Gyroscope.h>
[Gyroscope start:@”APIKEY”];
[Gyroscope actionList:showAd, ...];
@adamf
adamf / ZKSwizzle.m
Last active November 11, 2016 01:27
Trying to use ZKSwizzle
@interface ZKHookClass : NSObject
- (id)forwardingTargetForSelector:(SEL)aSelector;
- (BOOL)respondsToSelector:(SEL)aSelector;
@end
@implementation ZKHookClass
- (id)forwardingTargetForSelector:(SEL) aSelector {
NSLog(@"%@", NSStringFromSelector(aSelector));
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/afletcher/thread/tests/test_tt.py", line 30, in test_timer_thread
tt.timer_thread.assert_has_calls(master_calls)
File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/unittest/mock.py", line 824, in assert_has_calls
) from cause
AssertionError: Calls not found.
Expected: [call(1), call(2), call(3), call(4), call(5), call(6), call(7), call(8), call(9)]
Actual: [call.__bool__(),
call(1),
@adamf
adamf / parse_splunk.py
Created June 1, 2016 03:37
A script to parse exported Splunk channel archives as a text with ISO8601 timestamps
#!/usr/bin/env python3
import argparse
import json
import sys
import os
import datetime
import re
<html>
<body>
<script>
// use the HTML5 audio API to make a beep.
var context = new webkitAudioContext();
var volume = context.createGain();
volume.gain.value = 0.5;
volume.connect(context.destination);
var synth = context.createOscillator();
@adamf
adamf / gist:e2af92217dd41df00b12
Created January 15, 2015 04:46
Display a chessboard with chess.js
<html>
<head>
<link rel="stylesheet" href="css/chessboard-0.3.0.css" />
<script src="js/jquery-1.10.2.min.js"> </script>
<script src="js/chessboard-0.3.0.js"> </script>
</head>
<body>
<div id="board1" style="width: 400px"></div>
<script>
var board1 = new ChessBoard('board1', 'start');

Keybase proof

I hereby claim:

  • I am adamf on github.
  • I am adamf (https://keybase.io/adamf) on keybase.
  • I have a public key whose fingerprint is F41E F82F 6DE4 458B 7135 BA51 426E 459D 37AB 83FE

To claim this, I am signing this object:

making all in crypto...
( echo "#ifndef MK1MF_BUILD"; \
echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
echo ' #define CFLAGS "clang -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -Werror -Weverything"'; \
echo ' #define PLATFORM "darwin-i386-cc"'; \
echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
echo '#endif' ) >buildinf.h
clang -I. -I.. -I../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DRMD160_ASM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -Werror -Weverything -c
awf-macbookair1:t awf$ cat foo.c
#include <stdio.h>
int main() {
if(1)
goto foo;
goto foo;
printf("here\n");