Skip to content

Instantly share code, notes, and snippets.

View krzemienski's full-sized avatar

Nick Krzemienski krzemienski

View GitHub Profile
@krzemienski
krzemienski / notion-custom-domain.js
Created December 5, 2019 10:59 — forked from mayneyao/notion2blog.js
notion.so custom domain
const MY_DOMAIN = "your domain"
const START_PAGE = "start page url"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@krzemienski
krzemienski / compile-ffmpeg-nvenc.sh
Created January 13, 2020 15:24
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@krzemienski
krzemienski / logging_subprocess.py
Created February 24, 2020 18:46 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.
@krzemienski
krzemienski / build-install-vmaf-ffmpeg-nvenc-bento4.sh
Created March 31, 2020 12:38
compile and configure bento4 & ffmpeg w/ nvenc vmaf 8-12bit x265
#!/bin/bash
set -e
FFMPEG_VERSION=snapshot
AOM_VERSION=v1.0.0
FDKAAC_VERSION=0.1.5
FONTCONFIG_VERSION=2.12.4 \
FREETYPE_VERSION=2.5.5 \
FRIBIDI_VERSION=0.19.7 \
@krzemienski
krzemienski / backup-github.sh
Created May 15, 2020 12:01 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@krzemienski
krzemienski / backup-github.sh
Created May 15, 2020 12:01 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@krzemienski
krzemienski / waifu2x_VMAF_measurement.sh
Created June 3, 2020 15:07 — forked from thebitbytebit/waifu2x_VMAF_measurement.sh
Waifu2x scaling up vs. Bilinear vs. Bicubic objective measurement
#!/bin/sh
## Christopher Kennedy Feb 2020
## Crunchyroll Waifu2x upscaling objective measurement
##
## Note you must install waifu2x and run this in the waifu2x directory,
## plus have an FFmpeg with VMAF enabled (must build from scratch)
##
## Dependencies:
## https://ffmpeg.org
@krzemienski
krzemienski / build-and-install-latest-bento4.sh
Created June 7, 2020 19:43
Build and install master branch of bento4
#!/bin/bash
BENTO4_INSTALL_DIR=/opt/bento4
export PATH=/opt/bento4/bin:${PATH}
LD_LIBRARY_PATH=/usr/local/lib64
# Fetch source.
cd /tmp/ \
&& git clone https://github.com/axiomatic-systems/Bento4.git
# Create installation directories.
@krzemienski
krzemienski / ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
Created July 26, 2020 14:15 — forked from SeanMollet/ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
This gist will generate an Intel QSV-enabled FFmpeg build using the open source Intel Media SDK. Testbed used: Ubuntu 18.04LTS. A fallback is also provided for the intel vaapi driver where needed.

Build FFmpeg with Intel's QSV enablement on an Intel-based validation test-bed:

Build platform: Ubuntu 18.04LTS

Ensure the platform is up to date:

sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade

Install baseline dependencies first (inclusive of OpenCL headers+)

@krzemienski
krzemienski / ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
Created July 26, 2020 14:15 — forked from Brainiarc7/ffmpeg-qsv-enabled-build-ubuntu-18.04lts-testbed.md
This gist will generate an Intel QSV-enabled FFmpeg build using the open source Intel Media SDK. Testbed used: Ubuntu 18.04LTS. A fallback is also provided for the intel vaapi driver where needed.

Build FFmpeg with Intel's QSV enablement on an Intel-based validation test-bed:

Build platform: Ubuntu 18.04LTS

Ensure the platform is up to date:

sudo apt update && sudo apt -y upgrade && sudo apt -y dist-upgrade

Install baseline dependencies first (inclusive of OpenCL headers+)