Skip to content

Instantly share code, notes, and snippets.

View N0K0's full-sized avatar
🧑‍🚒
Why can't i hold all these project ideas?

Nikolas N0K0

🧑‍🚒
Why can't i hold all these project ideas?
View GitHub Profile
@k-amin07
k-amin07 / VFIO.md
Last active March 28, 2024 22:15
VFIO Guide for GPU Passthrough

Introduction:

This guide is for achieving PCI-Passthrough with Intel 7700k and AMD RX 580. My host OS is Manjaro KDE edition, and guest is Windows 10.

Hardware:

Device Type Device
CPU Intel Core i7-7700K
Motherboard ASUS Prime Z270P
RAM Corsair Vengeance (DDR4 3000 MHz)
GPU (Host) Intel HD Graphics
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@JaciBrunning
JaciBrunning / usbiommu.rb
Last active May 25, 2024 13:20
USB -> PCIe -> IOMMU viewer for linux
lsusb = `lsusb`.split("\n").reject { |x| x.include?("root") }.map do |e|
ar = e.scan(/Bus (\d+) Device \d+: ID [0-9a-f:]+ (.*)/).flatten
ar[0] = "usb#{ar[0].to_i}"
ar
end
sysbus = `ls -l /sys/bus/usb/devices`.split("\n").map do |e|
e.scan(/(usb\d+) -> .+\/([0-9a-f:\.]+)\/usb\d+/).flatten
end.reject { |x| x.empty? }
@devfelipereis
devfelipereis / README.md
Last active June 28, 2023 16:56 — forked from bvis/README.md
Docker Env Vars expanded with secrets content

Set secrets as env variables in docker

This script will read your secret file and set each line as an env variable in your container.

How to use it

I' assuming that you already has a entrypoint file in your Dockerfile. So now, you need to copy and paste the contents of set_env_secrets.sh to your entrypoint(you don't need the first line).

Now, you need to create a secret, the name could be whatever you like. I'm using the name of my application as a pattern for my secrets name. For this example, my secret name will be super-project and the content will be.

@bvis
bvis / README.md
Last active April 12, 2024 04:21
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables: