Skip to content

Instantly share code, notes, and snippets.

View isometry's full-sized avatar

Robin Breathe isometry

View GitHub Profile
@isometry
isometry / wifi_status.py
Last active May 10, 2017 15:14
Log macOS Wi-Fi connection status along with RTT to external TCP socket
#!/usr/bin/python
"""
Robin Breathe, 2017
Documentation: https://developer.apple.com/reference/corewlan
"""
from __future__ import print_function, division
import argparse
import socket
import logging

Keybase proof

I hereby claim:

  • I am isometry on github.
  • I am breathe (https://keybase.io/breathe) on keybase.
  • I have a public key ASA0a7C0ik8ec_2ZJk_ymjIkHBJvjKwnSYwdzr9wRV0urQo

To claim this, I am signing this object:

@isometry
isometry / maskname.c
Created January 20, 2018 21:40
Fake the process name of an arbitrary command to help distinguish between multiple concurrent instances
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void usage(char *name);
int
main(int argc, char *argv[])
{
char *rexec;
@isometry
isometry / iwc.l
Created January 28, 2018 21:23
Flex implementation of the standard wc(1) utility
%{
#include <sys/types.h>
#include <unistd.h>
char **files;
int cfile, nfile;
int dochar = 0, doword = 0, doline = 0;
unsigned long charct = 0, wordct = 0, linect = 0;
unsigned long tcharct = 0, twordct = 0, tlinect = 0;
@isometry
isometry / iwc.l
Last active January 28, 2018 21:29
Flex implementation of the standard wc(1) utility
%{
#include <sys/types.h>
#include <unistd.h>
char **files;
int cfile, nfile;
int dochar = 0, doword = 0, doline = 0;
unsigned long charct = 0, wordct = 0, linect = 0;
unsigned long tcharct = 0, twordct = 0, tlinect = 0;
@isometry
isometry / otp_secret_generator.py
Last active March 20, 2021 13:20
HOTP/TOTP Secret Generator to enable use of third-party authenticator apps as Soft Tokens with Duo (or similar)
#!/usr/bin/env python3
"""
HOTP/TOTP Secret Generator to enable use of third-party authenticator apps as Soft Tokens with Duo (or similar)
"""
from base64 import b32encode
from secrets import token_bytes
from urllib.parse import quote