Skip to content

Instantly share code, notes, and snippets.

@firelightning13
firelightning13 / [GUIDE] GPU Passthrough for Laptop with Fedora.md
Last active April 18, 2024 23:02
[GUIDE] GPU Passthrough for Laptop with Fedora

Abstract

This is a full guide for people who wanted to setup Windows 10/11 VM with QEMU/KVM hypervisor for laptops that configured with hybrid graphics card like Intel/AMD + NVIDIA. This process will take about 1 to 2 hours, depending on your system's performance.

There is another comprehensive guide you can follow here (shoutout to asus-linux team). It is more up-to-date than mine. I'll probably incorporate those information to my guide, but you are welcome to use this one as a reference!

Before we proceed:

  • This guide is exclusively for Fedora because this distro is quite different to set up than other distro such as Arch. I would say Arch is easier to setup than Fedora, but sometimes your prefer Fedora than Arch in terms of its usage & features.
  • This tutorial mostly focus on laptops with NVIDIA Optimus MUXed configuration when dGPU (dedicated GPU) can connect directly to HDMI/DP output. If in doubt, sea
@imptype
imptype / alt-test.py
Last active April 18, 2024 23:01
Compress text to Unicode text for Discord Custom IDs.
# alternative to convert number strings to printable ascii, for smaller deta base strings, ' ' space reserved
ascii_chars = list(r'''!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~''')
def power_sum(values, base, offset = 0):
return sum(value * base ** (index + offset) for index, value in enumerate(values))
def convert_text(text, chars):
base = len(chars) + 1
chars = {char : index + 1 for index, char in enumerate(chars)}
temp = []
@lontivero
lontivero / userstory.md
Last active April 18, 2024 23:01
Historias de usuario.

Nombre de la historia de usuario

Como un <user, tipo de usuario or stakeholder> Quiero <poder hacer/obtener (una feature)> Tal que <cumplir objetivo (valor de negocio)>

[Cada historia de usuario tiene una razón de ser, un valor que justifica su existencia y, si bien eso puede deducirse de la parte "Tal que", muchas veces se requiere contexto extra y eso debe agregarse aquí.]

@Steveplays28
Steveplays28 / distant_horizons_shader_compatibility_information.md
Last active April 18, 2024 22:57
Distant Horizons shader compatibility info

Distant Horizons shader compatibility information

Distant Horizons v2.0.0 (and up) shader compatibility information.

v2

Prerequisites

  • Iris v1.7.0 or higher, or Oculus v1.6.15aDH or higher
  • Distant Horizons v2.0.2a or higher
kind: Pod
apiVersion: v1
metadata:
name: apple-app
labels:
app: apple
spec:
containers:
- name: apple-app
image: hashicorp/http-echo
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active April 18, 2024 22:56
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@pvinis
pvinis / .zshrc
Created September 27, 2012 01:22
shell recording
# for spyshell
function zshexit() {
cat /Users/`whoami`/.termlogs/`date +%Y-%m-%d`.txt | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b > temp
mv temp /Users/`whoami`/.termlogs/`date +%Y-%m-%d`.txt
exit
}
@carols10cents
carols10cents / c#-to-rust.md
Last active April 18, 2024 22:55
C# to Rust Cheat Sheet

Thanks to @seejee for making this for me!!!

C# to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in C# and Rust so that programmers most comfortable with C# can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

@reluce
reluce / prepare_ubuntu_template.sh
Last active April 18, 2024 22:51
Prepare Ubuntu 22.04 Cloud Image and Template for Proxmox
# All commands will be executed on a Proxmox host
sudo apt update -y && sudo apt install libguestfs-tools -y
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
# Install qemu-guest-agent on the image. Additional packages can be specified by separating with a comma.
sudo virt-customize -a jammy-server-cloudimg-amd64.img --install qemu-guest-agent
# Read and set root user password from file.
sudo virt-customize -a jammy-server-cloudimg-amd64.img --root-password file:password_root.txt
# Create an additional user.
sudo virt-customize -a jammy-server-cloudimg-amd64.img --run-command "useradd -m -s /bin/bash myuser"
# Set password for that user.
@ericmjl
ericmjl / ds-project-organization.md
Last active April 18, 2024 22:44
How to organize your Python data science project

UPDATE: I have baked the ideas in this file inside a Python CLI tool called pyds-cli. Please find it here: https://github.com/ericmjl/pyds-cli

How to organize your Python data science project

Having done a number of data projects over the years, and having seen a number of them up on GitHub, I've come to see that there's a wide range in terms of how "readable" a project is. I'd like to share some practices that I have come to adopt in my projects, which I hope will bring some organization to your projects.

Disclaimer: I'm hoping nobody takes this to be "the definitive guide" to organizing a data project; rather, I hope you, the reader, find useful tips that you can adapt to your own projects.

Disclaimer 2: What I’m writing below is primarily geared towards Python language users. Some ideas may be transferable to other languages; others may not be so. Please feel free to remix whatever you see here!