Skip to content

Instantly share code, notes, and snippets.

View tonidy's full-sized avatar

toni dy tonidy

View GitHub Profile
@gildas
gildas / win-openssh.md
Last active January 13, 2022 08:09
Deploy OpenSSH on Windows 2019 Full and Core

Deploy OpenSSH on Windows Server 2019

Goals

We want to install OpenSSH on a Windows Server 2019, so we can remote access it with ssh myuser@win2019.

We want also to turn on PowerShell Remoting over SSH, so we can create PSSession objects from PowerShell Core on Linux/MacOs/Windows.

Acknowledgments

@umair-me
umair-me / mock.cs
Last active July 7, 2022 03:00
Mock Configuration.GetSection
Mock<IConfiguration> configuration = new Mock<IConfiguration>();
configuration.Setup(c => c.GetSection(It.IsAny<String>())).Returns(new Mock<IConfigurationSection>().Object);
@vurihuang
vurihuang / go-orm-with-transaction-2.go
Last active May 29, 2023 10:21
go orm with transaction.
package main
import (
"errors"
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@thejohnfreeman
thejohnfreeman / Dockerfile
Last active February 12, 2022 10:47
Trying to install anything from Visual Studio in a Docker container
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
# Use the latest release channel.
ADD https://aka.ms/vs/16/release/channel C:\TEMP\VisualStudio.chman
# Download the Visual Studio Build Tools bootstrapper.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
# Download the Visual Studio Community bootstrapper.
ADD https://aka.ms/vs/16/release/vs_community.exe C:\TEMP\vs_community.exe
@mcenirm
mcenirm / README.md
Created May 18, 2019 16:27
Create multiboot USB stick on macOS
@arno01
arno01 / docker-on-android.md
Last active October 19, 2023 07:48
Docker on Android

WORK IN PROGRESS

Docker on Android

Setup:

Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
Termux
@phillippelevidad
phillippelevidad / InjectionFixture.cs
Created March 27, 2019 20:11
xUnit: add Startup to test project and reuse configurations
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using System;
using System.Net.Http;
namespace Tests
{
public class InjectionFixture : IDisposable
{
private readonly TestServer server;
// This file is based on the code from the ASP.NET Core repository
// https://github.com/aspnet/AspNetCore/tree/master/src/Middleware/SpaServices.Extensions/src
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;