Skip to content

Instantly share code, notes, and snippets.

View f2calv's full-sized avatar

Alex Vincent f2calv

View GitHub Profile
@noelbundick
noelbundick / README.md
Created October 14, 2021 16:15
Optimizing Rust container builds

Optimizing Rust container builds

I'm a Rust newbie, and one of the things that I've found frustrating is that the default docker build experience is extremely slow. As it downloads crates, then dependencies, then finally my app - I often get distracted, start doing something else, then come back several minutes later and forget what I was doing

Recently, I had the idea to make it a little better by combining multistage builds with some of the amazing features from BuildKit. Specifically, cache mounts, which let a build container cache directories for compilers & package managers. Here's a quick annotated before & after from a real app I encountered.

Before

This is a standard enough multistage Dockerfile. Nothing seemingly terrible or great here - just a normal build stage, and a smaller runtime stage.

@alexeldeib
alexeldeib / sdk-cli-update.md
Last active January 26, 2021 18:09
App Insights and Log Analytics SDK + CLI Update

Application Insights Query SDK

The [Microsoft.Azure.ApplicationInsights NuGet package][1] contains the query SDK for App Insights. Here's a bare-minimum setup with a client ready to make calls:

AAD Authentication

using System;
using Microsoft.Azure.ApplicationInsights;
using Microsoft.Rest.Azure.Authentication;
using System.Collections.Generic;
@dpapathanasiou
dpapathanasiou / RaspberryPi_A_Plus_Wifi.md
Created January 10, 2015 19:49
How to setup a usb wifi dongle on the Raspberry Pi Model A+

Rationale

The Raspberry Pi Model A+ has just a single usb port, so getting the wifi configured has to done by editing /etc/network/interfaces from a command line prompt.

These instructions assume the Raspbian OS on the SD card, and a usb wifi adapter that supports the RTL8192cu chipset, since the current Raspbian has built-in support for it.

Before the first boot

  1. Put a keyboard in the usb slot
  2. Connect the HDMI slot to a monitor