Skip to content

Instantly share code, notes, and snippets.

View neggles's full-sized avatar
🐈
cat stuff, mostly

Andi Powers-Holmes neggles

🐈
cat stuff, mostly
View GitHub Profile
@will127534
will127534 / imx585.c
Created May 25, 2023 06:31
imx585 v4l2 driver
// SPDX-License-Identifier: GPL-2.0
/*
* A V4L2 driver for Sony imx585 cameras.
*
* Based on Sony imx477 camera driver
* Copyright (C) 2019-2020 Raspberry Pi (Trading) Ltd
*/
#include <asm/unaligned.h>
#include <linux/clk.h>
#include <linux/delay.h>
@charasyn
charasyn / README.md
Created March 18, 2022 17:42
PineNote boot selector Uboot patch

Hello! This gist contains a Python script for extracting and inserting default enviroments from/to a PineNote Uboot image. Hopefully this works but I provide no guarantees. Maybe give it a read-over before running it, don't run code from the internet without knowing what it does, etc...

It also contains a patch for adding a boot "menu" selector based on the contents of a file. It will read mmc0:11:/boot/which_os.txt and based on the first character in that file, boot either Android or Linux. In case of an error, it should fallback to Android. Currently, the details for booting Linux are hard-coded in there to boot from mmc0:11, and it's expecting an extlinux config file in /extlinux/extlinux.conf or /boot/extlinux/extlinux.conf.

Hope this is useful!

@krzys-h
krzys-h / Hyper-V GPU-PV with Linux guest.md
Last active November 14, 2024 18:48
Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Ubuntu 21.04 VM with GPU acceleration under Hyper-V...?

Modern versions of Windows support GPU paravirtualization in Hyper-V with normal consumer graphics cards. This is used e.g. for graphics acceleration in Windows Sandbox, as well as WSLg. In some cases, it may be useful to create a normal VM with GPU acceleration using this feature, but this is not officially supported. People already figured out how to do it with Windows guests though, so why not do the same with Linux? It should be easy given that WSLg is open source and reasonably well documented, right?

Well... not quite. I managed to get it to run... but not well.

How to do it?

  1. Verify driver support
@apfelchips
apfelchips / Profile.ps1
Last active February 16, 2023 20:19
my crossplatform PowerShell Profile
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# src: https://gist.github.com/apfelchips/62a71500a0f044477698da71634ab87b
# New-Item $(Split-Path "$($PROFILE.CurrentUserCurrentHost)") -ItemType Directory -ea 0; Invoke-WebRequest -Uri "https://git.io/JYZTu" -OutFile "$($PROFILE.CurrentUserCurrentHost)"
# ref: https://devblogs.microsoft.com/powershell/optimizing-your-profile/#measure-script
# ref: Powershell $? https://stackoverflow.com/a/55362991
# ref: Write-* https://stackoverflow.com/a/38527767
# Write-Host wrapper for Write-Information -InformationAction Continue
@snizovtsev
snizovtsev / cdm_fio.sh
Last active February 5, 2024 22:35 — forked from i3v/cdm_fio.sh
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=5 #How many times to run each test
@PhirePhly
PhirePhly / init
Last active December 21, 2020 02:51
Init script to go in the root of a Debian install for booting entirely from the initrd file
#!/bin/sh
# Kenneth Finnegan, 2020
# https://blog.thelifeofkenneth.com/
# Huge thanks to Gandi.net for most of this code
set -x
set -e
# Create the mount points for all of the virtual file systems which don't
# actually map to disks, but are views into the kernel
@lukas2511
lukas2511 / meraki-init.sh
Last active July 10, 2024 05:20
Meraki MS220-8P config without cloud bullshit
#!/bin/sh
# This script configures a meraki ms220-8p switch completely from scratch
# See https://leo.leung.xyz/wiki/Meraki_MS220-8P for rooting instructions
# You can keep config and config.local completely empty, but i'd recommend to add a configuration
# which isolates all ports from each other.
# Without that you might have switching loops on bootup (unlikely since STP keeps longer to initialize
# than it takes this script to take over, but it just feels cleaner).
@IanColdwater
IanColdwater / twittermute.txt
Last active October 13, 2024 04:40
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@zuphilip
zuphilip / README.md
Last active September 8, 2021 00:29
Tesseract IPython Notebook

Binder

@thedroidgeek
thedroidgeek / nokia-router-cfg-tool.py
Last active November 10, 2024 16:38
Nokia/Alcatel-Lucent router backup configuration tool
#!/usr/bin/env python3
#
# Nokia/Alcatel-Lucent router backup configuration tool
#
# Features:
# - Unpack/repack .cfg files generated from the backup and restore functionnality
# in order to modify the full router configuration
# - Decrypt/encrypt the passwords/secret values present in the configuration