Skip to content

Instantly share code, notes, and snippets.

@Brainiarc7
Brainiarc7 / nvenc-capabilities-ffmpeg.md
Last active Sep 8, 2022
See the supported NVENC and NPP capabilities in your FFmpeg build
View nvenc-capabilities-ffmpeg.md

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"
done

Sample output (as on my testbed):

@flynnduism
flynnduism / barricade-slack-theme.md
Last active Aug 29, 2015
Custom colour scheme for Slack
View barricade-slack-theme.md

I customised Slack with some brand colours:

https://hostr.co/file/mZiBr4LS0mCK/ScreenShot2015-04-07at10.16.43AM.png

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
progrium / consul.py
Last active Sep 16, 2020
Consul health check integration with DataDog
View consul.py
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
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'] }}"
volume_size=20
device_name="{{ item }}"
@rcrowley
rcrowley / grace.go
Last active Dec 9, 2021
Graceful stop in Go
View grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
@ctgswallow
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
node.save
# Much of the DSL disappears in ruby blocks. Here's how to create a template.
rc = Chef::RunContext.new(node, node.cookbook_collection)
t = Chef::Resource::Template.new "/var/lib/postgresql/.ssh/id_rsa"
t.source("id_rsa.erb")
@piscisaureus
piscisaureus / pr.md
Created Aug 13, 2012
Checkout github pull requests locally
View pr.md

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 = git@github.com:joyent/node.git

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
fernandoaleman / rpm-digital-signature.sh
Created Nov 18, 2011
How to sign your custom RPM package with GPG key
View rpm-digital-signature.sh
# 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
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')