Skip to content

Instantly share code, notes, and snippets.

View sheldonhull's full-sized avatar
👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this

sheldonhull sheldonhull

👋
Hi! Who keeps their github status up to date? You get a 🌮 just for reading this
View GitHub Profile

I have found a way to build Windows container images without Docker - It doesn't use a Dockerfile though.

The way I got this to work is using crane from Google (https://github.com/google/go-containerregistry/blob/main/cmd/crane/doc/crane.md) which lets you append image layers to a base image. You can build Windows images on either Linux or Windows or inside of a container (Linux/Windows) - however, you'll need to build any artefacts (e.g. EXE, DLLs) on a Windows machine since this approach is using Crane to assemble a Windows container image on a Linux host (container).

Here is a quick PoC I did to prove it works (using Docker Desktop with Windows Container mode on my laptop):

dotnet --version
# 7.0.102
@gmlewis
gmlewis / build.go
Created February 3, 2023 00:58
Work in progress - build step using Dagger.io
package common
import (
"context"
"fmt"
"log"
"path/filepath"
"runtime"
"dagger.io/dagger"
@gmlewis
gmlewis / on-push-to-develop.yml
Created February 3, 2023 00:49
Work in progress - GitHub Action - pushing image to Azure Container Registry using Dagger.io
name: On push to develop
on:
push:
paths:
- '.env.test'
- '.**.js'
- '**.js'
- '**.json'
- '**.lock'
- 'public/**'
@gmlewis
gmlewis / azure.go
Last active February 3, 2023 01:32
Work in progress - pushing image to Azure Container Registry using Dagger.io
package common
import (
"context"
"log"
"dagger.io/dagger"
)
// PublishToAzure performs a Dockerfile build on the provided repo and pushes to the
@quii
quii / arrange_the_furniture.md
Last active February 14, 2022 16:54
Furniture arranging checklist

Refactoring step, starting checklist

Refactoring (or as i often annoyingly call it, "Furniture arranging") is a skill that once practiced enough, becomes second-nature, and in a lot of cases, very easy.

It often gets conflated with design, but they are separate activities.

Refactoring vs Design

Refactoring is just improving existing code and not changing behaviour, and it's usually very localised changes; tests shouldn't have to change. A lot of very helpful refactorings are simple to learn, easy to do (many are almost entirely automated by your IDE) but over time become hugely impactful to the quality of our system.

@lorenzodifuccia
lorenzodifuccia / disable_atp.sh
Last active April 11, 2024 11:10
Disable Microsoft Defender ATP on MacOS
launchctl unload /Library/LaunchAgents/com.microsoft.wdav.tray.plist
sudo launchctl unload /Library/LaunchDaemons/com.microsoft.fresno.plist
sudo launchctl unload /Library/LaunchDaemons/com.tanium.taniumclient.plist
package main
import (
"encoding/json"
"fmt"
"os"
"os/exec"
)
func GetCmdOutput(cmd []string) []byte {
@dfinke
dfinke / CONWAYS-GAME-OF-LIFE.ps1
Last active July 24, 2021 18:26
The classic cellular automata simulation
param(
$ALIVE = 'O',
$DEAD = ' '
)
# Conway's Game of Life
# The classic cellular automata simulation. Press Ctrl-C to stop.
# More info at: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
$WIDTH = 79 # The width of the cell grid.
@wsmelton
wsmelton / copy-dbalogin-parameters.md
Last active July 21, 2021 20:12
A look into the parameters of Copy-DbaLogin

SQL Server migrations, the bain in most DBA's lives when they find out one is coming up. At that top of the list, along with finding out, you need to test your database DR strategy that is fully documented 😉 😉.

Still, one of the most common tasks that can be in day-to-day activity is getting logins created between various SQL Server instances. Say you have to support multiple environments for a given application database, creating that login 3, 4, 5 different times manually using SSMS 😧! dbatools includes a ton of commands that help in migrations.

Do you have multiple Availability Groups (AG) deployed in your environment? AGs that have 3, 4, 6 replicas that you are adding a login to one require adding it to all the other replicas?

These scenarios, among many others, are where Copy-DbaLogin can help make your life easier and give you more time to catch up on other things.

Copy-DbaLogin

@schigh-ntwrk
schigh-ntwrk / nakedbraces.go
Last active May 26, 2021 17:57
use of naked braces in Go
t.Run("multi config default pool size", func(t *testing.T) {
_ = os.Setenv(EnvKafkaGlobalBrokers, "0.0.0.0:9092")
_ = os.Setenv(EnvKafkaSubscriberTopicGroups, "A:B|C:D")
cfgs, err := ConsumerConfigsFromEnv()
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if len(cfgs) != 2 {
t.Fatalf("expected two config, got %d", len(cfgs))