Skip to content

Instantly share code, notes, and snippets.

@secemp9
secemp9 / stream_multi3.sh
Created July 14, 2024 17:19
Stream test again
#!/bin/bash
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2/KEY"
TWITTER_URL="rtmp://va.pscp.tv:80/x/KEY"
TWITCH_URL="rtmp://live.twitch.tv/app/KEY"
YOUTUBE_BITRATE="9M"
TWITTER_BITRATE="9M"
TWITCH_BITRATE="7M"
LOCAL_RTMP="rtmp://0.0.0.0:1935"
PIPE_PATH_BASE="/tmp/live_stream"
PLATFORMS=("youtube" "twitter" "twitch")
#!/bin/bash
# Set up variables
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2/KEY"
TWITTER_URL="rtmp://va.pscp.tv:80/x/KEY"
TWITCH_URL="rtmp://live.twitch.tv/app/KEY"
YOUTUBE_BITRATE="9M"
TWITTER_BITRATE="9M"
TWITCH_BITRATE="7M"
LOCAL_RTMP="rtmp://0.0.0.0:1935"
@secemp9
secemp9 / stream_multi.sh
Created July 12, 2024 13:04
Stream test
#!/bin/bash
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2/KEY"
TWITTER_URL="rtmp://va.pscp.tv:80/x/KEY"
TWITCH_URL="rtmp://live.twitch.tv/app/KEY"
YOUTUBE_BITRATE="9M"
TWITTER_BITRATE="9M"
TWITCH_BITRATE="7M"
LOCAL_RTMP="rtmp://0.0.0.0:1935"
SOCKET_PATH="/tmp/live_stream.sock"
@secemp9
secemp9 / lattice_triplets.py
Created July 3, 2024 22:46
Generate triplets within lattice
import random
import time
def rolling_hash(rect, prev_hash=0):
base = 256
mod = 2 ** 64 # Large prime to reduce collisions
h = prev_hash
for val in rect:
import numpy as np
import matplotlib.pyplot as plt
# Define the parametric equations
def X(t):
return (4 / 9) * np.sin(2 * t) + (1 / 3) * (np.sin(t) ** 8) * np.cos(3 * t) + (1 / 8) * np.sin(2 * t) * (
np.cos(247 * t) ** 4)
@secemp9
secemp9 / reset_gpu.sh
Created June 29, 2024 10:30
Resetting gpu
#!/bin/bash
unbind_gpu() {
echo "Unbinding NVIDIA driver..."
GPU_PCI=$(lspci | grep -i nvidia | cut -d ' ' -f 1)
for gpu in $GPU_PCI; do
echo -n "0000:$gpu" > /sys/bus/pci/drivers/nvidia/unbind
done
}
@secemp9
secemp9 / is_sorted.py
Created June 19, 2024 14:38
Testing different algorithm for checking if a list is sorted
import itertools
import time
import random
import math
import pandas as pd
def is_sorted_permutation(perm):
for i in range(len(perm)):
for j in range(i, len(perm)):
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
import math
def draw_dotted_sphere(radius, lats, longs):
for i in range(lats):
lat0 = math.pi * (-0.5 + float(i) / lats)
z0 = radius * math.sin(lat0)
@secemp9
secemp9 / git_pass_prompt.sh
Created June 4, 2024 19:40
For making git not use gui password prompt + cache password in memory (mostly for OSX but can be used on Linux too)
git config --global --unset credential.helper osxkeychain
git config --system --unset credential.helper osxkeychain
git config --global --unset credential.helper
git config --system --unset credential.helper
# disable gui prompt
git config --global core.askPass ""
git config --system core.askPass ""
# set up cache
@secemp9
secemp9 / infinite_series_sum.py
Created June 3, 2024 05:23
infinite series example in python code
def sum_series(n):
total_sum = 0
for k in range(1, n + 1):
total_sum += 1 / (2 ** k)
return total_sum
n = 1000 # Number of terms to approximate the sum
result = sum_series(n)
print("Approximate sum of the series:", result)