Skip to content

Instantly share code, notes, and snippets.

View crramirez's full-sized avatar

Carlos Rafael Ramirez crramirez

View GitHub Profile
@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;
# 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
@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]
@natefoo
natefoo / 00README.md
Last active June 14, 2025 11:01
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
@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;
@rkttu
rkttu / readme.txt
Last active January 26, 2025 22:58
(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
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
@rkkoszewski
rkkoszewski / gist:aa531cee7126edf329b76bdd0546f502
Last active December 31, 2024 12:32
Notes for installing XorgXrdp and Xrdp with GLAMOR support
THIS ARE MY NOTES OF BUILDING AN INSTALLING XORGXRDP AND XRDP WITH GPU ACCELERATION
TESTED ON DEBIAN 9.13
-- Build XorgXrdp with GPU acceleration ("script" - to be adjusted to your needs) : --
## << BUILD AND INSTALL SCRIPT START >> ##
#!/bin/bash
# Install Latest XRDP with XORGXRDP
# README
@machuu
machuu / WSL2_VPN_Workaround_Instructions.md
Last active December 15, 2025 14:20
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:

@krisalyssa
krisalyssa / readme.txt
Last active June 14, 2025 22: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.