Skip to content

Instantly share code, notes, and snippets.

@regstuff
regstuff / transcriber_setup_on_azure_vm.sh
Created February 10, 2024 06:53
Setup for a VM on Azure to use as a transcriber
#!/bin/bash
# Modify your app.py to run on port 80 if you don't want to open up ports in Azure networking. You'll need sudo (as below) to run the flask server on port 80. Consider setting up an NGINX reverse proxy instead. Remove sudo in the crontab and install entries below if not using port 80.
# You'll also have to change the reset command to work with sudo too if using port 80: echo whateverpassword | sudo -S -u whateverusername screen -S screen_to_test -X quit
sudo apt update
sudo apt install -y python3-pip git-lfs ffmpeg python3-venv
pip install flask
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
mkdir sgtranscribe
mkdir livetranscribe
@regstuff
regstuff / match_color.sh
Last active January 23, 2024 08:33
Convert whisper.cpp colored terminal out into a html colored file, for transcript confidence scores
#!/bin/bash
# Use with a command such as: (./main -m models/ggml-medium.bin -p 1 -t 8 -pc -f input.wav | ./ansi2html.sh > whisper.html && ./match_colors.sh whisper.html)
# The open and close parantheses in the command are important.
# Assumes ansi2html.sh is in the same folder. ansi2html.sh is available here: https://github.com/pixelb/scripts/blob/master/scripts/ansi2html.sh & here: https://gist.github.com/regstuff/a9cb16df25c74d10608a6bff3a3df95d
# Will generate an ouput called whisper.html. That can be parsed and used for final transcript. All low-confidence i.e. red or orange printed colors are converted to a span class named red, which can be used for further css downstream
# This script assumes bc (Basic Calculator) is installed and available in your UNIX environment. It's a common calculator utility available on many Unix-like systems.
# Check for the presence of an input file argument
if [ "$#" -ne 1 ]; then
@regstuff
regstuff / ansi2html.sh
Created January 23, 2024 08:20
Convert a colored terminal output in linux into a html file that preserves the color.
#!/bin/sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
# ls -l --color=always | ansi2html.sh > ls.html
# git show --color | ansi2html.sh > last_change.html
@regstuff
regstuff / Wayback Machine SPN2 API Docs
Created June 21, 2022 09:42
Wayback Machine SPN2 API Docs
From https://docs.google.com/document/d/1Nsv52MvSjbLb2PCpHlat0gkzw0EvtSgpKHu4mk0MnrA/
Save Page Now 2 Public API Docs Draft
Vangelis Banos, updated: 2022-04-05
Capture a web page as it appears now for use as a trusted citation in the future. Changelog: https://docs.google.com/document/d/19RJsRncGUw2qHqGGg9lqYZYf7KKXMDL1Mro5o1Qw6QI/edit#
Contents
Glossary 1
Basic API Reference 1
Capture request 1
#!/bin/bash
# From https://github.com/LIAAD/yake#installing-docker
# Install dependencies
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@regstuff
regstuff / 16-merge.txt
Created February 22, 2021 12:41
Merge 16 mono audios into one 16 channel audio
ffmpeg -i 1.wav -i 2.wav -i 3.wav -i 4.wav -i 5.wav -i 6.wav -i 7.wav -i 8.wav -i 9.wav -i 10.wav -i 11.wav -i 12.wav -i 13.wav -i 14.wav -i 15.wav -i 16.wav -filter_complex "[2:a][0:a][1:a][3:a][4:a][5:a][6:a][7:a][8:a][9:a][10:a][11:a][12:a][13:a][14:a][15:a]join=inputs=16:channel_layout=hexadecagonal[a]" -map "[a]" output.wav
@regstuff
regstuff / gist:33e072e97a446160839062d53d54b6e3
Created June 18, 2020 08:03
Show volume with ffmpeg, and use streamlink
ffmpeg -i http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4 -filter_complex "[0:a]showfreqs=s=480x240[vv];[0:v][vv]overlay=x=0:y=(H-h)/2" -c:v libx264 -c:a aac -f mpegts - | ffplay -i -
ffmpeg -i http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4 -filter_complex "[0:a]showvolume=p=1,scale=480:240[vv];[0:v][vv]overlay=x=0:y=(H-h)/2" -c:v libx264 -c:a aac -f mpegts - | ffplay -i -
ffmpeg -i http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4 -filter_complex "[0:a]showspectrum=s=480x240:scale=log[vv];[0:v][vv]overlay=x=0:y=(H-h)/2" -c:v libx264 -c:a aac -f mpegts - | ffplay -i -
ffmpeg -i http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4 -filter_complex "[0:a]showcqt=s=480x240[vv];[0:v][vv]overlay=x=0:y=(H-h)/2" -c:v libx264 -c:a aac -f mpegts - | ffplay -i -
streamlink https://www.youtube.com/watch?v=dp5IuihmwhQ worst -O | ffmpeg -i pipe:0 -filter_
@regstuff
regstuff / gist:d0e2b928008d94fd7f7e76ed33f3250c
Created December 22, 2019 15:19 — forked from dodok1/gist:7925037
Improved ordering and full JQL as tooltip
<script type='text/javascript'>
var refreshJqlHistoryPane = function() {
var localHistory = localStorage.getItem('jqlHistory');
if(localHistory){
var history = JSON.parse(localHistory);
var historyEntries = history.map(function(jql){
var display = jql;
if(display.length > 25){
display = display.substr(0,22) + "...";
}
@regstuff
regstuff / doc2txt.bat
Created August 7, 2019 06:51 — forked from arthurattwell/doc2txt.bat
Batch file to save Word docs as .txt with Libreoffice
:: doc2txt.bat
::
:: This batch file converts all the files in a folder to .txt,
:: as long as LibreOffice supports them (e.g. .doc, .docx, .odt)
::
:: 1. Make sure soffice.exe is in your PATH, e.g.
:: Edit Environment Variables, add New in user variables, and add C:\Program Files (x86)\LibreOffice 5\program
:: 2. Save this doc2txt.bat file to the folder alongside the files you want to convert.
:: 3. Make sure Libreoffice is not running. (A bug prevents soffice from working while Libreoffice is open.)
:: 4. Double-click doc2txt.bat.