This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/sbin/dtrace -C -s | |
#pragma D option quiet | |
// https://gist.github.com/viroos/1242279 | |
// $ sudo dtrace -C -s ./args.d | |
proc:::exec-success | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.ChangeTracking; | |
using Microsoft.EntityFrameworkCore.Metadata; | |
using MassTransit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="ILGPU" Version="0.10.1" /> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PATH=$PATH:. DOTNET_WATCH_SUPPRESS_MSBUILD_INCREMENTALISM=1 DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER=1 DOTNET_WATCH_SUPPRESS_BROWSER_REFRESH=1 DOTNET_USE_POLLING_FILE_WATCHER=1 dotnet watch --verbose remoteRun | |
set -e | |
# Because the text goes crazy when the watcher detects a change | |
stty sane | |
# publish so we get wwwroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
IFS=. read LeftOctetA LeftOctetB LeftOctetC LeftOctetD <<EOF | |
192.168.4.5 | |
EOF | |
IFS=. read RightOctetA RightOctetB RightOctetC RightOctetD <<EOF | |
192.168.4.8 | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Coalesce(true, false) is true) { | |
Console.WriteLine("Yay!"); | |
} | |
if (Coalesce(true, true) is true) { | |
Console.WriteLine("Worked"); | |
} | |
static bool Coalesce(params bool[] truth) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
</PropertyGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddCors(options => | |
{ | |
options.AddPolicy( | |
"default", | |
policy => | |
{ | |
// I'm guessing | |
policy.WithOrigins("http://10.0.0.5:5000") | |
.AllowAnyHeader() | |
.AllowCredentials() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string CreateTempFileWithExtension(string extension) | |
{ | |
string file = string.Empty; | |
do | |
{ | |
file = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString()}.{extension}"); | |
} while (File.Exists(file)); | |
return file; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
namespace SysRplSerialPort | |
{ | |
[StructLayout(LayoutKind.Explicit)] | |
public struct TermiosStruct | |
{ | |
[MarshalAs(UnmanagedType.U4), FieldOffset(0)] | |
public uint c_iflag; |