Skip to content

Instantly share code, notes, and snippets.

@jpmens
jpmens / v.md
Created February 24, 2023 19:26

vars plugin

I hope this is somewhat right; the documentation is not optimal. I've finally managed to have a vars plugin load only once (i.e. I understand the count of "JPJPJP" lines).

ansible.cfg

[defaults]

inventory = inventory
@jpmens
jpmens / AuthyToOtherAuthenticator.md
Created January 27, 2023 15:41 — 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

@jpmens
jpmens / arpaname.py
Created December 1, 2022 15:10
Ansible filter convert IP to arpaname
# arpaname.py, (C)2022 by Jan-Piet Mens <jp@mens.de>
# Convert an IPv4 or IPv6 address in textual form into a string whose value is
# the reverse-map domain name of the address.
#
# - debug: msg="{{ "192.168.1.3" | arpaname }}"
# "3.1.168.192.in-addr.arpa."
#
# - debug: msg="{{ "2001:DB8::7" | arpaname }}"
# "7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa."
@jpmens
jpmens / martin.py
Created November 18, 2022 16:53
RSStoMadon
#!/usr/bin/env python3
import feedparser
from mastodon import Mastodon
MASTODON_BASE_URL = 'https://mastodon.social'
CLIENTCRED = 'JP_appsecret.txt'
USERCRED = 'JP_usersecret.txt'
mastodon = Mastodon(
@jpmens
jpmens / gist:0152bc4c50a38493941b9559e4a88c0a
Created May 3, 2022 06:08
systemd unit file to launch instances of gotty
# {{ ansible_managed }}
# by Jan-Piet Mens, May 2021
# MUST be invoked with a two-digit number, e.g.
# systemctl start gotty@01
[Unit]
Description=Gotty Web Terminal %i
After=network.target
[Service]
User=user%i
; <<>> DiG 9.17.19 <<>> @5.1.78.54 postbank.de dnskey
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 31052
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;; Truncated, retrying in TCP mode.
; <<>> DiG 9.17.19 <<>> +norec @ns3.postbank.de postbank.de dnskey +nocrypto
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59050
;; flags: qr aa ad; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; <<>> DiG 9.17.19 <<>> @9.9.9.9 postbank.de +cd +dnssec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 54895
;; flags: qr rd ra ad cd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 512
; <<>> DiG 9.16.22 <<>> @1.1.1.1 www.postbank.de
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 26432
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; <<>> DiG 9.16.22 <<>> @ns2.postbank.de postbank.de A +dnssec
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38858
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION: