Skip to content

Instantly share code, notes, and snippets.

View antonpetrovmain's full-sized avatar

Anton Petrov antonpetrovmain

View GitHub Profile
@antonpetrovmain
antonpetrovmain / minikube_ssl.sh
Created September 3, 2024 14:37 — forked from tommysdk/minikube_ssl.sh
minikube ssl: add certificate to pull docker images from private docker registry
minikube ssh
docker pull internal.docker.registry/my-image # Error response from daemon: Get https://internal.docker.registry/v2/: x509: certificate signed by unknown authority
sudo mkdir -p /etc/docker/certs.d/internal.docker.registry
sudo cp /etc/ssl/my-cert.crt /etc/docker/certs.d/internal.docker.registry/
docker pull internal.docker.registry/my-image # Status: Downloaded newer image for internal.docker.registry/my-image
<#
.SYNOPSIS
Create a GPU-P Guest driver package.
.DESCRIPTION
Gathers the necessary files for a GPU-P enabled Windows guest to run.
.EXAMPLE
New-GPUPDriverPackage -DestinationPath '.'
.EXAMPLE
New-GPUPDriverPackage -Filter 'nvidia' -DestinationPath '.'
.INPUTS
@antonpetrovmain
antonpetrovmain / Hyper-V GPU-PV with Linux guest.md
Created July 7, 2024 10:15 — forked from krzys-h/Hyper-V GPU-PV with Linux guest.md
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
@antonpetrovmain
antonpetrovmain / path.md
Created June 22, 2024 03:17 — forked from romainl/path.md
Off the beaten path

Off the beaten path

What is &path used for?

Vim uses :help 'path' to define the root directories from where to search non-recursively for files.

It is used for:

  • gf, gF, <C-w>f, <C-w>F, <C-w>gf, <C-w>gF,
  • :find, :sfind, :tabfind,
@antonpetrovmain
antonpetrovmain / TermuxArchSetup2020.md
Created April 12, 2024 06:06 — forked from RebelLion420/TermuxArchSetup2024.md
How to set up Arch Linux in Termux on Android

So, to get started you need to get the base OS installed using the instructions from the official docs .

$ pkg update

$ pkg install bsdtar wget proot tergent tmux openssh

Tmux is a multiplexer that lets you run multiple persistent windows and sessions on a single terminal. I had trouble getting it working in the Arch proot, so a workaround is configuring tmux from your host Termux and then creating a tmux session and starting the chroot from there. For more information on using tmux read this article, and to learn how to customize the appearance and behaviors more try this one as well as looking at the tmux-plugins Github organization for community-built add-ons.

$ termux-setup-storage

@antonpetrovmain
antonpetrovmain / QWERTY no option.keylayout
Created December 3, 2023 13:42 — forked from greneholt/QWERTY no option.keylayout
Mac QWERTY keyboard layout without bindings for the option key. This disables the annoying default behavior of key combinations like option+i that enters diacritic mode and prevents using such shortcuts in VS Code.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<keyboard group="0" id="5000" name="QWERTY no option" maxout="1">
<layouts>
<layout first="0" last="0" modifiers="48" mapSet="312" />
</layouts>
<modifierMap id="48" defaultIndex="0">
<keyMapSelect mapIndex="0">
<modifier keys="" />
</keyMapSelect>
@antonpetrovmain
antonpetrovmain / latency.txt
Created November 20, 2023 16:21 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@antonpetrovmain
antonpetrovmain / Arch on Mac M1.txt
Created July 29, 2023 20:58 — forked from ReturnRei/Arch on Mac M1.txt
Install Arch / EndeavourOS Mac M1 Parallels
This gist is provided as an addition to my youtube video
https://www.youtube.com/watch?v=dKvetujHjYQ&t=737s
## Useful links
https://wiki.archlinux.org/title/Install_Arch_Linux_from_existing_Linux#Using_a_chroot_environment
https://archlinuxarm.org/platforms/armv8/generic
https://www.reddit.com/r/archlinux/comments/6kwt61/systemd_doesnt_create_machineid_during/
https://arm.endeavouros.com/endeavouros-arm-install/
## Get into chroot
@antonpetrovmain
antonpetrovmain / README.en.md
Created July 29, 2023 13:33 — forked from akihikodaki/README.en.md
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.