Skip to content

Instantly share code, notes, and snippets.

Brainiarc7 /
Last active Sep 8, 2022
See the supported NVENC and NPP capabilities in your FFmpeg build

Quickly check for supported NVENC and NPP hardware acceleration capabilities in FFmpeg on your platform:

Depending on how you built ffmpeg, you may want to check the supported NVENC-based hardware acceleration capabilities in ffmpeg by running:

$ for i in encoders decoders filters; do
    echo $i:; ffmpeg -hide_banner -${i} | egrep -i "npp|cuvid|nvenc|cuda|nvdec"

Sample output (as on my testbed):

flynnduism /
Last active Aug 29, 2015
Custom colour scheme for Slack

I customised Slack with some brand colours:

If you'd like to do the same with yours, follow these steps:

  1. Open Preferences
  2. Select the Sidebar Theme preferences
  3. Reveal the custom theme options
  4. Copy in thesecolour values: #DFDFDF,#DFDFDF,#66B6AB,#DFDFDF,#DFDFDF,#2D4A50,#06807F,#FF1B51
progrium /
Last active Sep 16, 2020
Consul health check integration with DataDog
import requests
from checks import AgentCheck
class ConsulCheck(AgentCheck):
def should_check(self):
r = requests.get(self.init_config["consul_url"] + "/v1/agent/self")
if r.status_code != 200:
return False
agent = r.json()
suprememoocow / raid.yml
Created Apr 28, 2014
Setup and initialise a RAID10 array of EC2 EBS volumes using an Ansible playbook
View raid.yml
- action: ec2_facts
- apt: pkg=lvm2 state=present
- apt: pkg=mdadm state=present
- pip: name=boto state=latest
- ec2_vol: instance="{{ hostvars[inventory_hostname]['ansible_ec2_instance-id'] }}"
device_name="{{ item }}"
rcrowley / grace.go
Last active Dec 9, 2021
Graceful stop in Go
View grace.go
package main
import (
ctgswallow / gist:3409231
Created Aug 20, 2012
Create a template within a ruby block
View gist:3409231
ruby_block "create ssh key" do
block do
k = SSHKey.generate(:type => 'RSA', :bits => 1024, :comment => "Postgres Master")
node.set[:postgresql][:pubkey] = k.ssh_public_key
# Much of the DSL disappears in ruby blocks. Here's how to create a template.
rc =, node.cookbook_collection)
t = "/var/lib/postgresql/.ssh/id_rsa"
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

fernandoaleman /
Created Nov 18, 2011
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
# If you get the following response:
View capybara cheat sheet
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')