Skip to content

Instantly share code, notes, and snippets.

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 26, 2023 19:21 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
View AuthyToOtherAuthenticator.md

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

@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active February 10, 2023 23:06
How to compile ffmpeg on Amazon Linux (EC2)
View install-ffmpeg-amazon-linux.sh
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@gboudreau
gboudreau / smb411-nsstest.patch
Last active May 21, 2022 02:38
Patch required to compile Samba 4.11.x on recent Ubuntu systems
View smb411-nsstest.patch
--- a/nsswitch/nsstest.c 2019-12-06 06:46:56.000000000 -0300
+++ b/nsswitch/nsstest.c 2020-09-11 18:35:27.199949579 -0300
@@ -137,7 +137,7 @@
return &pwd;
}
-static void nss_setpwent(void)
+static void nss_setpwent2(void)
{
NSS_STATUS (*_nss_setpwent)(void) =
@gboudreau
gboudreau / fix-google-drive-dark-mode-icons.sh
Created November 6, 2014 01:42
Fix Google Drive menuBar icon for dark mode
View fix-google-drive-dark-mode-icons.sh
#!/bin/bash
function switch_files {
mv $1.png $1.tmp.png
mv $1-inverse.png $1.png
mv $1.tmp.png $1-inverse.png
mv $1@2x.png $1@2x.tmp.png
mv $1-inverse@2x.png $1@2x.png
mv $1@2x.tmp.png $1-inverse@2x.png
}
@gboudreau
gboudreau / profile-tabs-for-um-fix-for-latest-um.diff
Created September 5, 2019 11:13
Diff to fix Ultimate Member Profile Tabs (profile-tabs-for-ultimate-member) for Ultimate Member 2.0.53 and later
View profile-tabs-for-um-fix-for-latest-um.diff
diff -rbc a/profile-tabs-for-ultimate-member/core.php b/profile-tabs-for-ultimate-member/core.php
*** a/profile-tabs-for-ultimate-member/core.php 2018-09-29 16:05:06.000000000 -0400
--- b/profile-tabs-for-ultimate-member/core.php 2019-08-30 00:00:02.000000000 -0400
***************
*** 7,13 ****
add_action( 'init', array( $this, 'create_cpt' ) );
add_action( 'admin_menu', array( $this, 'add_admin_page' ) );
add_action( 'template_redirect', array( $this, 'show_profile_tab_content' ), 20 );
! add_filter( 'um_profile_tabs', array( $this, 'add_profile_tabs' ), 9000 );
}
@gboudreau
gboudreau / mount_shares_locally
Last active September 14, 2020 03:57
mount_shares_locally for Fedora/CentOS
View mount_shares_locally
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mount_shares_locally
# Required-Start: $network $local_fs $remote_fs smb mysqld
# Required-Stop: $network $local_fs $remote_fs smb
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mount Samba shares locally
### END INIT INFO
@gboudreau
gboudreau / mount_shares_locally
Last active September 14, 2020 03:57
mount_shares_locally for Ubuntu/Debian
View mount_shares_locally
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mount_shares_locally
# Required-Start: $network $local_fs $remote_fs samba
# Required-Stop: $network $local_fs $remote_fs samba
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mount Samba shares locally
### END INIT INFO
@gboudreau
gboudreau / nissan-connect-encryption.php
Last active June 27, 2020 17:27
Nissan Connect API encryption using PHP
View nissan-connect-encryption.php
<?php
function encrypt($password, $key = 'uyI5Dj9g8VCOFDnBRUbr3g') {
$size = @call_user_func('mcrypt_get_block_size', MCRYPT_BLOWFISH);
if (empty($size)) {
$size = @call_user_func('mcrypt_get_block_size', MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
}
$password = pkcs5_pad($password, $size);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB), MCRYPT_RAND);
$passcrypt = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $password, MCRYPT_MODE_ECB, $iv);
@gboudreau
gboudreau / install-greyhole-package.sh
Last active April 5, 2020 13:20
Install Greyhole package
View install-greyhole-package.sh
#!/bin/bash
# Detect package type from /etc/issue
_found_arch() {
local _ostype="$1"
shift
grep -qis "$*" /etc/issue && _OSTYPE="$_ostype"
}
# Detect package type
@gboudreau
gboudreau / nest-api-php-workaround-login.php
Last active January 15, 2020 04:38
Manually create cache file required for nest-api to work with Nest accounts (not Google accounts). Ref: https://github.com/gboudreau/nest-api/issues/110
View nest-api-php-workaround-login.php
<?php
echo "\nInstructions:\n";
echo " - Login to https://home.nest.com in your browser\n";
echo " - Once logged in, using the same tab, go to https://home.nest.com/session\n";
echo " - Copy-paste the text (JSON) here (then press ENTER):\n\n";
$json = readline();
$o = json_decode($json);
echo "\nThanks!\n\n";