Skip to content

Instantly share code, notes, and snippets.

View tb1402's full-sized avatar

Tobias Bittner tb1402

View GitHub Profile
@tb1402
tb1402 / ip.py
Created June 26, 2022 09:55
Speedport pro/pro plus get public ip (with lte bonding enabled)
import requests
import urllib3
import xmltodict
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
data = "<soap-env:Envelope xmlns:soap-env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" \
"xmlns:cwmp=\"urn:telekom-de.totr64-2-n\"><soap-env:Body><cwmp:GetParameterValues xmlns:cwmp=\"urn:dslforum-org:cwmp-1-0\"><cwmp:ParameterNames length=\"1\">" \
"<xsd:string>Device.IP.Interface.4.IPv4Address.1.IPAddress</xsd:string></cwmp:ParameterNames></cwmp:GetParameterValues></soap-env:Body></soap-env:Envelope>"
@tb1402
tb1402 / pulseAudioStreamRecorder.py
Created May 30, 2021 13:59
Record pulseaudio stream
import subprocess
import os
import time
'''
This script does the following:
- creat pulseaudio null sink
- prompt the user with a selection of all available audio streams
- moves the selected stream to the created null sink
- starts parec to record audio from the null sink and pipes the audio to sox so it can be written to a file