This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Upload a TLS key and cert to a FRITZ!Box, in pretty Python | |
Copyright (C) 2018 Olivier Mehani <[email protected]> | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# parameters | |
USERNAME="maybe empty" | |
PASSWORD="fritzbox-password" | |
CERTPATH="path to cert eg /etc/letsencrypt/live/domain.tld/" | |
CERTPASSWORD="cert password if needed" | |
HOST="http://fritz.box" | |
# make and secure a temporary file. Arrange for automatic cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import ctypes | |
ES_AWAYMODE_REQUIRED = 0x00000040 | |
ES_CONTINUOUS = 0x80000000 | |
ES_DISPLAY_REQUIRED = 0x2 #Forces the display to be on by resetting the display idle timer. | |
ES_SYSTEM_REQUIRED = 0x1 #Forces the system to be in the working state by resetting the system idle timer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Invoke it like this. | |
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "program binary.elf verify reset exit" | |
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "program binary.bin 0x08000000 verify reset exit" | |
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "init; reset run; exit" | |
# Sure, you may also use other JTAG interfaces. | |
# | |
# For platformio copy this file to the openocd target directory | |
# cd ~/.platformio/packages/tool-openocd-gd32v/share/openocd/scripts/target | |
# wget -O gd32vf103-elfmimi.cfg https://gist.github.com/joba-1/02454d9d028b37b70be4e4bb4b1d0ce2/raw/gd32vf103.cfg | |
# Then use these entries in your platformio.ini project file for use with a sipeed usb-jtag adapter: |