Skip to content

Instantly share code, notes, and snippets.

View lbussell's full-sized avatar

Logan Bussell lbussell

View GitHub Profile
@lbussell
lbussell / xml.json
Last active January 10, 2022 20:53
MSBuild and .NET Source-Build VS Code snippets
{
"DotNetBuildFromSource Disable": {
"prefix": "dnbfsf",
"body": [
"Condition=\"'$(DotNetBuildFromSource)' != 'true'\""
],
},
"DotNetBuildFromSource Exclusive": {
"prefix": "dnbfst",
"body": [
@lbussell
lbussell / Dockerfile
Last active March 30, 2022 22:55
CentOS 8 for .NET Source Build with libunwind-devel
from mcr.microsoft.com/dotnet-buildtools/prereqs:centos-8-source-build-20200402192642-9e679d4
# CentOS 8 is EOL, so switch to a supported mirror
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN dnf install --setopt tsflags=nodocs --refresh -y \
libunwind-devel
@lbussell
lbussell / Enable-NuGetRepack-in-source-build.patch
Created June 1, 2022 22:31
dotnet/arcade patch to enable NuGetRepack in source-build
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Logan Bussell <[email protected]>
Date: Wed, 25 May 2022 11:15:39 -0700
Subject: [PATCH] Enable NuGetRepack in source build
---
src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props | 1 -
src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj | 5 ++++-
src/Microsoft.DotNet.NuGetRepack/Directory.Build.props | 5 -----
3 files changed, 4 insertions(+), 7 deletions(-)
@lbussell
lbussell / passwordless-ssh.ps1
Created June 6, 2022 23:57
Passwordless SSH from Windows to Linux
# Generate new private/public key pair
# Press enter a few times to get an empty password
ssh-keygen
# ssh-copy-id would normally do this on Linux, but that command doesn't exist on Windows
# Instead we use an alternative from here: https://stackoverflow.com/a/63532926
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | ssh logan@z240 "cat >> .ssh/authorized_keys"
# To make connecting even easier, add the following line to C:\Windows\System32\drivers\etc\hosts (edit as administrator)
# <your linux machine's IP> <your linux machine's name>
@lbussell
lbussell / rebuild.sh
Created July 13, 2022 17:08
Rebuild a repo in a source-build tarball with an accurate repo-level prebuilt report
#!/bin/bash
set -euxo pipefail
# Example: ./rebuild.sh msbuild
semaphores=(
"CreateBuildOutputProps.complete",
"CreateCombinedRestoreSourceAndVersionProps.complete",
"UpdateNuGetConfig.complete",
"CopyPackage.complete",
@lbussell
lbussell / create-prereqs.sh
Last active October 13, 2022 17:24
6.0 Servicing Scripts
#!/bin/bash
# Use this in a directory with:
# * x64 prereqs
# * arm64 prereqs
# * any extra nupkgs that you want to add
set -euxo pipefail
mkdir x64
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestorePackagesPath>$(MSBuildThisFileDirectory)/restored/</RestorePackagesPath>
<PackageVersionToDownload>6.0.12</PackageVersionToDownload>
</PropertyGroup>
#!/bin/bash
# Extracts the dotnet source and commtis it to your $VMR repo
# Usage: ./update-vmr.sh dotnet-sdk-source.tar.gz 6.0.108
# make sure you set $VMR to your git repo:
# export VMR=/home/logan/vcs/VMR/dotnet
set -euxo pipefail
@lbussell
lbussell / get-release-info.sh
Created December 12, 2022 23:17
Get .NET source-build release info
#!/bin/bash
set -euxo pipefail
query='query {
repository(name: \"source-build\", owner: \"dotnet\") {
discussions(
categoryId: \"DIC_kwDOA-dPNs4CBKbO\",
first: 10,
orderBy: {field: UPDATED_AT, direction: DESC}
) {
@lbussell
lbussell / mirror-and-tag.sh
Created December 13, 2022 18:51
Mirror and tag .NET source build releases
#!/bin/bash
set -euxo pipefail
RELEASE_CHANNEL="7.0"
RUNTIME_VERSION="7.0.X"
SDK_VERSION="7.0.1XX"
vmr_path="vmr"
dnceng_url="valid git url"
destination_url="valid git url"