Skip to content

Instantly share code, notes, and snippets.

View pgaskin's full-sized avatar
💭
busy for a week or two

Patrick Gaskin pgaskin

💭
busy for a week or two
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;
@pgaskin
pgaskin / fedora-37-systemd-boot.md
Last active January 28, 2023 00:00
Using systemd-boot on Fedora 37.

Using systemd-boot on Fedora 37

If doing a fresh install, start with an EFI system partition and an ext4 /boot/ partition.

  1. Remove unnecessary packages.

    rm -rf /etc/dnf/protected.d/{grub,shim}*
    dnf remove grubby grub2\* shim\*
@wyatt8740
wyatt8740 / ff88_view_image_in_current_tab.patch
Last active April 29, 2021 11:21
View image in current tab FF 88 (revert mercurial commit 642068)
diff -r f7c3a7daf522 -r 2823dcb7e532 browser/base/content/browser-context.inc
--- a/browser/base/content/browser-context.inc Thu Mar 11 19:54:41 2021 +0000
+++ b/browser/base/content/browser-context.inc Thu Mar 11 19:36:20 2021 +0000
@@ -164,11 +164,11 @@
data-l10n-id="main-context-menu-image-reload"
oncommand="gContextMenu.reloadImage();"/>
<menuitem id="context-viewimage"
- data-l10n-id="main-context-menu-image-view-new-tab"
+ data-l10n-id="main-context-menu-image-view"
oncommand="gContextMenu.viewMedia(event);"

vncviewer-android-patch

This script patches VNC Viewer 3.7.1.44443.

Patches

  • Fix double-backspace bug on certain keyboards (e.g. recent GBoard versions).
  • Write all log messages to logcat (for debugging, since the default file log option doesn't include all log messages, e.g. key/mouse events).

Requirements

  • Java 1.8+
  • APKTool v2.5.0+
@rmi1974
rmi1974 / conversion_of_wine_builtins_to_pe_format.md
Last active January 21, 2023 05:16
Conversion of Wine builtins to PE format #wine #mingw #llvm #gcc #pe #elf #commandlinefu

Conversion of Wine builtins to PE format

Status of Conversion

List of Wine builtin fake executables in Wine installation as of Wine 7.16:

mainline-install-7.16-x86_64/lib/wine/x86_64-windows/openal32.dll
mainline-install-7.16-x86_64/lib/wine/x86_64-windows/opengl32.dll
mainline-install-7.16-x86_64/lib/wine/i386-windows/openal32.dll
@jigpu
jigpu / crypt-squashfs.sh
Created October 29, 2019 18:03
LUKS encrypt a squashfs disk image
#!/bin/sh
# https://martin.elwin.com/blog/2008/05/backups-with-squashfs-and-luks/
set -e
SQUASHFS_IMG="$1"
LUKS_IMG="$2"
CRYPTNAME=mkcrypt-$RANDOM
CRYPTDEV="/dev/mapper/$CRYPTNAME"
@frostschutz
frostschutz / input-event-codes.sh
Created July 20, 2019 18:32
Kobo input-event-test
#!/bin/bash
#
# parse input-event-codes.h and build "number -> name" mapping
#
parse_prefix() {
prev=-1
grep -F "#define ${1}_" /usr/include/linux/input-event-codes.h |
while read define name value comment
@pingbird
pingbird / armasm.dart
Created May 9, 2018 09:09
Little ARM assembler in dart
// By PixelToast
var src =
"mov r0, #69\n"
"bx lr\n"
"ldmedeq ip!, {a3-sp}\n"
"strbhi r13, [v2, lr, asr #3]!\n"
"ldrls a3, [sb], sp, asr #0x14\n";
main() {
@owulveryck
owulveryck / AAaa note.md
Last active January 10, 2024 08:24
havre / a docker like that runs an embedded squashfs image

About

This is a proof of concept of a portable operating system a-la-docker.

It is a single binary that contains an image of an OS in SquashFS and the binary to run it.

a make will build the binary with an embedded alpine image. make havre-xenial will build a binary with an embedded ubuntu image.

What does the binary do?