Skip to content

Instantly share code, notes, and snippets.

@f0k
f0k / nvidia_boost.sh
Created December 6, 2017 17:45
Set Nvidia GPU application clocks and power limits to maximum supported values
#!/bin/bash
# Sets each CUDA device to persistence mode and sets the application clock
# and power limit to the device's maximum supported values.
# When run with "--dry-run" as first command line argument or not as superuser,
# will display the commands, otherwise it will execute them.
#
# Hint: To run this at boot time, place this script in /root and create a file
# /etc/cron.d/nvidia_boost with the following single line:
# @reboot root /root/nvidia_boost.sh >/dev/null
#
@f0k
f0k / pcenlayer.py
Last active June 18, 2018 17:25
PCEN layer for Lasagne
# -*- coding: utf-8 -*-
"""
PCEN Layer for Lasagne.
Author: Jan Schlüter, OFAI
"""
import numpy as np
import theano
@f0k
f0k / merge_ics.py
Created September 5, 2021 07:37
Merge and deduplicate .ics/.ical files
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Merges and deduplicates one or more .ics / ical files.
For usage information, call with --help.
Author: Jan Schlüter
"""
@f0k
f0k / chunked_dac.py
Last active July 27, 2024 19:01
Chunked compression/decompression of descript audio codec
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Encodes or decodes an audio file with the descript audio codec.
Compared to the included "python3 -m dac encode" and "python3 -m dac decode"
of descript-audio-codec 1.0.0, this implementation differs in the following:
- chunked encoding produces the same codes as unchunked encoding,
except at the beginning and end of the file
- encoded files are in .npz format, so the codes can be accessed as a memory