Skip to content

Instantly share code, notes, and snippets.

View rkulow's full-sized avatar

Rainer Kulow rkulow

View GitHub Profile
@rkulow
rkulow / upd.php
Last active December 28, 2019 22:20 — forked from marcelschmidtdev/upd.php
Fritz!Box DynDNS update script for Cloudflare
<?php
// This solution contains two options for reading the records for updating:
// 1) file-mode: reading all records from external file
// 2) parameter-mode: reading all records from url parameter 'hosts'
// It is possible to use both option simultaneous.
// Fritz!Box update URL using hosts from external file: https://example.com/upd.php?zoneId={zoneId}&key=<pass>&file={filename}&ip=<ipaddr>
// If you want to read your records from a file, specify the file name as parameter.
// Therefore the file should be in the same directory as this php file.
@rkulow
rkulow / login.py
Last active April 2, 2022 04:28
Degiro automated login with 2FA
import requests
import hmac, base64, struct, hashlib, time
import json
# 2FA code generation from https://stackoverflow.com/questions/8529265/google-authenticator-implementation-in-python
def get_totp_token(secret):
key = base64.b32decode(secret, True)
msg = struct.pack(">Q", int(time.time())//30)
h = hmac.new(key, msg, hashlib.sha1).digest()
o = h[19] & 15