Skip to content

Instantly share code, notes, and snippets.

@Donmclean
Donmclean / Shell_ffmpeg_stream.sh
Last active Sep 18, 2021
Shell Stream audio with ffmpeg
View Shell_ffmpeg_stream.sh
ffmpeg -re -i INPUT -acodec libmp3lame -ab 160k -ar 44100 -f rtp rtp://host:port
#list device audio & video inputs
ffmpeg -f avfoundation -list_devices true -i ""
#stream from device audio & video inputs to rtmp
ffmpeg -f avfoundation -framerate 30 -i "0:2" -vcodec libx264 -tune zerolatency -s 1440x900 -acodec libmp3lame -f flv -strict -1 rtmp://host:port
#stream from audio inputs ONLY to rtmp
ffmpeg -f avfoundation -framerate 30 -i ":2" -acodec libmp3lame -f flv -strict -1 rtmp://host:port/live/$stream_name
@r3mcos3
r3mcos3 / heating.yaml
Created Dec 24, 2020
Home Assistant Blueprint For Heating
View heating.yaml
blueprint:
name: Heating Control
description: Control your heating with options for person home, if temp is below a specific value, set temp, and heating between specific times.
domain: automation
input:
heating:
name: Climate Device
description: The climate device to use.
selector:
entity:
@gasgasalterego
gasgasalterego / keepalived.conf
Created Jul 26, 2016
KeepAlived configuration for automatic switch of virtual IP between two MySQL instances configured in Master/Slave and with circular replica.
View keepalived.conf
##############################################################################################################################################
# This configuration needs 2 fails in order to change from current state to FAULT state and needs 2 success to change from BACKUP state to
# MASTER state.
#
# !!!MOST IMPORTANT!!!
# BEFORE keepalived can be started this file must be poperly edited (see HOW TO section below)
#
# HOW TO
# 1 - Check all the parameters of the script(s) in the "vrrp_script check_mysql" section below are correct
# 2 - unicast_src_ip (IP of the local machine) must be manually edited
@nathzi1505
nathzi1505 / opencv-4.2.0-cuda-10.1-Ubuntu-20.04.md
Last active Sep 18, 2021
Step-by-Step Guide to build OpenCV 4.2.0 with CUDA 10.1 on Ubuntu 20.04
View opencv-4.2.0-cuda-10.1-Ubuntu-20.04.md

How to install OpenCV 4.2.0 with CUDA 10.1 on Ubuntu 20.04 LTS (Focal Fossa)

Install updates and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Install required libraries:

@kuntalchandra
kuntalchandra / flatten_binary_tree.py
Created Aug 4, 2020
Flatten Binary Tree to Linked List
View flatten_binary_tree.py
"""
Given a binary tree, flatten it to a linked list in-place.
For example, given the following tree:
1
/ \
2 5
/ \ \
3 4 6
@ihoromi4
ihoromi4 / seed_everything.py
Created Feb 5, 2020
pytorch - set seed everything
View seed_everything.py
def seed_everything(seed: int):
import random, os
import numpy as np
import torch
random.seed(seed)
os.environ['PYTHONHASHSEED'] = str(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
@tobia
tobia / cto_line.pine
Last active Sep 18, 2021
CTO Line indicator for TradingView
View cto_line.pine
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)
@Integ
Integ / unwxapkg.py
Last active Sep 18, 2021 — forked from feix/unwxapkg.py
A useful tool for unpack wxapkg file with python3 surport.
View unwxapkg.py
# coding: utf-8
# py2 origin author lrdcq
# usage python3 unwxapkg.py filename
__author__ = 'Integ: https://github.com./integ'
import sys, os
import struct
class WxapkgFile(object):
View unwxapkg.py
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
@YouEclipse
YouEclipse / πŸ“Š Weekly development breakdown
Last active Sep 18, 2021
πŸ“Š Weekly development breakdown
View πŸ“Š Weekly development breakdown
Go πŸ•“ 17h3m β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 51.5%
XML πŸ•“ 7h30m β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 22.6%
PHP πŸ•“ 6h8m β–ˆβ–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 18.5%
Protocol Buffer πŸ•“ 1h50m β–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 5.6%
Bash πŸ•“ 13m ▏░░░░░░░░░░░░░░░░░░░░░░ 0.7%