Skip to content

Instantly share code, notes, and snippets.

@javikalsan
javikalsan / worker.js
Created January 24, 2022 22:44 — forked from tobiaslins/worker.js
Notion Custom Domain using Cloudflare Workers + Splitbee Analytics
const MY_DOMAIN = "help.splitbee.io"
const START_PAGE = "https://www.notion.so/splitbee/Help-Center-bbf26e2b70574901b9c98e5d11e449de"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
const MY_DOMAIN = "fka.dev"
const NOTION_MAIL = "fatihkadirakin@aof.anadolu.edu.tr"
const START_PAGE = "https://www.notion.so/fkadev/fka-dev-0606b67bc0f14660992362682d6f7eda"
const DISQUS_SHORTNAME = "fkadev"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
@javikalsan
javikalsan / ffmpeg-multi-instances-xargs.md
Created October 10, 2020 22:58 — forked from Brainiarc7/ffmpeg-multi-instances-xargs.md
This gist will show you how to launch multiple ffmpeg instances with xargs, very useful for NVIDIA NVENC based encoding where standard GPUs limit the maximum simultaneous encode sessions to two.

Spawning multiple ffmpeg processes with xargs:

On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:

$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
  xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"

This will find all files with the ending .avi in the directory Videos/ and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2 to xargs, which starts up to two processes in parallel.