Skip to content

Instantly share code, notes, and snippets.

View rriemann's full-sized avatar

Robert Riemann rriemann

View GitHub Profile
@rriemann
rriemann / record.sh
Created February 17, 2024 11:56
Recording from Boss RC-600 on rp4
#!/usr/bin/env bash
# https://trac.ffmpeg.org/wiki/Capture/Webcam#Listdevices1
# https://trac.ffmpeg.org/wiki/Capture/ALSA
# https://superuser.com/questions/982342/in-ffmpeg-how-to-delay-only-the-audio-of-a-mp4-video-without-converting-the-au
# ffmpeg -f alsa -channels 2 -sample_rate 44100 -i hw:CARD=Audio,DEV=0 -itsoffset 0.6 -f v4l2 -framerate 25 -video_size 1024x576 -i /dev/video0 -vf "transpose=2,transpose=2,format=yuv420p" -c:v h264_v4l2m2m -b:v 1500k -c:a libmp3lame record_$(date +"%FT%T").mkv
ffmpeg -itsoffset -0.6 -f alsa -channels 2 -sample_rate 44100 -i hw:CARD=Audio,DEV=0 -itsoffset 0 -f v4l2 -framerate 25 -video_size 1024x576 -i /dev/video0 -vf "transpose=2,transpose=2,format=yuv420p" -c:v h264_v4l2m2m -b:v 1500k -c:a aac -b:a 160k record_$(date +"%FT%T").mkv
@rriemann
rriemann / definionlist-filter.lua
Created February 4, 2020 22:32
Pandoc Lua Filter to convert Some Definition Lists to Latex theorem-like Environments and some references to cref tags
-- #!/usr/bin/env lua
-- Pandoc filter to add recommendation blocks in Latex and recognise cleveref references (cref)
--
-- Markdown Example:
--
-- Recommendation (Use of Pandoc) {#rec:pandoc}
-- : Pandoc is a nice editor for several reasons:
--
-- - fast
@rriemann
rriemann / x1c6.md
Created August 24, 2018 22:11 — forked from JZfi/x1c6.md
Lenovo ThinkPad X1 Carbon 6th gen (X1C6) and openSUSE Tumbleweed notes

Model 20KH-006MMX (with NFC & HDR) notes for stuff I've done this far to get the machine to an usable state.

openSUSE Tumbleweed works ok and touchpad & trackpoint & hibernation works out-of-the-box (not the case with Ubuntu 18.04 LTS).

To test out hibernation just type (after this it will appear in the GNOME menus):

# systemctl hibernate

BIOS

@rriemann
rriemann / csv2table.hs
Created April 30, 2018 10:09 — forked from baig/csv2table.hs
A Pandoc filter that replaces Image links having *.csv extension with Pandoc Markdown Tables.
#!/usr/bin/env runhaskell
{-
The MIT License (MIT)
Copyright (c) 2015 Wasif Hasan Baig <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
require 'flickraw'
module Jekyll
class FlickresponsiveTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
FlickRaw.api_key=Jekyll.configuration({})['flickr']['api_key']
FlickRaw.shared_secret=Jekyll.configuration({})['flickr']['secret']
@rriemann
rriemann / README.md
Created February 21, 2018 14:14
OpenWPM

Preparation

curl -sS https://www.i-dont-care-about-cookies.eu/abp/ > bannerlist.txt && \
curl -sS https://publicsuffix.org/list/public_suffix_list.dat > public_suffix_list.dat

The alternative browser_commands.py adds also labels to the database of links generated by the links extract command.

@rriemann
rriemann / stats.sh
Created February 9, 2018 10:24
Static Text Analysis: Word Frequency
# https://unix.stackexchange.com/a/41480/148389
# https://unix.stackexchange.com/a/171604/148389
# here, the file to analyise is parts.md
cat parts.md | tr -c '[:alnum:]' '[\n*]' | tr '[:upper:]' '[:lower:]' | fgrep -v -w -f /usr/share/groff/1.22.3/eign | sort | uniq -c | sort -nr | head -20
@rriemann
rriemann / convert.sh
Created February 9, 2018 00:03
convert pictures in for loop
#!/usr/bin/env bash
find . -print0 | while read -d $'\0' file
do
convert -size 800x800 ${file} -resize 800x800 +profile '*' ${file%\.*}_big.jpg
convert -size 200x150 ${file} -resize 200x150 +profile '*' ${file%\.*}_small.jpg
echo "<a class=\"zoom\" rel=\"group02\" title=\"${file}\" href=\"{relocatable: /referenzen/${file%\.*}_big.jpg}\"><img src=\"{relocatable: /referenzen/${file%\.*}_small.jpg}\" alt=\"\" /></a>"
done
@rriemann
rriemann / table-filter.py
Created August 19, 2017 17:35
Pandoc Floating Tables
#!/usr/bin/env python3
# based on https://groups.google.com/d/msg/pandoc-discuss/RUC-tuu_qf0/h-H3RRVt1coJ
import pandocfilters as pf
import sys
import re
def latex(s):
return pf.RawBlock('tex', s)
@rriemann
rriemann / features.geojson
Last active June 23, 2017 10:37
Impressions from Romania
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.