Skip to content

Instantly share code, notes, and snippets.

{
description = "A very basic flake";
inputs = {
ugit-src = {
url = "github:Bhupesh-V/ugit";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
set -e -o pipefail
# Get the image.
iso=ubuntu-18.04-server-cloudimg-ppc64el.img
if [ ! -f "$iso" ]; then
wget "https://cloud-images.ubuntu.com/releases/18.04/release/${iso}"
fi
img=ubuntu-18.04-server-cloudimg-ppc64le.qcow2
if [ ! -f $img ]; then
qemu-img \
@jbboehr
jbboehr / convert-parser.js
Last active April 27, 2020 22:53
handlebars-spec-translator
var inputFile = process.argv[2] || process.argv[1];
var acorn = require('acorn');
var walk = require('acorn-walk');
var fs = require('fs');
var assert = require('assert');
var escodegen = require('escodegen');
var path = require('path');
var inputText = fs.readFileSync(inputFile).toString();

Keybase proof

I hereby claim:

  • I am jbboehr on github.
  • I am jbboehr (https://keybase.io/jbboehr) on keybase.
  • I have a public key whose fingerprint is F6B5 3122 5824 4E00 C398 A9D2 37B7 74BD 04F5 0817

To claim this, I am signing this object:

@jbboehr
jbboehr / ffmpeg-hevc-encode-nvenc.md
Created February 23, 2017 21:58
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with a two-pass profile and optional CUVID-based hardware-accelerated decoding.

Encoding high-quality HEVC content in a two-pass manner with FFmpeg - based NVENC encoder on supported hardware:

If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.

Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:

ffmpeg  -i <inputfile> -pass 1 \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload,format=nv12 \

-c:v hevc_nvenc -profile main -preset slow -rc vbr_2pass \

@jbboehr
jbboehr / README.txt
Created January 20, 2017 02:39 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh [email protected]
Run the server in one terminal
go run server.go
@jbboehr
jbboehr / create-all.sh
Created January 20, 2017 02:08 — forked from mark-kubacki/create-all.sh
a dummy Certificate Authority for development and testing
#!/bin/bash
#
# Copyright (c) 2015 W. Mark Kubacki <[email protected]>
# Licensed under the terms of the RPL 1.5 for all usages
# http://www.opensource.org/licenses/rpl1.5
#
set -e -o pipefail
CAsubj="/C=DE/ST=Niedersachsen/L=Hannover/O=Dummy CA/CN=Sign-It-All"
<?php
// @codingStandardsIgnoreStart
$help = array(
'-i, --input' => 'Input file',
'--endpoint' => 'API endpoint',
'--token' => 'Access token',
'--chunk-size' => 'Chunk size',
'--client' => "Client ID",
@jbboehr
jbboehr / translate.go
Created April 27, 2016 20:50 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
See my DASH-IF presentation from October, 2014:
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/
1. encode multiple bitrates with keyframe alignment:
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012.