Skip to content

Instantly share code, notes, and snippets.

View tylercubell's full-sized avatar

Tyler tylercubell

View GitHub Profile
@tylercubell
tylercubell / automatically_restart_live_stream.py
Created February 11, 2019 01:07
GStreamer Automatically Restart Live Stream On Error
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
Gst.init(None)
class Main:
def __init__(self):
self.pipeline = Gst.Pipeline.new("pipeline")
self.bus = self.pipeline.get_bus()
@tylercubell
tylercubell / youtube_livestream.py
Created February 14, 2019 16:17
GStreamer Python YouTube Livestream
import os, gi
gi.require_version("Gst", "1.0")
from gi.repository import GObject, Gst
Gst.init(None)
pipeline = Gst.Pipeline()
# Variables.
youtube_stream_key = "your_key_here"
encoder_speed = "ultrafast"
@tylercubell
tylercubell / hls_to_youtube_live.py
Created February 14, 2019 19:45
GStreamer Python HLS to YouTube Live
import os, gi, time
gi.require_version("Gst", "1.0")
from gi.repository import GObject, Gst
Gst.init(None)
pipeline = Gst.Pipeline()
bus = pipeline.get_bus()
# Variables.
hls_uri = "your_hls_uri"
@tylercubell
tylercubell / wordpress_backup.sh
Created July 30, 2020 18:34
WordPress backup script.
#!/bin/bash
# Variables.
backup_dir="backups"
files_dir="/var/www/yoursite" # Don't add trailing slash.
max_backups=14 # Two weeks.
database_name="yoursite"
timezone="US/Eastern"
# Check if script is running as root.