Skip to content

Instantly share code, notes, and snippets.

View teocci's full-sized avatar
👨‍💻
Coding

Teocci teocci

👨‍💻
Coding
View GitHub Profile
@teocci
teocci / ffmpeg_install_latest.md
Last active September 13, 2023 02:17
Easy way to convert MKV to MP4 with ffmpeg

How to install FFmpeg on Ubuntu

FFmpeg is a free and open source command line tool for transcoding multimedia files. It contains a set of shared audio and video libraries such as: libavcodec, libavformat, and libavutil. With this tool, you can convert between various video and audio formats, set sample rates and resize videos.

In this document will show you how to install a stable version and the latest version of FFmpeg. This instructions apply for any Ubuntu based distribution, including Linux Mint and Elementary OS.

Prerequisites

In order to be able to add new repositories and install packages on your Ubuntu system, you must be logged in as a user with sudo privileges.

Installing FFmpeg 4.x on Ubuntu

(function (global) {
"use strict";
var Typed = function (element, options) {
this.el = document.querySelector(element);
this.options = Object.assign({}, Typed.DEFAULTS, options);
this.isInput = this.el.tagName.toLowerCase() === "input";
this.attr = this.options.attr;
this.showCursor = !this.isInput && this.options.showCursor;
this.elContent = this.attr ? this.el.getAttribute(this.attr) : this.el.textContent;

Here are the charts, followed by some explanations of what they mean.

CIDR SUBNET MASK WILDCARD MASK # OF IP ADDRESSES # OF USABLE IP ADDRESSES
/32 255.255.255.255 0.0.0.0 1 1
/31 255.255.255.254 0.0.0.1 2 2*
/30 255.255.255.252 0.0.0.3 4 2
/29 255.255.255.248 0.0.0.7 8 6
/28 255.255.255.240 0.0.0.15 16 14
/27 255.255.255.224 0.0.0.31 32 30
@teocci
teocci / nginx-rtmp-rtsp.conf
Created June 25, 2019 08:44
Nginx RTMP Setup
rtmp {
access_log /var/log/nginx/rtmp_access.log;
server {
listen 1935;
ping 30s;
notify_method get;
application camera1 {
live on;
exec_pull ffmpeg -i rtsp://admin:admin@10.10.10.11/axis-media/media.amp -threads 2 -f flv -r 25 -s 1280x720 -an rtmp://localhost:1935/cam1/stream 2>>/var/log/nginx/ffmpeg.log;
}
#!/bin/bash
#
# Created by teocci.
#
# @author teocci@yandex.com on 2017-Nov-14
#
# Test an IP address for validity:
# Usage:
# valid_ip IP_ADDRESS
sudo rmmod e1000
sudo rmmod e1000e
sudo rmmod igb
sudo modprobe e1000
sudo modprobe e1000e
sudo modprobe igb
sudo dhclient ens37
#!/bin/sh
set -e
# Docker CE for Linux installation script
#
# See https://docs.docker.com/engine/install/ for the installation steps.
#
# This script is meant for quick & easy install via:
# $ curl -fsSL https://get.docker.com -o get-docker.sh
# $ sh get-docker.sh
#

Introduction

Docker is an application that simplifies the process of managing application processes in containers. Containers let you run your applications in resource-isolated processes. They’re similar to virtual machines, but containers are more portable, more resource-friendly, and more dependent on the host operating system.

For a detailed introduction to the different components of a Docker container, check out The Docker Ecosystem: An Introduction to Common Components.

Prerequisites

To follow this tutorial, you will need the following:

One Ubuntu 20.04 server set up by following the Ubuntu 20.04 initial server setup guide, including a sudo non-root user and a firewall.

@teocci
teocci / wait-groups.go
Created March 5, 2023 16:13
Playing with WaitGroup in nested goroutines
package main
import (
"crypto/rand"
"fmt"
"math/big"
"os"
"sync"
"time"
)
@teocci
teocci / go-exec-pid-sample.go
Created November 22, 2021 10:46
golang exec run get pid
package main
import (
"bytes"
"context"
"fmt"
"log"
"os"
"os/exec"
"sync"