Skip to content

Instantly share code, notes, and snippets.

@rnelson
rnelson / dotnet-on-freebsd.md
Last active November 4, 2023 15:11
.NET 7 on FreeBSD 13.2

.NET 7 on FreeBSD 13.2

After getting it up and running, I sent a quick toot about having .NET 7 running on my FreeBSD VM. It got a lot of boosts and favorites.

To make the process easier for others and to make sure credit is given where due, I decided to make this little gist.

Credits

I did nothing here but find the right bits of instructions and follow them. It looks like Thefrank and sec are the driving forces behind getting .NET working on FreeBSD. More information is on the FreeBSD wiki's .NET page.

@rnelson
rnelson / FileNotFoundException.md
Created January 27, 2022 01:37
Genesyslab.Sip.Endpoint.Provider.Genesys.dll + FileNotFoundException

FileNotFoundException

A few months back, I wrote a simple little Windows desktop application using WPF. It's built for .NET Framework 4.5, which means it should run in 4.5 through 4.8 without any issues. Outside of some core .NET assemblies and the WPF ones, it has a whopping three dependencies:

  1. Genesyslab.Sip.Endpoint.dll
  2. Genesyslab.Sip.Endpoint.Provider.Genesys.dll
  3. Newtonsoft.Json.dll

This application has been used internally on my network, internally on the other half of the company's network (we had a big merger, the networks are linked but only enough to get the important things working on both sides), and internally on some vendor networks. At launch, it connects to a web service of mine to pull down configuration stuff, and user-selected options then dictate what Genesys servers those first two dependencies connect to. Nice and simple.

@rnelson
rnelson / sameDigits.linq
Created May 10, 2021 23:35
sameDigits()
<Query Kind="Program" />
void Main()
{
sameDigits(1);
sameDigits(10);
sameDigits(251894);
sameDigits(251895);
}
#!/bin/ksh
# Cobbled together using https://www.romanzolotarev.com/random.html
# and https://docstore.mik.ua/orelly/unix3/korn/appb_11.htm
CHARS=' -~'
SIZE=20
USAGE="as#"
while getopts "$USAGE" opt; do
@rnelson
rnelson / day02.fs
Created December 10, 2017 13:49
Attempts at AoC 2017 Day 2b
open System
open System.IO
open System.Linq
open System.Text.RegularExpressions
let readInput(filename:string) =
let lines = File.ReadAllLines filename
[|
for l in (lines |> Array.toSeq) do
yield Regex.Split(l, "\s+") |> Array.map int
@rnelson
rnelson / tsinstall.bash
Created November 26, 2017 13:56
Script to install Tarsnap
#!/bin/bash
set -e
ROOT=/opt/tarsnap
usage() {
echo "usage: $0 <version>"
exit 1
}
@rnelson
rnelson / free_oreilly_ebooks.sh
Created October 10, 2016 11:48
O'Reilly Gives Away Free Programming Ebooks
#!/bin/sh
# http://www.oreilly.com/programming/free/
# https://news.slashdot.org/comments.pl?sid=9752765&cid=53044369
# https://news.slashdot.org/comments.pl?sid=9752765&cid=53045853
curl 'http://www.oreilly.com/business/free/' | grep '\.csp' | sed 's/^.*href="//' | sed 's/free\/\(.*\).csp.*">/free\/files\/\1.pdf/' | tr -d '\r' | xargs wget
curl 'http://www.oreilly.com/data/free/' | grep '\.csp' | sed 's/^.*href="//' | sed 's/free\/\(.*\).csp.*">/free\/files\/\1.pdf/' | tr -d '\r' | xargs wget
curl 'http://www.oreilly.com/design/free/' | grep '\.csp' | sed 's/^.*href="//' | sed 's/free\/\(.*\).csp.*">/free\/files\/\1.pdf/' | tr -d '\r' | xargs wget
curl 'http://www.oreilly.com/iot/free/' | grep '\.csp' | sed 's/^.*href="//' | sed 's/free\/\(.*\).csp.*">/free\/files\/\1.pdf/' | tr -d '\r' | xargs wget
curl 'http://www.oreilly.com/programming/free/' | grep '\.csp' | sed 's/^.*href="//' | sed 's/free\/\(.*\).csp.*">/free\/files\/\1.pdf/' | tr -d '\r' | xargs wget
using UnsignedInteger = System.UInt16; // Sorry, I can't unabbreviate it on the RHS
// https://twitter.com/taylonr/status/712277308363542530
namespace FizzBuzz
{
class Program
{
static void Main(System.String[] arguments)
{
@rnelson
rnelson / input.xml
Last active August 31, 2020 10:16
Tokenize a string in XSLT 1
<?xml version="1.0" encoding="UTF-8"?>
<input fields="One|Two|Three|Four|Five|Agree" values="Answer A|Answer B|Answer C|Answer D|Answer E|Yes"/>
@rnelson
rnelson / .gitignore
Last active August 29, 2015 14:17 — forked from adamcooke/cloudapp-export.rb
cloudapp-export
cloudapp-export