Skip to content

Instantly share code, notes, and snippets.

View jfdesrochers's full-sized avatar

Jean-Francois Desrochers jfdesrochers

View GitHub Profile
@jfdesrochers
jfdesrochers / Readme.md
Created March 22, 2023 19:25 — forked from mapster/Readme.md
Export Google Authenticator secret OTP-keys

Export Google Authenticator secret OTP-keys

I recently got myself a Yubikey and wanted to set up the Yubico Authenticator with all the OTPs I had in Google Authenticator. Unfortunately Yubico Authenticator doesn't support scanning the QR-code that the Google Authenticator generates when you export the OTP-keys, and it seemed like quite the daunting task to log in to every service to generate new OTP-keys. So I decided to have a look at the contents of the QR code, to see if I could import the keys into Yubico Authenticator in one go. Luckily I found a blog post by Alex Bakker that describes the data format.

Transfer QR-code to computer

Unfortunately, but likely for the best, the security policy of Google Authenticator won't allow you to take a screenshot of

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@jfdesrochers
jfdesrochers / untrusted-lvl17-solution.js
Last active December 17, 2019 21:18 — forked from Untrusted-Game/untrusted-lvl17-solution.js
My solution to level 17 in Untrusted: http://alex.nisnevich.com/untrusted/ Basically points all the teleporters to the one closest to the exit.
/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/

PDF Make Definitions

A list of all the properties for the Document Definition objects in PDF Make. Gathered from the examples source code. Up to date for version 0.1.38.

Basic definition

  • The Document Definition is a javascript object: {}. It can contain the following.
  • content: array. This defines the layout of your document. All your tags will be defined in there. You define tags using object (e.g. content: [{text: 'Hello World'}])
  • styles: object. A dictionary of all the named styles in your document. You can then apply a style to any object using style: 'name' or style: ['name1', 'name2']
  • defaultStyle: object. Defines a style to be applied to every element in the document.
  • images: object. Another dictionary that you can use to specify all the images in your document.
@jfdesrochers
jfdesrochers / barcode-128-svg.js
Created July 9, 2018 04:09 — forked from jcormont/barcode-128-svg.js
Simple Code-128 (128B) barcode SVG generator, in vanilla JS
var Barcode128Svg = (function () {
function Barcode128Svg(input) {
this.input = input;
this.factor = 2;
this.height = 75;
}
var lookup = {}, data = "212222222122222221121223121322131222122213122312132212221213221312231212112232122132122231113222123122123221223211221132221231213212223112312131311222321122321221312212322112322211212123212321232121111323131123131321112313132113132311211313231113231311112133112331132131113123113321133121313121211331231131213113213311213131311123311321331121312113312311332111314111221411431111111224111422121124121421141122141221112214112412122114122411142112142211241211221114413111241112134111111242121142121241114212124112124211411212421112421211212141214121412121111143111341131141114113114311411113411311113141114131311141411131".split(/(\d{6})/).filter(function (s) { return !!s });
for (var i = 32; i < 127; i++)
lookup[String.fromCharCode(i)] = [i - 32, data[i - 32]];
# Commands for setting up Samba 4 Domain Controller on Raspberry Pi 3.
# Only tested on "2017-08-16-raspbian-stretch-lite".
# Credit goes to:
# VirtualFrontiers.co.uk http://www.virtualfrontiers.co.uk/domain_controller.htm
# Techmint.com https://www.tecmint.com/set-add-static-ip-address-in-linux/
# Note that I have applied this fix for ethernet interface naming.
# https://raspberrypi.stackexchange.com/questions/43560/raspberry-pi-3-eth0-wrongfully-named-enx
module['exports'] = function myService (hook) {
var request = require("request");
const params = hook.params;
const res = hook.res;
const sku = hook.params.sku;
const zip = hook.params.zipcode;
res.setHeader('Content-Type', 'application/json');
@jfdesrochers
jfdesrochers / sousvide_steak.md
Created June 24, 2017 20:45
Recipes and Tips