Skip to content

Instantly share code, notes, and snippets.

@joba-1
joba-1 / gd32vf103.cfg
Last active October 11, 2020 09:28 — forked from elfmimi/gd32vf103.cfg
OpenOCD script for GD32VF103 with improved reset procedure without power cycle
# 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:
@joba-1
joba-1 / screenon.py
Created January 10, 2019 18:32 — forked from EBNull/screenon.py
Forces Windows to keep the display on (temporarily disables sleep mode while running). Netflix's silverlight app failed to do this for me :/
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.
@joba-1
joba-1 / fritzbox-cert-update.sh
Last active August 24, 2021 15:07 — forked from wikrie/fritzbox-cert-update.sh
Fritzbox Fritz!Box AVM SSL Letsencrypt automatically update
#!/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
@joba-1
joba-1 / fritz_cert_upload.py
Created August 3, 2018 23:41 — forked from shtrom/fritz_cert_upload.py
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
#!/usr/bin/env python
"""
Upload a TLS key and cert to a FRITZ!Box, in pretty Python
Copyright (C) 2018 Olivier Mehani <shtrom@ssji.net>
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.