Skip to content

Instantly share code, notes, and snippets.

View onomatopellan's full-sized avatar

onomatopellan

View GitHub Profile
@a-r-d
a-r-d / convert-and-split.sh
Last active August 2, 2023 20:46
How to take an annoying APE + CUE file cd rip and convert it into a set of FLAC or MP3 files on ubuntu.
#first install all the things:
sudo apt-get install flac ffmpeg mp3splt libav-tools shntool
# Okay first lets do an MP3:
# input files:
# --> cd.ape
# --> cp.cue
# (there are other options, like bitrate, but this is just the bare bones)
avconv -i cd.ape cd.mp3
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active July 3, 2024 20:33
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@MarioHewardt
MarioHewardt / enable_ebpf_on_wsl2
Last active June 13, 2024 05:44
Enable EBPF on WSL2
By default, EBPF programs will not run on WSL2 due to required kernel modules missing. The following example error is an
indication of this problem:
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.19.84-microso
ft-standard/modules.dep.bin'
modprobe: FATAL: Module kheaders not found in directory /lib/modules/4.19.84-microsoft-standard
chdir(/lib/modules/4.19.84-microsoft-standard/build): No such file or directory
To fix this you need to rebuild the WSL2 kernel with the missing kernel modules. The below instructions are for Ubuntu 18.04 WSL2.
1. git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
[wsl2]
kernel=C:\\Users\\JAKA\\vmlinux
@datocrats-org
datocrats-org / setupDevEnv_workaroundWSL2vhdxLimit.md
Last active July 5, 2024 14:47
Backup and restore WSL2 vhdx, avoid 256GB vhdx limit for docker desktop WSL2 native

Backup and restore WSL2 vhdx, avoid 256GB vhdx limit for docker desktop WSL2 native

Review all steps to view the symptom this Gist addresses, customize a workaround to allow for >256GB Docker pulls safely on Windows, then perform a backup and recovery of the result (export and import). Please provide comments on any failures.

Determine the expected size of the docker-desktop-data volume

  • Get the base image size + additional + all docker volumes using docker system df
  • Add raw uncompressed size for alpine (50MB), docker for your version of windows (700MB) and linux (80MB)

docker system df

@daehahn
daehahn / wsl2-network.ps1
Last active June 25, 2024 15:53
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@neggles
neggles / New-GPUPDriverPackage.ps1
Last active July 6, 2024 18:04
Hyper-V GPU Virtualization
<#
.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
param(
[Parameter(Mandatory)][string]$vmName
)
$InformationPreference = "Continue"
$ErrorActionPreference = "Stop"
try {
$vmPartitionAdapter = Get-VMGpuPartitionAdapter -VMName $vmName
if ($vmPartitionAdapter) {
Write-Information "Removing Partition Adapter. Checkpoints work."
@lamhoangtung
lamhoangtung / install_nvidia_docker_offline.md
Last active December 8, 2022 02:46
How to install nvidia-docker offline for Ubuntu 18.04
@mwoodpatrick
mwoodpatrick / README.md
Created December 28, 2020 16:14 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

    cd /tmp