Skip to content

Instantly share code, notes, and snippets.

@krzys-h
krzys-h / Hyper-V GPU-PV with Linux guest.md
Last active April 17, 2025 04:55
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
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@fabiolimace
fabiolimace / CombUuidCreator.java
Last active July 14, 2023 01:03
Generates COMB UUID/GUID in Java
package your.package.name;
import java.security.SecureRandom;
import java.util.Random;
import java.util.UUID;
/**
* A UUID generator that creates COMB UUIDs.
*
* The COMB UUIDs combine the creation time and random bytes.
@briandominick
briandominick / asciidoc-static.adoc
Last active March 31, 2025 03:25
Static Site Generators with AsciiDoc Support

There are 28 static site generators that support AsciiDoc sourcing.

@gecon
gecon / gist:110697309c4903bd76ad0ed658761d34
Last active April 2, 2018 23:43 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 6
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel rpmdevtools pcre-devel
OPENSSL="openssl-1.0.2j"
NGINX_VERSION="1.11.5-1"
rpm -ivh http://nginx.org/packages/mainline/centos/6/SRPMS/nginx-$NGINX_VERSION.el6.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/6/SRPMS/nginx-module-geoip-$NGINX_VERSION.el6.ngx.src.rpm
rpm -ivh http://nginx.org/packages/mainline/centos/6/SRPMS/nginx-module-image-filter-$NGINX_VERSION.el6.ngx.src.rpm
@astromechza
astromechza / cpueater.java
Last active January 4, 2023 09:58
Simple java program for running multi-threaded cpu stress test.
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.LongAdder;
public class Main
{
public static void main(String[] args) throws InterruptedException
{
if (args.length != 1)
@moneytoo
moneytoo / gist:ab3f34e4fddc2110675952f8280f49c5
Last active March 22, 2020 16:05
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7, also available from https://brouken.com/brouken-centos-7-repo/
### No longer needed as of nginx-1.13.6-1.el7_4.ngx.x86_64.rpm from nginx.org
### it was compiled against OpenSSL 1.0.2 from CentoOS 7.4 so it supports ALPN (HTTP2 works)
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel rpmdevtools
OPENSSL="openssl-1.0.2l"
NGINX_VERSION="1.13.5-1"
NJS_VERSION="1.13.5.0.1.13-1"
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active April 7, 2025 13:24
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@Illvili
Illvili / html5mp3.php
Created March 3, 2015 03:44
MW mp3 resolve file url
<?php
if ( ! defined( 'MEDIAWIKI' ) )
die();
/*******************************************************************************
* *
* HTML5MP3 Extension is base on FlashMP3 *
* *
* FlashMP3 Extension by Matthias Korn to embed a flash player with mp3-files *
Wordlist ver 0.732 - EXPECT INCOMPATIBLE CHANGES;
acrobat africa alaska albert albino album
alcohol alex alpha amadeus amanda amazon
america analog animal antenna antonio apollo
april aroma artist aspirin athlete atlas
banana bandit banjo bikini bingo bonus
camera canada carbon casino catalog cinema
citizen cobra comet compact complex context
credit critic crystal culture david delta
dialog diploma doctor domino dragon drama