Skip to content

Instantly share code, notes, and snippets.

View stoyanovgeorge's full-sized avatar
🎯
Focusing

Georgi Stoyanov stoyanovgeorge

🎯
Focusing
  • Techtriq GmbH
  • Germany
View GitHub Profile
@stoyanovgeorge
stoyanovgeorge / mc_join
Created July 17, 2019 12:49
Join Multicast addresses over IGMP
The join command requires smcroute package to be installed
You can install it by executing:
sudo apt install smcroute
sudo smcroutectl join <interface> <mc_address>
where:
1. <interface> is the interface on which the MC traffic should be present
@stoyanovgeorge
stoyanovgeorge / mc_routing.sh
Last active July 17, 2019 12:52
Creates a multicast routing after the user inputs a valid network interface and then it lists the routing table.
#!/bin/bash
# Creating an array containing all network interfaces which are up
net_array=()
for iface in $(ifconfig | cut -d ' ' -f1| tr ':' '\n' | awk NF)
do
net_array+=("$iface")
done
unset "net_array[${#net_array[@]}-1]"
@stoyanovgeorge
stoyanovgeorge / proc_monitor.sh
Created February 15, 2019 12:52
Python3 script monitoring if a process is running and logging the time when the process has stopped. It works for one or multiple instances of the same process.
#!/usr/bin/env python3
''' Script checking if a pre-defined process is running '''
import subprocess
import shlex
import time
import datetime
import psutil
import os
@stoyanovgeorge
stoyanovgeorge / cpu_usage.sh
Created August 21, 2019 14:49
Print the total CPU usage in the terminal and updates its value every second.
#!/bin/bash
# Created by Paul Colby (http://colby.id.au)
# Further edited by Georgi Stoyanov (http://gstoyanov.com), no rights reserved ;)
PREV_TOTAL=0
PREV_IDLE=0
# Determinining the number of CPU cores
CPU_CORES=$(nproc --all)
@stoyanovgeorge
stoyanovgeorge / fullscreen_rofi.rasi
Created April 2, 2020 12:46
Publishing my Rasi theme. Very simple, but at the same time elegant.
configuration {
show-icons: false;
sidebar-mode: false;
}
* {
// Default bg is transparent.
background-color: transparent;
// Default text is white
text-color: white;
@stoyanovgeorge
stoyanovgeorge / graylog_nginx_config
Last active June 29, 2020 08:32
Working Graylog NGINX configuration file
$ cat /etc/nginx/snippets/graylog_self-signed.conf
ssl_certificate /etc/ssl/certs/graylog-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/graylog-selfsigned.key;
####################################################################################
$ cat /etc/nginx/snippets/graylog_ssl-params.conf
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/dhparam.pem;
@stoyanovgeorge
stoyanovgeorge / srt-live-transmit-customization
Created July 7, 2020 13:44
SRT Customization Parameters
$ cat /proc/sys/net/core/rmem_max
212992
$ sudo sysctl -w net.core.rmem_max=26214400
net.core.rmem_max = 26214400
$ cat /proc/sys/net/core/rmem_max
26214400
./srt-live-transmit "udp://:4200?rcvbuf=67108864" srt://192.168.0.10:4200 -v
@stoyanovgeorge
stoyanovgeorge / .xprofile
Created September 28, 2020 17:41
Change automatically resolution
#!/bin/sh
xrandr --newmode "3440x1440_44.00" 299.75 3440 3664 4024 4608 1440 1443 1453 1479 -hsync +vsync
xrandr --addmode HDMI-1-1 3440x1440_44.00
xrandr --output eDP-1-1 --off --output HDMI-1-1 --mode 3440x1440_44.00 --pos 0x0 --rotate normal
#!/bin/bash
ffmpeg -re -analyzeduration 100M -probesize 100M -stream_loop -1 -i <input_file.ts> \
-vf setdar=16/9 -f decklink -pix_fmt uyvy422 -format_code pal "DeckLink Mini Monitor"
@stoyanovgeorge
stoyanovgeorge / ffmpeg_stream_check.ts
Last active January 3, 2022 16:40
Records 10 seconds of an UDP multicast stream and then it shows the stream settings using mediainfo. Requires medianfo and ffmpeg installed on the host
#!/bin/bash
stream=""
recording_dir=$HOME/recordings
while [[ ! $stream =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9] ]];
do
echo "Please enter a valid multicast address and port in the format: IP.AD.DR.ESS:PORT after the script name!"
read -r stream
done