Skip to content

Instantly share code, notes, and snippets.

View midi1996's full-sized avatar

Midi midi1996

View GitHub Profile
@pgaskin
pgaskin / fedora-37-vfio-bind.sh
Created January 27, 2023 23:59
Simple early-boot VFIO device binding by PCI address on Fedora 37.
# enable AMD IOMMU with DMA passthrough
# note: iommu=pt is much faster than the default translated DMA since memory access doesn't need to go through the hypervisor
sudo sed -i '1 s/$/ amd_iommu=on iommu=pt/' /etc/kernel/cmdline
# list IOMMU groups
# record the PCI IDs of all devices in the target group
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*};
n=${n%%/*};
test $n -eq $pn || printf '\nIOMMU Group %s\n' $n;
@midi1996
midi1996 / 50-edk2-ovmf-x86_64-secure.json
Last active August 24, 2023 02:19 — forked from Ashymad/PKGBUILD
Slightly updated ovmf-patched-vbios (as of April 2021, now 19 September 2021)
{
"description": "UEFI firmware for x86_64, with Secure Boot and SMM",
"interface-types": [
"uefi"
],
"mapping": {
"device": "flash",
"executable": {
"filename": "/usr/share/edk2-ovmf/x64/OVMF_CODE.secboot.fd",
"format": "raw"
@Dids
Dids / IPA_Install_Apple_Silicon.md
Last active March 18, 2025 06:03
Installing IPAs on the M1

Installing IPAs on Apple Silicon (M1)

  1. Open Apple Configurator 2 and plug in your iPhone or iPad
  2. Click Add, login to the App Store and select the application you want to install
  3. Open up ~/Library/Group\ Containers/K36BKF7T3D.group.com.apple.configurator/Library/Caches/Assets and wait until the TemporaryItems directory appears
  4. Copy the application from the newly created temporary directory, but do note that it will disappear once Apple Configurator is done installing
  5. Double click the .ipa on your Apple Silicon (M1) device and install it
  6. Fix permissions on the installed application by running sudo xattr -rd com.apple.quarantine /Applications/<your_app>.app (if you skip this step, you're unable to start the application)

Note that it's easier if you already have the application installed, as Apple Configurator will prompt you about overwriting the existing installation, at which point the temporary file (the .ipa) will still exist, until you choose an action in the prompt.

@kiler129
kiler129 / prevent-host-driver-in-pci-pass.md
Last active March 26, 2025 17:42
Definitely prevent stubborn devices from being bound by the host driver in PCI passthrough scenario

Scenario

You're running a KVM-based virtualization. You want to do PCI/PCIe passthrough of some device. You don't want it to attach to the host OS at all.

Your device looks like that:

00:1f.2 SATA controller [0106]: Intel Corporation 6 Series/C200 Series Chipset Family SATA AHCI Controller [8086:1c02] (rev 05)
	Subsystem: Hewlett-Packard Company 6 Series/C200 Series Chipset Family 6 port Desktop SATA AHCI Controller [103c:330d]
	Kernel driver in use: ahci
	Kernel modules: ahci
@paulo-amaral
paulo-amaral / finalize_recording.sh
Last active March 28, 2024 05:59
Update the recording file name in Jibri - Part of JITSI MEET
#!/bin/bash
#Script to save records by date to better organize your recordings
#Use on :
#mounted NFS SHARE VIA FSTAB or local folder.
#The folder to save records is configured on Jibri json file (config.json.
#Dependencies : mailutils
RECORDINGS_DIR=$1
# Find latest modified directory
@ld100
ld100 / ArchLinuxWSL2.md
Last active March 24, 2025 13:09
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@ajmassi
ajmassi / LXCBindMount.md
Last active April 13, 2025 21:57
Create a bind mount from a Proxmox host on an unprivileged lxc container

Proxmox Assign Bind Mount To Unprivileged Container

In order for the LXC container to have full access the proxmox host directory, a subgid is set as owner of a host directory, and an ACL is used to ensure permissions.

Bind Mount dataset to LXC

Add the following line to /etc/pve/lxc/<CT_ID>.conf

mp0:/mount/point/on/host,mp=/mount/point/on/lxc

Create group on host

In the default Proxmox configuration, unpriviliged container subgids will have the prefix "10" followed by the expected 4-digit gid.

@travelhawk
travelhawk / ffmpeg_commands.md
Last active March 24, 2025 11:30
Collection of ffmpeg commands (basic usage, streaming, advanced usage)

ffmpeg

ffmpeg is a fast video and audio converter that can also grab from a live audio/video source.

Standard usage

Getting help and information

  • -h show all options
  • -h(elp) topic show help
  • -version show version
  • -formats show available formats
@lac5
lac5 / youtube-anti-anti-afk.meta.js
Last active June 17, 2024 15:04
Stops YouTube from automatically pausing the video.
// ==UserScript==
// @name YouTube - Anti-Anti-AFK
// @namespace larryc5
// @version 1.0
// @description Stops YouTube from automatically pausing the video.
// @author Larry Costigan
// @include /^https?:\/\/(?:[^\/?#]*\.)?youtube.com\/.*$/
// @downloadURL https://gist.githubusercontent.com/larryc5/95c3ae2abbd37b35e2a35ac2c49d9996/raw/youtube-anti-anti-afk.user.js
// @updateURL https://gist.githubusercontent.com/larryc5/95c3ae2abbd37b35e2a35ac2c49d9996/raw/youtube-anti-anti-afk.meta.js
// ==/UserScript==
@pjobson
pjobson / openwrt-on-x86_64.md
Last active February 22, 2025 16:48
OpenWRT on x86_64

OpenWRT on x86_64

This is a very brief tutorial on getting OpenWRT installed on a regular computer, it assumes you know your way around Linux. If you find this and need additional details, please like, subscribe, and comm... oh wait this isn't youtube, just comment.

Updated: Current version is 22.03.5, this was originally written for 18.6.x in 2019.

What You'll Need

  • 1 USB Stick
  • Linux Live ISO