Skip to content

Instantly share code, notes, and snippets.

View Eddy-Barraud's full-sized avatar

Eddy Barraud Eddy-Barraud

View GitHub Profile
@jeffwright13
jeffwright13 / #Inflection Points
Last active January 9, 2025 08:48
Inflection Points (Python)
Python code to calculate inflection points
@K-Wu
K-Wu / mpi_cuda_awareness_check.cpp
Last active November 18, 2024 14:18
Checking if MPI is installed with cuda-awareness
/*
* From https://www.open-mpi.org/faq/?category=runcuda
* Command:
* $ mpic++ cuda_aware_check.cpp
* $ mpirun a.out
* Program that shows the use of CUDA-aware macro and runtime check.
* Requires Open MPI v2.0.0 or later.
*/
#include <stdio.h>
#include "mpi.h"
@Velocet
Velocet / Unlock-PowerCfg.ps1
Last active April 18, 2025 20:20
Unlock/Unhide all Power Plan Settings/Options on Windows 10/11
#Requires -RunAsAdministrator
# Unlock-PowerCfg - v22.05.11
# Disable "Connected Standby"
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force
# Get Power Settings entries and add/set 'Attributes' to 2 to unhide
$PowerCfg = (Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$'
foreach ($item in $PowerCfg) { Set-ItemProperty -Path $item.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force }
@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 17, 2025 01:31
Phoronix Test Suite Cheat Sheet
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 24, 2025 05:26
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