Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/expect
set USER [lindex $argv 0]
set HOST [lindex $argv 1]
set PASS [lindex $argv 2]
log_file -a ~/scp.log
set timeout 30
log_user 1
set send_slow {1 .01}
send_log "spawn scp"
eval spawn scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=30 /tmp/test.txt $USER@$HOST:~/
#!/bin/bash
# Use expect to automate ssh login
# Usage: test_ssh.sh user host password
function _ssh {
USER=$1
HOST=$2
PASS=$3
/usr/bin/expect <<- EOD
set timeout 30
log_user 1
% RESUME DOCUMENT STYLE -- Released 23 Nov 1989
% for LaTeX version 2.09
% Copyright (C) 1988,1989 by Michael DeCorte
\typeout{Document Style `resume' <26 Sep 89, Dec 07>.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% resume.sty
%
% \documentstyle{resume}
@fortran01
fortran01 / AuthyToOtherAuthenticator.md
Created March 27, 2020 18:55 — 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 (beware, through Google) 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 gues

Keybase proof

I hereby claim:

  • I am fortran01 on github.
  • I am fortran01 (https://keybase.io/fortran01) on keybase.
  • I have a public key ASDAq43cA9c36E5l348wPMzQt6ML9ixXyViUGMEU1W9mGAo

To claim this, I am signing this object:

#!/bin/bash
logfile="my.log"
# Set up a named pipe for logging
npipe=/tmp/$$.tmp
mknod $npipe p
# Log all output to a log for error checking
tee <$npipe $logfile &
# Start new unnamed session
tmux -CC new
# Start new named session
# ???
# Re-attach to unnamed session
tmux -CC attach
# Re-attach to named session
@fortran01
fortran01 / log.sh
Created October 9, 2019 19:35
Log to file and see stdout
#!/bin/bash
logfile="my.log"
# Set up a named pipe for logging
npipe=/tmp/$$.tmp
mknod $npipe p
# Log all output to a log for error checking
tee <$npipe $logfile &
<dict>
<key>policyCategoryAuthentication</key>
<array>
<dict>
<key>policyContent</key>
<string>(policyAttributeFailedAuthentications &lt; policyAttributeMaximumFailedAuthentications) OR (policyAttributeCurrentTime &gt; (policyAttributeLastFailedAuthenticationTime + autoEnableInSeconds))</string>
<key>policyIdentifier</key>
<string>Authentication Lockout</string>
<key>policyParameters</key>
<dict>
@fortran01
fortran01 / dev.c
Last active August 29, 2015 14:15
compatdrivers_chan_qos_frag.patch -- /usr/src/linux-source-3.18/drivers/net/wireless/rtl818x/rtl8187/dev.c from linux-source-3.18_3.18.3-1~kali4_all.deb (md5 90218f1ccc6e7d2dc9dbb70b5a2762a7)
/*
* Linux device driver for RTL8187
*
* Copyright 2007 Michael Wu <flamingice@sourmilk.net>
* Copyright 2007 Andrea Merello <andrea.merello@gmail.com>
*
* Based on the r8187 driver, which is:
* Copyright 2005 Andrea Merello <andrea.merello@gmail.com>, et al.
*
* The driver was extended to the RTL8187B in 2008 by: