Skip to content

Instantly share code, notes, and snippets.

View crramirez's full-sized avatar

Carlos Rafael Ramirez crramirez

View GitHub Profile
@krisalyssa
krisalyssa / readme.txt
Last active September 12, 2022 20:31 — forked from rkttu/readme.txt
Ubuntu 20.10 + WSL 2 + XRDP PulseAudio
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# First, you should install XRDP and X11 Desktop Environment first.
@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active May 23, 2024 05:39
Workaround for WSL2 network broken on VPN

Overview

Internet connection and DNS routing are broken from WSL2 instances, when some VPNs are active.

The root cause seems to be that WSL2 and the VPN use the same IP address block, and the VPN routing clobbers WSL2's network routing.

This problem is tracked in multiple microsoft/WSL issues including, but not limited to:

SYSTEMD_EXE="$(command -v systemd)"
if [ -z "$SYSTEMD_EXE" ]; then
if [ -x "/usr/lib/systemd/systemd" ]; then
SYSTEMD_EXE="/usr/lib/systemd/systemd"
else
SYSTEMD_EXE="/lib/systemd/systemd"
fi
fi
@rkttu
rkttu / readme.txt
Last active September 12, 2022 20:28
(Deprecated) Ubuntu 20.04 + WSL 2 + XRDP PulseAudio
# For those of you looking for this GIST: I don't maintain this code anymore. I recommend using WSLg, which is included starting with Windows 11.
# Please refer to https://gist.github.com/CraigCottingham/fad000cc2ec4678203acf62c4ad2ab23 code that forked this GIST.
# Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
@ChrisTX
ChrisTX / nanosleep-wsl.patch
Created March 13, 2020 17:15
WSL clock_nanosleep patch
diff -Naur glibc-2.31/sysdeps/unix/sysv/linux/clock_nanosleep.c glibc-2.31-wsl/sysdeps/unix/sysv/linux/clock_nanosleep.c
--- glibc-2.31/sysdeps/unix/sysv/linux/clock_nanosleep.c 2020-02-01 12:52:50.000000000 +0100
+++ glibc-2.31-wsl/sysdeps/unix/sysv/linux/clock_nanosleep.c 2020-03-13 12:30:30.737587300 +0100
@@ -31,7 +32,25 @@
struct __timespec64 *rem)
{
int r;
-
+ struct __timespec64 current_realtime, actual_req;
+ actual_req = *req;
@natefoo
natefoo / 00README.md
Last active May 20, 2024 21:55
Linux Distribution Detection

Distribution Detection

I am working on adding support for building and distributing (via PyPI) Python Wheels with C Extensions to the Python wheel and pip packages. The discussion on Distutils-SIG continues, but I believe it is fairly certain that some effort to correctly identify Linux distributions will need to be made. I've begun efforts to add this support to wheel.

How you can help

If you have a Linux distribution or version of a listed distribution not in this gist, or one of the ones I have not directly verified, I could use the following:

  • The contents of /etc/os-release, if it exists
@jstangroome
jstangroome / Send-NetworkData.ps1
Created September 28, 2014 03:17
A simple PowerShell implementation of the most basic functionality of Netcat
function Send-NetworkData {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$Computer,
[Parameter(Mandatory)]
[ValidateRange(1, 65535)]
[Int16]
# It looks like -multiwindow mode triggers the static color visual in both the internal x2go xserver and the external vcxsrv
# But it also looks like -multiwindow mode is how x2go client allows resizing of the remote desktop
# ...so I'm looking for a way to allow resizing of remote desktop w/out triggering static color visual.
#
# ...output of vcxsrv.exe's usage note:
Usage...
Vcxsrv [:<display>] [option]
:display-number
@hertzsprung
hertzsprung / ResponseMatchers.java
Created April 7, 2012 16:23
Combining Hamcrest matchers
package uk.co.datumedge.blog.hamcrest;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.lessThan;
import javax.ws.rs.core.Response;