Skip to content

Instantly share code, notes, and snippets.

View sathishrs's full-sized avatar
🏠
Working from home

Sathish sathishrs

🏠
Working from home
View GitHub Profile
#!/bin/bash
# Input file
input_file="${1}"
# Run ffprobe to analyze the input file and capture the output
output=$(ffprobe -v quiet -show_streams -print_format json "$input_file")
# Check if the output contains video and/or audio streams
if [[ $output == *'"codec_type": "video"'* && $output == *'"codec_type": "audio"'* ]]; then
@sathishrs
sathishrs / README.md
Created March 2, 2023 09:50 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
package com.example.MigrationService;
import io.quarkus.arc.Arc;
import io.quarkus.arc.InstanceHandle;
import io.quarkus.flyway.runtime.FlywayContainer;
import io.quarkus.flyway.runtime.FlywayContainerProducer;
import io.quarkus.flyway.runtime.QuarkusPathLocationScanner;
import io.quarkus.runtime.StartupEvent;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.flywaydb.core.Flyway;
@sathishrs
sathishrs / wp-permissions-script
Created July 7, 2022 16:08 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # <-- wordpress owner
WP_GROUP=changeme # <-- wordpress group
WP_ROOT=/home/changeme # <-- wordpress root directory
@sathishrs
sathishrs / axios-catch-error.js
Created November 14, 2021 18:56 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@sathishrs
sathishrs / README.md
Created October 28, 2021 14:04 — forked from zoilomora/README.md
How to disable cloud-init in Ubuntu

How to disable cloud-init in Ubuntu

Prevent start

  • Create an empty file to prevent the service from starting

      sudo touch /etc/cloud/cloud-init.disabled
    

Uninstall

@sathishrs
sathishrs / README.md
Created June 29, 2021 14:29 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@sathishrs
sathishrs / set_irq_affinity.sh
Created April 29, 2021 17:14 — forked from xdel/set_irq_affinity.sh
Sets IRQ affinity on intel NICs, this version handles systems with >32 cores
# setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
# 2009-02-19 updated by Jesse Brandeburg
# 2012-12-21 fix for systems with >32 cores by Andrey K.
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
#char buf[IFNAMSIZ+6];
#
@sathishrs
sathishrs / letsencrypt-jetty.sh
Created August 27, 2020 18:57
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto"
sudo letsencrypt certonly --standalone
sudo su
cd /etc/letsencrypt/live/{domain name}
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
@sathishrs
sathishrs / server-cors.py
Created August 10, 2020 11:49 — forked from mkows/server-cors.py
Allow CORS with python Simple HTTP Server – for Python 3
'''
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3
Usage: python server-cors
'''
import http.server as httpserver
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.