Skip to content

Instantly share code, notes, and snippets.

View RaphaelWimmer's full-sized avatar

Raphael Wimmer RaphaelWimmer

View GitHub Profile
@RaphaelWimmer
RaphaelWimmer / get_antifastickers.py
Created January 23, 2024 20:03
get images from #antifastickers Mastodon posts
#!/usr/bin/env python3
# get_antifastickers.py
# download the first image from each #antifasticker post found on Mastodon
# make sure to create the download directory ("./img") first
# CC-0 / Public Domain
import mastodon
import urllib.request
@RaphaelWimmer
RaphaelWimmer / btw5-switch.py
Last active October 8, 2024 15:36
Switch Creative BT-W5 between AptX Adaptive Low Latency and High Quality modes
#!/usr/bin/env python3
# Simple tool to switch the Creative BT-W5 Bluetooth Audio dongle between AptX Adaptive **Low Latency** or **High Quality** mode.
# Of course, only works with Bluetooth headphones that support AptX Adaptive, such as the Tranya X3
# Reverse engineered based on communication between Creative's desktop app for Windows and the BT-W5.
# Might also accidentally overwrite other settings as a whole config data array is sent without taking into account the existing config.
#
# Usage: sudo ./btw5-switch.py ll (for low-latency mode)
# sudo ./btw5-switch.py hq (for high-quality mode)
#
@RaphaelWimmer
RaphaelWimmer / chatgpt_pick_random_number.py
Last active July 16, 2023 11:01
Ask GPT to pick a random number between 1 and 10
#!/usr/bin/env python3
import openai
import time
import matplotlib.pyplot as plt
def pick_numbers(n, model, temperature, clean_session):
numbers = []
messages = []
system_msg = "Please only respond with the number, don't say anything else."
messages.append({"role": "system", "content": system_msg})
@RaphaelWimmer
RaphaelWimmer / endscopetool.py
Created June 21, 2023 23:46
Python implementation of the endscopetool (sic!) Android application used for the Vitcoco ear wax remover camera thingy.
#!/usr/bin/env python3
# Python implementation of the endscopetool (sic!) Android application used for the Vitcoco ear wax remover camera thingy.
# CC-0 / Public Domain
# (0) 2023 Raphael Wimmer
# v0.01
# reverse-engineered using a packet capture log - this means that I have no idea what all those magic numbers mean
# and whether there are further features that might be supported by the hardware
# usage: first connect to the 'softish-XXXX' wifi, then run this script. Check code for keyboard shortcuts.
import socket