Skip to content

Instantly share code, notes, and snippets.

@Teque5
Teque5 / countdown.py
Created April 11, 2024 16:20
UNIX Epoch Countdown Script
#!/usr/bin/env python3
"""
UNIX Epoch Countdown
Originally written for 1.7e9 epoch by Teque5
November, 2023
"""
import time
import numpy as np
import seaborn as sns
@Teque5
Teque5 / get_dataverse_doi.py
Created October 24, 2023 21:39
Dataverse DOI Scraper
#!/usr/bin/env python3
# SPDX-FileContributor: 2023 The Aerospace Corporation
# SPDX-DocumentComment: Approved 2023-10-23 Request # OSS23-0008
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Dataverse Scraper"""
import argparse
from pathlib import Path
import hashlib
import logging
import subprocess
@Teque5
Teque5 / sigmf_to_svg.py
Last active July 3, 2021 03:42
SigMF XY O-Scope Logo (.sigmf to .svg)
#!/usr/bin/env python3
'''code to render SigMF logo as nice SVG via oscillioscope'''
import matplotlib.pyplot as plt
import numpy as np
from sigmf import sigmffile
from scipy.signal import resample_poly
# load data
signal = sigmffile.fromfile('sigmf_logo')
# signal = sigmffile.fromfile('sigmf_logo_fullband')
@Teque5
Teque5 / nbody-numba.py
Created March 10, 2020 15:25
Computer Language Benchmarks Game :: N-Body Python3+Numba
#!/usr/bin/env python3
'''
The Computer Language Benchmarks Game
https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
Original rust version by Ilia Schelokov
Pretty decent python3+numba version by Teque5
**Numba** (`pip install numba`) uses the LLVM compiler as a JIT solution for python3. I based this off the nice **Rust** version from Ilia Schelokov (rust-8).
@Teque5
Teque5 / 02-UPSstatus
Created May 4, 2018 06:32
A UPS monitor for the `/etc/update-motd.d/` login folder. Dynamically queries UPS using `apcaccess`
#!/bin/bash
OUTPUT=$(apcaccess)
status=$(echo "$OUTPUT" | grep "STATUS")
statusRe="STATUS : (\S*)"
charge=$(echo "$OUTPUT" | grep "BCHARGE")
chargeRe='([0-9]+)\.[0-9]? Percent'
timeleft=$(echo "$OUTPUT" | grep "TIMELEFT")
@Teque5
Teque5 / popm2rb.py
Last active June 5, 2024 15:51
This script adds ratings from flac and mp3 files to Rhythmbox format while preserving the existing database. Rhythmbox uses XML database to store its music files, together with rating. However, it does not read the ID3 rating frame of a music file if it exists, making it harder for people transferring rated music from other player to this one (f…
#!/usr/bin/env python3
"""
popm2rhythmBox
Convert saved audio file rating formats
┌──────┐ ┌─────────┐
│Winamp├───►RhythmBox│
└──────┘ └─────────┘
inspired by https://github.com/shatterhand19/RhythmboxPOPM
@Teque5
Teque5 / keybase.md
Created October 18, 2017 00:34
Keybase Proof

Keybase proof

I hereby claim:

  • I am teque5 on github.
  • I am teque5 (https://keybase.io/teque5) on keybase.
  • I have a public key ASDoIdFCt8zUvuLj56yBV1NOEJ898QTWrUE4taEmjnU8ZQo

To claim this, I am signing this object: