Skip to content

Instantly share code, notes, and snippets.

@bitraft
bitraft / ffmppeg-advanced-playbook-nvenc-and-libav-and-vaapi.md
Created February 16, 2019 07:44 — forked from Brainiarc7/ffmppeg-advanced-playbook-nvenc-and-libav-and-vaapi.md
FFMpeg's playbook: Advanced encoding options with hardware-accelerated acceleration for both NVIDIA NVENC's and Intel's VAAPI-based hardware encoders in both ffmpeg and libav.

FFmpeg and libav's playbook: Advanced encoding options with hardware-based acceleration, NVIDIA's NVENC and Intel's VAAPI-based encoder.

Hello guys,

Continuing from this guide to building ffmpeg and libav with NVENC and VAAPI enabled, this snippet will cover advanced options that you can use with ffmpeg and libav on both NVENC and VAAPI hardware-based encoders.

For ffmpeg:

@bitraft
bitraft / ffmpeg-vp8&9-encode-test-vaapi-intel.md
Created March 1, 2019 09:13 — forked from Brainiarc7/ffmpeg-vp8&9-encode-test-vaapi-intel.md
PSA: You can now use FFmpeg's VAAPI-based VP8 and VP9 encoder on Skylake+ systems on Linux: Tested on Ubuntu 16.04LTS

Build VAAPI with support for VP8/9 decode and encode hardware acceleration on a Skylake validation testbed:

Build platform: Ubuntu 16.04LTS.

First things first:

Install baseline dependencies first

sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev intel-gpu-tools

@bitraft
bitraft / cowroot.c
Created May 26, 2019 16:21 — forked from rverton/cowroot.c
CVE-2016-5195 (DirtyCow) Local Root PoC
/*
* (un)comment correct payload first (x86 or x64)!
*
* $ gcc cowroot.c -o cowroot -pthread
* $ ./cowroot
* DirtyCow root privilege escalation
* Backing up /usr/bin/passwd.. to /tmp/bak
* Size of binary: 57048
* Racing, this may take a while..
* /usr/bin/passwd overwritten
@bitraft
bitraft / dell-h310.md
Created November 25, 2019 10:39 — forked from woble/dell-h310.md
Flashing Dell PERC H310 to IT mode

If you have a Dell Perc H310 and your computer won't boot then you'll need to cover PCIe pins B5 and B6. You can cover them with a thin piece of electrical tape.

H310 DOS

  1. megacli.exe -AdpAllInfo -aAll -page 20 Write down SAS address.
  2. megarec.exe -writesbr 0 sbrempty.bin If this fails move on to next step.
  3. megarec.exe -cleanflash 0 Reboot.
  4. sas2flsh.exe -o -f 6GBPSAS.fw Reboot.
  5. sas2flsh.exe -o -f 2118it.bin
  6. s2fp19.exe -o -sasadd 500xxxxxxxxxxxxx
#!/bin/bash
set -e
if [ $(id -u) -eq 0 ]; then
echo 'Please execute this script as a regular user.'
exit 1
fi
which sudo >/dev/null
if [ $? -ne 0 ]; then
@bitraft
bitraft / os-x-enable-trim.md
Created January 1, 2020 04:10 — forked from clarencesong/os-x-enable-trim.md
Enable TRIM in OS X 10.7.5 to 10.9.5

Enable TRIM on non-Apple SSDs in OS X

NOTE: This is tested on the versions mentioned in the title, and NOT earlier or later versions. YMMV.

Run the following commands in Terminal…

Backup the original driver:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage-backup

Improving heat management after macbookpro 2011 discrete GPU fix, also a script to automate part of the fix process

Taken from StackExchange

Thanks to LangLangC

NOTE: This is experimental; works for some people, not for others

Improved thermal and power management

@bitraft
bitraft / sysctl.conf
Created May 29, 2020 04:09 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2