Skip to content

Instantly share code, notes, and snippets.

  • Add a section at the end of your responses labeled "Uncertainty Map," where you describe what you're least confident about, what you may be oversimplifying, and what questions or followups would change your opinion.
  • Include a confidence score of how certain (as a percentage) you are about your answer.
  • If I've made a statement that seems to be incorrect, don't defer to my judgement. Instead, tell me the reasons why you think it's incorrect, and confirm that I'm still certain.
  • Never add comments. Well-named variables and functions/methods make adding new comments unnecessary.
  • Always use context7 when I need code generation, setup or configuration steps, or library/API documentation. This means you should automatically use the Context7 MCP tools to resolve library id and get library docs without me having to explicitly ask.
@keeganwitt
keeganwitt / AuthyToOtherAuthenticator.md
Created February 14, 2024 06:44 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


*update: This might affect how easy it is to use this technique past August 2024: https://www.theverge.com/2024/1/8/24030477/authy-desktop-app-shutting-down


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.

@keeganwitt
keeganwitt / terraform-datadog-dashboard-url-and-id-bug.log
Created October 12, 2022 15:12
Log output showing how running terraform plan changes the Datadog dashboard ID and URL even with no changes
2022-10-12T10:26:05.047-0400 [INFO] Terraform version: 1.2.5
2022-10-12T10:26:05.047-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.0.0
2022-10-12T10:26:05.047-0400 [DEBUG] using github.com/hashicorp/hcl/v2 v2.12.0
2022-10-12T10:26:05.047-0400 [DEBUG] using github.com/hashicorp/terraform-config-inspect v0.0.0-20210209133302-4fd17a0faac2
2022-10-12T10:26:05.047-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734
2022-10-12T10:26:05.047-0400 [DEBUG] using github.com/zclconf/go-cty v1.10.0
2022-10-12T10:26:05.047-0400 [INFO] Go runtime version: go1.18.1
2022-10-12T10:26:05.047-0400 [INFO] CLI args: []string{"/Users/kwitt/.tfenv/versions/1.2.5/terraform", "plan"}
2022-10-12T10:26:05.047-0400 [DEBUG] Attempting to open CLI config file: /Users/kwitt/.terraformrc
2022-10-12T10:26:05.047-0400 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
@keeganwitt
keeganwitt / gradle-dependency-analyze.gradle
Created January 31, 2018 19:58 — forked from kellyrob99/gradle-dependency-analyze.gradle
A simple Gradle wrapper for the maven dependency:analyze goal
import org.apache.maven.shared.dependency.analyzer.ClassAnalyzer
import org.apache.maven.shared.dependency.analyzer.DefaultClassAnalyzer
import org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer
import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis
import org.apache.maven.shared.dependency.analyzer.asm.ASMDependencyAnalyzer
import org.gradle.api.Project
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.ResolvedArtifact
import org.gradle.api.artifacts.ResolvedDependency
@keeganwitt
keeganwitt / dependency-report.gradle
Created January 31, 2018 19:58 — forked from tzachz/dependency-report.gradle
Gradle: multi-project dependency graph (supports depth > 2)
// Inspired by https://gist.github.com/abesto/cdcdd38263eacf1cbb51
// Task creates a .dot file with all inter-module dependencies
// Supports any depth of nested modules
task moduleDependencyReport {
doLast {
def file = new File("project-dependencies.dot")
file.delete()
file << "digraph {\n"
file << "splines=ortho\n"
@keeganwitt
keeganwitt / pom.xml
Last active June 20, 2024 05:16
Groovyc via Maven AntRun Example
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovyc-antrun-example</artifactId>
<name>Groovyc Maven AntRun Example</name>
<version>1.0-SNAPSHOT</version>
@keeganwitt
keeganwitt / hdfsDownloader.groovy
Created April 7, 2014 20:20
A Groovy script to download HDFS files in parallel
// Usage: groovy hdfsDownloader.groovy [prod|qa|<dev username>] <file> (<output directory>)
// <file> can be an individual file or a directory of part files.
// If <output directory> is not specified, the current working directory is used
import groovy.json.JsonSlurper
import java.util.concurrent.Executors
import java.util.concurrent.ExecutorService
import java.util.concurrent.TimeUnit
@keeganwitt
keeganwitt / hdfs-username-hack.user.js
Created October 3, 2013 14:42
A userscript to override the username to allow you to view HDFS files and directories from the NameNode web interface that aren't world readable
// ==UserScript==
// @name hdfs-username-hack
// @version 0.1
// @description Overrides the username to allow you to view HDFS files and directories from the NameNode web interface that aren't world readable
// @author Keegan Witt
// @include */browseDirectory.jsp*
// @include */browseBlock.jsp*
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
@keeganwitt
keeganwitt / SleepInputFormat.java
Last active December 20, 2015 02:09
SleepInputFormat to trick Hadoop into thinking there's input to process, when really there's not (useful in little test jobs)
/**
* This is a lot like the InputFormat defined in Hadoop's
* <a href="https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.22/mapreduce/src/test/mapred/org/apache/hadoop/mapreduce/SleepJob.java">SleepJob</a>
* except that it uses the Hadoop 2 API.
*/
public static class SleepInputFormat extends InputFormat<IntWritable, IntWritable> {
public static final String MAP_SLEEP_COUNT = "mapreduce.sleepjob.map.sleep.count";
public static final String REDUCE_SLEEP_COUNT = "mapreduce.sleepjob.reduce.sleep.count";
@Override
@keeganwitt
keeganwitt / GenerateJavaOnixTagConverter.groovy
Created May 29, 2012 18:58
A Groovy script to generate Java source files to convert between ONIX short and reference tags
/**
* @author Keegan Witt
* @version 1.0
*/
class GenerateJavaOnixTagConverter {
private static final String SCHEMA_2_FILENAME = "ONIX_BookProduct_Release2.1_reference.xsd"
private static final String SCHEMA_3_FILENAME = "ONIX_BookProduct_3.0_reference.xsd"
private static final String ONIX_2_CLASS = "Onix2TagConverter"
private static final String ONIX_3_CLASS = "Onix3TagConverter"