This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from zipfile import ZipFile | |
with ZipFile(sys.argv[1], 'r') as zip_file: | |
filename_list = zip_file.namelist() | |
for filename in filename_list: | |
print(filename) | |
if filename.endswith('.mp4'): | |
zip_file.extract(filename, sys.argv[2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! Copyright (c) Jarkko Sakkinen 2021 | |
//! | |
//! A simple synthesis and playback test. | |
use cpal::Device; | |
use cpal::Sample; | |
use cpal::SampleFormat; | |
use cpal::StreamConfig; | |
use cpal::StreamError; | |
use cpal::traits::DeviceTrait; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find -maxdepth 1 -name "*.wav" -print0 | xargs --null -n1 basename | xargs -I{} sox "{}" "mono_{}" remix 1,2 norm -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import wave | |
NOTE_FREQUENCY = 261.63 # C4 | |
NOTE_LENGTH = 1.0 / NOTE_FREQUENCY | |
SAMPLE_LENGTH = 1000.0 * NOTE_LENGTH | |
SAMPLE_RATE = 44100.0 | |
t = np.linspace(0, SAMPLE_LENGTH, int(SAMPLE_LENGTH * SAMPLE_RATE)) | |
s = np.sin(2 * np.pi * NOTE_FREQUENCY * t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Audient EVO4 | |
ATTRS{idVendor}=="2708", ATTRS{idProduct}=="0006", ENV{PULSE_IGNORE}="1" | |
# Intel Corporation Comet Lake PCH cAVS | |
ATTRS{vendor}=="0x8086", ATTRS{device}=="0x06c8", ENV{PULSE_IGNORE}="1" | |
# NVIDIA Corporation TU106 High Definition Audio Controller | |
ATTRS{vendor}=="0x10de", ATTRS{device}=="0x10f9", ENV{PULSE_IGNORE}="1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find $HOME -perm /o=rwx -type f -not -path "$HOME/pCloudDrive/*" -print0 | xargs -0 chmod o-rwx | |
find $HOME -perm /o=rwx -type d -not -path "$HOME/pCloudDrive/*" -print0 | xargs -0 chmod o-rwx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0x01 view | |
# Ox02 read | |
# 0x04 write | |
# 0x08 search | |
# 0x10 link | |
# 0x20 setattr | |
# | |
# A key default permissions: 0x3f010000 | |
# A keyring default permissions: 0x3f3f0000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SOUND_CARD=$1 | |
SAMPLE_RATE=$2 | |
FRAMES_PER_INT=$3 | |
FRAME_SIZE=$4 | |
# Use the ALSA backend. | |
jack_control ds alsa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
from matplotlib import style | |
from scipy import signal | |
import numpy as np | |
FREQUENCY = 440 # A3 | |
RATE = 44100 | |
DURATION = 2 # seconds | |
NR_SAMPLES = DURATION * RATE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from elftools.elf.elffile import ELFFile | |
PAGE_SIZE = 0x1000 | |
if __name__ == '__main__': | |
flags2str = ['---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx'] | |
if len(sys.argv) != 2: | |
sys.exit(1) |