Skip to content

Instantly share code, notes, and snippets.

#!/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 / 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
@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 / 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 / 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 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created February 14, 2019 16:30 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

Enable overrides for missing ACS capabilities (4.10+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index be7c0d9506b1..97081bbc9a4e 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2829,6 +2829,15 @@
 		nomsi		[MSI] If the PCI_MSI kernel config parameter is
 				enabled, this kernel boot option can be used to
 				disable the use of MSI interrupts system-wide.

KVM OSX Guest 10.11 (El Capitan) with Clover

  • Some notes about this approach:
    • An OSX Installer USB drive for Install OS X El Capitan is created
    • Clover is then installed on the USB drive
    • Clover Configurator is then run on the USB drive
    • The USB drive contents are copied to the VM host
    • VNC is used to connect to the guest UI
  • The qxl virtual video device is used (part of the standard kvm qemu install)
@bitraft
bitraft / i7-7700k-igd-passthrough.xml
Created April 17, 2017 13:16 — forked from kylemanna/i7-7700k-igd-passthrough.xml
KVM + QEMU IGD Passthrough with ASRock Z270 Taichi + i7-7700k
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>Win10-IGD</name>
<uuid>YOUR-UUID</uuid>
<memory unit='KiB'>5939200</memory>
<currentMemory unit='KiB'>5939200</currentMemory>
<memoryBacking>
<hugepages/>
</memoryBacking>
<vcpu placement='static'>4</vcpu>
<os>
@bitraft
bitraft / ss_att2.py
Created September 2, 2016 04:19
Shadowsocks attack
#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''
Copyleft (c) 2015 breakwa11
https://github.com/breakwa11/shadowsocks-rss
'''
import logging
import socket