Skip to content

Instantly share code, notes, and snippets.

@rfht
rfht / GetFilesBugDemo.cs
Created June 25, 2019 16:58
Directory.GetFiles() bug demo
using System;
using System.IO;
public class GetFilesBugDemo
{
public static void Main(string[] args)
{
Directory.CreateDirectory("test/test");
File.Create("test/test/testfile");
Console.WriteLine("Test with rooted path:");
@rfht
rfht / GetFullPathBugDemo.cs
Created June 25, 2019 16:43
Path.GetFullPath() bug demo
using System;
using System.IO;
class GetFullPathBugDemo
{
public static void Main(string[] args)
{
Console.WriteLine("Test with rooted path:");
Console.WriteLine(Path.GetFullPath(Directory.GetCurrentDirectory() + @"/test//test//test//"));
Console.WriteLine("Test with relative path:");
@rfht
rfht / csharp.log
Created June 25, 2019 16:02
Ubuntu mono Directory.GetFiles() / Path.GetFullPath() bug
thfr@thfr-MS-7B79:~/.steam/steam/steamapps/common/Dead Pixels II$ uname -a
Linux thfr-MS-7B79 4.15.0-52-generic #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
thfr@thfr-MS-7B79:~/.steam/steam/steamapps/common/Dead Pixels II$ pwd
/home/thfr/.steam/steam/steamapps/common/Dead Pixels II
thfr@thfr-MS-7B79:~/.steam/steam/steamapps/common/Dead Pixels II$ csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using System.IO;
csharp> Directory.GetFiles("Content/data/fonts");
@rfht
rfht / patch-man_mono_1.diff
Created June 7, 2019 00:54
Add MONO_IGNORE_BAD_COMPARER to man page
diff --git a/man/mono.1 b/man/mono.1
index 37f786073c5..3aaaf145e35 100644
--- a/man/mono.1
+++ b/man/mono.1
@@ -1532,6 +1532,10 @@ unix). MONO_GAC_PREFIX should point to the top directory of a prefixed
install. Or to the directory provided in the gacutil /gacdir command. Example:
.B /home/username/.mono:/usr/local/mono/
.TP
+\fBMONO_IGNORE_BAD_COMPARER\fR
+When set, ignores bad IComparer implementation instead of throwing an error.
@rfht
rfht / lwjgl3-build-openbsd.log
Created May 25, 2019 17:52
Build log of lwjgl3 patched for OpenBSD
Buildfile: /home/thfr/obsd/ports/lwjgl/lwjgl3/build.xml
clean:
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/core/src/generated
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/bullet/src/generated
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/bgfx/src/generated
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/assimp/src/generated
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/egl/src/generated
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/cuda/src/generated
[delete] Deleting directory /home/thfr/obsd/ports/lwjgl/lwjgl3/modules/lwjgl/glfw/src/generated
@rfht
rfht / installation.md
Created April 2, 2019 18:52 — forked from abcdefg30/installation.md
Unofficial, manual content installation for OpenRA

Manual (unrecommended) installation of the required content files for OpenRA

⚠️ This method is not recommended and should only be applied if automatic installation fails. Success of manually installing the files can not be guaranteed. ⚠️

⚠️ The automatic installation may fail for non-english content. OpenRA does not support other languages at the current stage of development and no such content should be installed. ⚠️

⚠️ Manually installing files can corrupt your game and lead to crashes. ⚠️

If you have trouble with automatic installation, please contact the developers (via IRC, our forum, the webpage comments or our issue tracker) before attempting a manual install.

@rfht
rfht / MonoGame.Framework-openbsd-audiostub
Created March 19, 2019 19:53
diff used to disable OpenAL in MonoGame.Framework to run StardewValley server on instance without audio
diff --git a/MonoGame.Framework/Audio/OpenAL.cs b/MonoGame.Framework/Audio/OpenAL.cs
index 9a8eb4202..4d1c6ef69 100644
--- a/MonoGame.Framework/Audio/OpenAL.cs
+++ b/MonoGame.Framework/Audio/OpenAL.cs
@@ -217,9 +217,9 @@ namespace MonoGame.OpenAL
if (CurrentPlatform.OS == OS.Windows)
ret = FuncLoader.LoadLibrary("soft_oal.dll");
else if (CurrentPlatform.OS == OS.Linux)
- ret = FuncLoader.LoadLibrary("libopenal.so.1");
+ ret = FuncLoader.LoadLibrary("libopenal.so");
@rfht
rfht / monogame_openbsd.diff
Created December 25, 2018 20:03
Diff to get MonoGame Framework to run on OpenBSD (with xbuild), currently messes up Linux
diff --git a/MonoGame.Framework/Audio/OpenAL.cs b/MonoGame.Framework/Audio/OpenAL.cs
index 9a8eb4202..4d1c6ef69 100644
--- a/MonoGame.Framework/Audio/OpenAL.cs
+++ b/MonoGame.Framework/Audio/OpenAL.cs
@@ -217,9 +217,9 @@ namespace MonoGame.OpenAL
if (CurrentPlatform.OS == OS.Windows)
ret = FuncLoader.LoadLibrary("soft_oal.dll");
else if (CurrentPlatform.OS == OS.Linux)
- ret = FuncLoader.LoadLibrary("libopenal.so.1");
+ ret = FuncLoader.LoadLibrary("libopenal.so");
@rfht
rfht / x2f.log
Created April 6, 2018 13:36
mono --debug XnaToFna.exe on OpenBSD, built with xbuild
[XnaToFna] [FNAHooker] Patching FNA in memory...
[XnaToFna] [FNAHooker] This is required for the XnaToFna content transformer.
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
Server stack trace:
at XnaToFna.FNAHookBridgeXTF.Init (System.Reflection.Assembly fna) [0x0009d] in /home/thfr/games/fna/x2f/XnaToFna/src/FNAHooks/FNAHookBridgeXTF.cs:31
at XnaToFna.FNAHooker.Boot () [0x0000d] in /home/thfr/games/fna/x2f/XnaToFna/src/FNAHooks/FNAHooker.cs:69
//gcc osvrexample.c -losvrClientKit
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <osvr/ClientKit/ContextC.h>
#include <osvr/ClientKit/InterfaceC.h>
#include <osvr/ClientKit/InterfaceStateC.h>