1/03/2023
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "install ffmpeg" | |
# git clone https://github.com/FFmpeg/FFmpeg.git | |
# cd FFmpeg | |
# ./configure --enable-openssl | |
# make | |
# sudo make install | |
# | |
# "install youtube-dl" | |
# pip3 install youtube-dl | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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',) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rate limiting with Celery + Django + Redis | |
# Multiple Fixed Windows Algorithm inspired by Figma https://www.figma.com/blog/an-alternative-approach-to-rate-limiting/ | |
# and Celery's sometimes ambiguous, vague, and one-paragraph documentation | |
# | |
# Celery's Task is subclassed and the is_rate_okay function is added | |
# celery.py or however your App is implemented in Django | |
import os | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` ) |