Skip to content

Instantly share code, notes, and snippets.

View thenadz's full-sized avatar

Dan Rossiter thenadz

View GitHub Profile
@thenadz
thenadz / Headless FFMPEG Build Script (Ubuntu)
Last active January 14, 2022 13:46
Downloads & builds headless FFMPEG along with all dependencies in parallel, enabling all features
#!/bin/bash -e
# Distro: Ubuntu 14.04.2 LTS
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
# Builds the dependencies in parallel prior to starting FFmpeg build.
sudo apt-get update
sudo apt-get -y --force-yes install \
autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@thenadz
thenadz / FFmpeg Build Script (Amazon Linux)
Last active January 30, 2020 20:57
Downloads & builds FFmpeg along with all dependencies in parallel, enabling all features
#!/bin/bash -e
# Distro: Amazon Linux AMI release 2015.03
# Derived from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# Builds the dependencies in parallel prior to starting FFmpeg build.
sudo yum update -y
sudo yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel yasm libogg libvorbis-devel libvpx-devel
@thenadz
thenadz / RandomNameGenerator.java
Last active November 16, 2015 02:43
Random name generator based on most common first/last names. 2 million possible first/last name combinations.
import java.util.Random;
public final class RandomNameGenerator {
/**
* Get a random full name.
* @param rand The rand instance.
* @return The full name.
*/
public static String getFullName(Random rand) {
return getFirstName(rand) + " " + getLastName(rand);
@thenadz
thenadz / RandomCourseNameGenerator.java
Created November 16, 2015 02:49
Randomly returns 1 of over 2000 courses in The University of Texas at San Antonio's Spring 2016 course catalog.
import java.util.Random;
public final class RandomCourseNameGenerator {
/**
* Get random course name from The University of Texas at San Antonio Spring 2016 course catalog.
* @param rand The rand instance.
* @return The course name.
*/
public static String getRandomCourse(Random rand) {
@thenadz
thenadz / install-gm-w-librvg.sh
Last active March 2, 2017 10:05 — forked from whyvez/install-gm-w-librvg.sh
Installs ImageMagick --with-librsvg on Amazon Linux
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
export PATH=/usr/bin:$PATH
export LDFLAGS=-L/usr/lib64:/usr/lib
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
export CPPFLAGS=-I/usr/include
PREFIX=/usr
sudo yum-config-manager --enable epel
sudo yum -y update && sudo yum -y upgrade
@thenadz
thenadz / C# Registry Watcher Class
Last active December 23, 2023 10:29
Class to monitor one or more registry values and notify when value changes.
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
public class Program
{
private const string REG_KEY = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system";