Skip to content

Instantly share code, notes, and snippets.

View Eddy-Barraud's full-sized avatar

Eddy Barraud Eddy-Barraud

View GitHub Profile
@Eddy-Barraud
Eddy-Barraud / audio-convert.sh
Last active May 16, 2018 16:28
Convert every audio files inside the current directory to mp3
#!/bin/bash
find . -regex ".*\.\(opus\|ogg\|m4a\)" -print0 |
while IFS= read -r -d $'\0' filename; do
echo $filename
name="${filename%.*}"
< /dev/null ffmpeg -nostats -loglevel 0 -n -i "$filename" -b:a 0 -codec:a libmp3lame -vn "./$name.mp3"
done
@shane5ul
shane5ul / blockAverage.py
Last active September 15, 2023 02:48
This program computes the block average of a potentially correlated timeseries "x", and provides error bounds for the estimated mean <x>. As input provide a vector or timeseries "x", and the largest block size.
def blockAverage(datastream, isplot=True, maxBlockSize=0):
"""This program computes the block average of a potentially correlated timeseries "x", and
provides error bounds for the estimated mean <x>.
As input provide a vector or timeseries "x", and the largest block size.
Check out writeup in the following blog posts for more:
http://sachinashanbhag.blogspot.com/2013/08/block-averaging-estimating-uncertainty_14.html
http://sachinashanbhag.blogspot.com/2013/08/block-averaging-estimating-uncertainty.html
"""
@thenadz
thenadz / FFmpeg Build Script (Amazon Linux)
Last active January 30, 2020 20:57
Downloads & builds FFmpeg along with all dependencies in parallel, enabling all features
#!/bin/bash -e
# Distro: Amazon Linux AMI release 2015.03
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# Builds the dependencies in parallel prior to starting FFmpeg build.
sudo yum update -y
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel yasm libogg libvorbis-devel libvpx-devel
@elyase
elyase / curvature.py
Last active June 2, 2023 11:35
2D curve curvature
from scipy.interpolate import UnivariateSpline
import numpy as np
def curvature_splines(x, y=None, error=0.1):
"""Calculate the signed curvature of a 2D curve at each point
using interpolating splines.
Parameters
----------
x,y: numpy.array(dtype=float) shape (n_points, )
@anshula
anshula / phoronix-cmd.md
Last active March 22, 2024 21:43
Phoronix Test Suite Cheat Sheet
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1