Skip to content

Instantly share code, notes, and snippets.

@mfrischknecht
mfrischknecht / TraceUse.log
Created January 12, 2021 18:37
slimserver TraceUse output
Modules used from /nix/store/1jd84fkqqf432wsf48lb2s5rr2fblkim-perl5.32.0-slimserver-8.1.0/.slimserver.pl-wrapped:
1. strict 1.11, /nix/store/1jd84fkqqf432wsf48lb2s5rr2fblkim-perl5.32.0-slimserver-8.1.0/.slimserver.pl-wrapped line 15 [main]
2. constant 1.33, /nix/store/1jd84fkqqf432wsf48lb2s5rr2fblkim-perl5.32.0-slimserver-8.1.0/.slimserver.pl-wrapped line 39 [main]
3. warnings::register 1.04, constant.pm line 4
4. warnings 1.47, warnings/register.pm line 4
5. Config 5.032000, /nix/store/1jd84fkqqf432wsf48lb2s5rr2fblkim-perl5.32.0-slimserver-8.1.0/.slimserver.pl-wrapped line 60 [main]
33. Config_heavy.pl, Config.pm line 80
34. Config_git.pl, Config_heavy.pl line 1418 [Config]
6. Getopt::Long 2.51, /nix/store/1jd84fkqqf432wsf48lb2s5rr2fblkim-perl5.32.0-slimserver-8.1.0/.slimserver.pl-wrapped line 98 [PerlSvc]
7. vars 1.05, Getopt/Long.pm line 20
@mfrischknecht
mfrischknecht / generate_output.sh
Last active January 12, 2021 18:33
slimserver library loading output
(LD_DEBUG=libs /nix/store/1jd84fkqqf432wsf48lb2s5rr2fblkim-perl5.32.0-slimserver-8.1.0/.slimserver.pl-wrapped 2>&1) > slimserver_libs.log
@mfrischknecht
mfrischknecht / ring.sh
Created December 2, 2019 20:38
Ring a SIP phone using pjsip
#!/usr/bin/env bash
target_number="$1"
user="<sip_user>"
password="<sip_password>"
registrar="fritz.box"
sound_file="/path/to/sound_file.wav"
duration=20 #in seconds
@mfrischknecht
mfrischknecht / git-pr
Last active July 27, 2018 09:37
Git aliases
#!/bin/env bash
find_branch () {
for branch in ${1+"$@"}; do
if [ `git branch --list "$branch" | wc -l` -gt 0 ]; then
echo "$branch"
break
fi
done
}
@mfrischknecht
mfrischknecht / PKGBUILD
Created July 29, 2016 20:05
Mopify 1.6.0 PKGBUILD (Arch Linux)
# Minor modifications to https://aur.archlinux.org/packages/mopidy-mopify/ to build version 1.6.0
# Maintainer: hillbicks <hillbicks at doe dot ath dot cx>
pkgname=mopidy-mopify
pkgver=1.6.0
pkgrel=1
pkgdesc='A web client that uses external web services to provide additional features and a more complete music experience.'
arch=('any')
url="https://github.com/dirkgroenen/mopidy-mopify"
license=('APACHE')
@mfrischknecht
mfrischknecht / hsva2rgba.cpp
Last active August 29, 2015 14:23
Convert HSVA to RGBA
template<class T>
T clip(const T& n, const T& lower, const T& upper) {
return std::max(lower, std::min(n, upper));
}
typedef std::array<GLfloat, 4> Color;
//Conversion according to http://www.rapidtables.com/convert/color/hsv-to-rgb.htm
Color hsva2rgba(const Color &hsva)
{
static const double PI = 3.14159265359;
#List all files in the current directory and check whether they will be ignored through .gitignore
find . | grep -v -e "^\./\.git" | xargs git check-ignore -v -n
@mfrischknecht
mfrischknecht / main.cpp
Created April 2, 2015 11:27
Simple parallel foreach and ranges example in C++11
#include <algorithm>
#include <future>
template<class I, class F>
void parallel_for_each(I rangeStart, I rangeEnd, F callback, int numSegments = 0)
{
int numValues = std::distance(rangeStart,rangeEnd);
numSegments = numSegments > 0 ? numSegments : numValues;
int segmentSize = numValues/numSegments;