Skip to content

Instantly share code, notes, and snippets.

View isaacrlevin's full-sized avatar

Isaac Levin isaacrlevin

View GitHub Profile
@isaacrlevin
isaacrlevin / .wslconfig
Last active September 24, 2024 17:54
WSL Dev Box Customization
[wsl2]
networkingMode=mirrored
@isaacrlevin
isaacrlevin / CRON command
Last active August 27, 2024 18:13
Restart Jdownloader with new Glutun VPN Server on Reconnect
*/5 * * * * /home/isaac/scripts/restart-jdl.sh >> /home/isaac/scripts/restart-jdl.log 2>&1
@isaacrlevin
isaacrlevin / Dockerfile
Created July 2, 2024 16:53
.NET Container with Playwright Library Support
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build-env
WORKDIR /App
# Copy everything
COPY . ./
# Restore as distinct layers
RUN dotnet restore
# Build and publish a release
RUN dotnet publish -c Release -o out
@isaacrlevin
isaacrlevin / Components-Account-Pages-Manage-Index.razor
Created February 20, 2024 20:37
Blazor Boolean Form Submission
@page "/Account/Manage"
@using System.ComponentModel.DataAnnotations
@using Microsoft.AspNetCore.Identity
@using Scheduler.Data
@inject UserManager<ApplicationUser> UserManager
@inject SignInManager<ApplicationUser> SignInManager
@inject IdentityUserAccessor UserAccessor
@inject IdentityRedirectManager RedirectManager
@isaacrlevin
isaacrlevin / .env
Created April 15, 2022 16:01
Elastic 8.2 Docker Compose
STACK_VERSION=8.2.0-8ea0c40f
ELASTIC_PASSWORD=changeme
KIBANA_PASSWORD=changeme
ES_PORT=9200
CLUSTER_NAME=es-cluster
LICENSE=basic
MEM_LIMIT=1073741824
KIBANA_PORT=5601
ENTERPRISE_SEARCH_PORT=3002
ENCRYPTION_KEYS=secret
@isaacrlevin
isaacrlevin / LoopbackHttpListener.cs
Last active November 23, 2021 19:48
Sample showing issue with Listener
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
@isaacrlevin
isaacrlevin / Program.cs
Created November 19, 2021 23:18
Azure SDK
var credential = new AzureCliCredential();
ArmClient armClient = new ArmClient(credential);
var subscriptions = armClient.GetSubscriptions();
var sub = subscriptions.Where(a => a.Data.SubscriptionGuid == mySubId).FirstOrDefault();
var creds = new AzureIdentityFluentCredentialAdapter(sub.Data.TenantId, AzureEnvironment.AzureGlobalCloud);
// fails here
var websites = await Azure.Authenticate(creds)
.WithSubscription(sub.Data.DisplayName)
.WebApps.ListByResourceGroupAsync(rgName);
@using Microsoft.AspNetCore.Authentication
@model TrafficViewModel
<div class="demo-section k-content wide">
@(Html.Kendo().Chart(Model.CloneSummary.Clones)
.Name("chart")
.Title("Internet Users in United States")
.Legend(legend => legend.Visible(false))
.Series(series => {
using Octokit;
using System;
using System.Threading.Tasks;
using System.Diagnostics;
namespace UpdateGitHub
{
class Program
{
@isaacrlevin
isaacrlevin / Function Code
Created July 30, 2019 17:11
Running CMD with Azure Function
System.Diagnostics.Process process = new System.Diagnostics.Process();
string WorkingDirectoryInfo = @"D:\home\site\wwwroot\";
string ExeLocation = @"D:\home\site\wwwroot\gitWork.cmd";
Process proc = new Process();
ProcessStartInfo info = new ProcessStartInfo();
try
{
info.WorkingDirectory = WorkingDirectoryInfo;
info.FileName = ExeLocation;