Skip to content

Instantly share code, notes, and snippets.

View eshack94's full-sized avatar

Elijah Shackelford eshack94

View GitHub Profile
@eshack94
eshack94 / jenkins-pipeline-cheat-sheet.md
Created January 2, 2019 17:41 — forked from michaellihs/jenkins-pipeline-cheat-sheet.md
Jenkins Pipeline Plugin Cheat Sheet

Jenkins Pipeline Plugin Cheat Sheet

My collection of useful hints and snippets for the Jenkins Pipeline Plugin

Testing Jenkins Pipelines

@eshack94
eshack94 / gist:e41d390ef863dca242050444c4e4e710
Created January 2, 2019 16:33 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@eshack94
eshack94 / ubuntu-dev-setup.md
Created December 30, 2018 09:58 — forked from caulagi/ubuntu-dev-setup.md
Install necessary packages on a fresh Ubuntu box

Base steps

# Enable multiverse repository
sudo sed -i "/^# deb.*multiverse/ s/^# //" /etc/apt/sources.list

sudo apt-get update
sudo apt-get upgrade -y

export LANGUAGE=en\_US.UTF-8
@eshack94
eshack94 / README.md
Created December 6, 2018 20:39 — forked from soxofaan/README.md
Simple pretty CSV and TSV file viewer.
@eshack94
eshack94 / pyvenvex.py
Created November 9, 2018 21:56 — forked from vsajip/pyvenvex.py
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages. The script needs Python 3.3 or later; invoke it using "python pyvenvex.py -h"…
#
# Copyright (C) 2013 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve
@eshack94
eshack94 / bash-cheatsheet.sh
Created November 6, 2018 18:42 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@eshack94
eshack94 / cleanup_docker.sh
Created October 26, 2018 15:30 — forked from ralphtheninja/cleanup_docker.sh
Cleanup and reset docker on Jenkins workers / slaves
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.
@eshack94
eshack94 / docker-cleanup.groovy
Created October 26, 2018 15:30 — forked from rcbop/docker-cleanup.groovy
Jenkins pipeline script for Docker cleanup (remove dangling images and exited containers) in a given build agent
node("${params.BUILD_AGENT}") {
stage('Dangling Containers') {
sh 'docker ps -q -f status=exited | xargs --no-run-if-empty docker rm'
}
stage('Dangling Images') {
sh 'docker images -q -f dangling=true | xargs --no-run-if-empty docker rmi'
}
@eshack94
eshack94 / ffmpeg-hevc-encode-nvenc.md
Created October 10, 2018 00:20
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with an optional CUVID-based hardware-accelerated decoder.

Encoding high-quality HEVC content 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>  \
-filter:v scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos \

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

@eshack94
eshack94 / hevc_nvenc
Created October 10, 2018 00:20 — forked from nico-lab/hevc_nvenc.txt
ffmpeg -h encoder=hevc_nvenc
Encoder hevc_nvenc [NVIDIA NVENC hevc encoder]:
General capabilities: delay
Threading capabilities: none
Supported pixel formats: yuv420p nv12 p010le yuv444p yuv444p16le bgr0 rgb0 cuda d3d11
hevc_nvenc AVOptions:
-preset <int> E..V.... Set the encoding preset (from 0 to 11) (default medium)
default E..V....
slow E..V.... hq 2 passes
medium E..V.... hq 1 pass
fast E..V.... hp 1 pass