Skip to content

Instantly share code, notes, and snippets.

@theconsultant
theconsultant / pandoc_watch.js
Created November 9, 2022 03:35 — forked from timpulver/pandoc_watch.js
Watches a markdown-folder for changes and re-generates .icml (InCopy / Adobe InDesign CC) files on every change
var exec = require('child_process').exec;
var chokidar = require('chokidar');
/*
* Watches a folder for changes in markdown (*.md) files and compiles them to ICML (Adobe InDesign CC / InCopy format)
*
* Dependencies:
* - Install Pandoc: pandoc.org
* - Run "npm install chokidar"
*
@theconsultant
theconsultant / AuthyToOtherAuthenticator.md
Created September 10, 2021 19:01 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@theconsultant
theconsultant / dnstools.md
Created January 30, 2019 14:57
[dns tools] A series of Python DNS tools found online #dns #python
@theconsultant
theconsultant / docx2md.sh
Created January 30, 2019 14:54 — forked from Christian-G/docx2md.sh
Convert Word documents into Markdown
#!/bin/bash
#
# generate a Markdown version of a word document. Goes in separate folder, since
# images are extracted and converted as well (separate folder avoids naming clashes).
#
# REQUIREMENTS: pandoc
#
#
# with pandoc
# --extract-media=[media folder]
@theconsultant
theconsultant / mailapp.py
Last active March 2, 2019 15:42
Mail.app command line tool
#!/usr/bin/python
#
# by Nathan Grigg http://nathangrigg.net
# Details on how it works: https://nathangrigg.com/2012/04/send-emails-from-the-command-line
import sys
import argparse
import os.path
from subprocess import Popen,PIPE
@theconsultant
theconsultant / photo_batch_resize_constrained.py
Created August 4, 2018 00:13 — forked from agalea91/photo_batch_resize_constrained.py
Resize a folder of images to a set max width / height dimension, keeping proportions constrained
import click
import glob
import os
from PIL import Image
@click.command()
@click.option(
'--max-px-size',
default=2560,
help='The max height / width of image in pixels.'
@theconsultant
theconsultant / safari-open-pages.py
Created February 7, 2017 01:06 — forked from aleks-mariusz/safari-open-pages.py
This script fetches the current open tabs in all Safari windows. Useful to run remotely on your mac when you are at work and want to read a page you have open (remotely) at home but don't remember the url but can log in to your home system on the command line
#!/usr/bin/python
#
# This script fetches the current open tabs in all Safari windows.
# Useful to run remotely on your mac when you are at work and want
# to read a page you have open (remotely) at home but don't remember
# the url but can log in to your home system on the cmmand line
#
import sys
@theconsultant
theconsultant / git-update
Created November 11, 2014 15:34
Script to switch to master, update it, then merge with branch you were in before.
#!/bin/bash
echo "Noting which branch you are currently in."
MYBRANCH=`git rev-parse --abbrev-ref HEAD`
echo $MYBRANCH
echo "Updating current branch"
git pull
#echo "Branch list"