Skip to content

Instantly share code, notes, and snippets.

Vigrond /
Last active January 7, 2023 00:36
ffmpeg vaapi chromecast
Vigrond / ffmpeg-ubuntu-to-windows.txt
Last active February 12, 2021 09:59
Simple ffmpeg desktop audio sharing for Ubuntu
View ffmpeg-ubuntu-to-windows.txt
In this example, the client is Ubuntu, and the server is Windows. ffmpeg will need to be installed on both. Other scenarios will need a different command and understanding of ffmpeg.
On the "client", run the ffmpeg command:
`ffmpeg -re -f alsa -ac 2 -i default -fflags +genpts -vn -c:a pcm_s16be -sdp_file ~/sdp_stream.sdp -f rtp rtp://server:1234`
Where `server` is your barrier server IP address. This will stream desktop audio to the specified address
(If you use pulse instead of alsa, replace `-f alsa` with `-f pulse` )
Vigrond / ow_streaming_guide_240.txt
Last active March 30, 2020 04:06
240hz 60fps overwatch twitch streaming guide
View ow_streaming_guide_240.txt
*Last Updated: 3/25/2020*
Does your beefy computer have annoying issues streaming and playing at the same time? Read on...
This guide is intended for peeps who have something comparable to:
* i9 9900k @ 5ghz
* 32GB DDR4
* Nvidia Geforce RTX 2080
* Acer Predator XB252Q 240hz GSYNC monitor (1080p)
Vigrond /
Created June 18, 2019 08:42
Django Channels Auth Middleware for rest_framework_simplejwt
import logging
from urllib.parse import parse_qs
from django.conf.urls import url
from channels.routing import ProtocolTypeRouter, URLRouter
from rest_framework_simplejwt.authentication import JWTAuthentication
logger = logging.getLogger(__name__)
class JwtTokenAuthMiddleware:
Vigrond /
Last active November 28, 2021 23:01
Celery / Django / Redis Rate Limits done "as expected" - Simple SMTP Example
# Rate limiting with Celery + Django + Redis
# Multiple Fixed Windows Algorithm inspired by Figma
# and Celery's sometimes ambiguous, vague, and one-paragraph documentation
# Celery's Task is subclassed and the is_rate_okay function is added
# or however your App is implemented in Django
import os
import math
Vigrond /
Last active May 18, 2020 18:13
A Django 2.2 Admin Mixin that supports foreign key relationship links with list_links attribute
from django.urls import reverse
from django.utils.html import format_html
class ListLinksMixin(object):
Support for list_links attribute. Items in list_links must also be in list_display
Usage to make 'fieldTwo' a link:
list_display = ('fieldOne', 'fieldTwo',)
list_links = ('fieldTwo',)
Vigrond /
Created November 3, 2018 07:19
Take a screenshot of a live twitch stream.
# "install ffmpeg"
# git clone
# cd FFmpeg
# ./configure --enable-openssl
# make
# sudo make install
# "install youtube-dl"
# pip3 install youtube-dl