Skip to content

Instantly share code, notes, and snippets.

@maskati
maskati / #emulate-managed-identity.md
Last active April 8, 2024 17:49
Emulate Azure managed identity locally
@bryanknox
bryanknox / .editorconfig
Last active January 4, 2023 13:00
.editorconfig for C# Visual Studio projects
# EditorConfig is awesome: https://EditorConfig.org
#
# More info about editorconfig for C# and .NET in Visual Studio see:
# https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2019
#
# Most of the .NET and C# rules below were taken from the
# Microsoft Roslyn team's editorconfig at:
# https://github.com/dotnet/roslyn/blob/master/.editorconfig
# Top-most EditorConfig file.
@lucj
lucj / docker-compose.yaml
Created January 7, 2021 09:50
fluent-bit / loki / grafana on Docker Swarm
version: '3.8'
configs:
loki-conf:
file: ./loki.conf
fluent-bit-conf:
file: ./fluent-bit.conf
networks:
monitoring:
@simonauner
simonauner / pre-commit
Last active September 9, 2023 16:42 — forked from EtherZa/pre-commit
Format c# with dotnet-format with pre-commit hook
#!/bin/sh
# Modified from https://gist.github.com/EtherZa/581d9276336353838b2c939f9554d479
#
# This script finds the files that are about to be committed,
# and runs dotnet format on them before adding them back to staging
#
# install dotnet-format: dotnet tool install -g dotnet-format
# make sure installed dotnet tools are on your path:
# export PATH="$PATH:$HOME/.dotnet/tools/"
# copy to .git/hooks/pre-commit and make executable
@maxivak
maxivak / _0__ssl_certbot_letsencrypt.md
Last active April 16, 2024 21:48
Let's encrypt SSL certificates using certbot in docker

Directories on host machine:

  • /data/certbot/letsencrypt

  • /data/certbot/www

  • Nginx server in docker container

docker run -d --name nginx \
@kazuple
kazuple / gist:38188a26a40fea1201ba42bae49f4365
Last active June 27, 2023 18:15
mkdocs Azure DevOps pipeline
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'windows-latest'
@cocowalla
cocowalla / Debouncer.cs
Last active July 7, 2022 13:49
Simple debounce
using System;
using System.Threading;
using System.Threading.Tasks;
namespace MyNamespace
{
public class Debouncer : IDisposable
{
private readonly CancellationTokenSource cts = new CancellationTokenSource();
private readonly TimeSpan waitTime;
@lewixlabs
lewixlabs / OAuth2Custom.cs
Last active November 19, 2018 15:18
Xamarin OAuth2 Custom Class to get & use refresh_token
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Auth;
namespace MyNetStandardLibrary.OAuth2
{
// inspired by https://lostechies.com/jimmybogard/2014/11/13/mobile-authentication-with-xamarin-auth-and-refresh-tokens/
public class CustomOAuth2Authenticator : OAuth2Authenticator
{
@smola
smola / GLUSTER_SETUP.sh
Created October 18, 2018 09:24
Quick and dirty single-node GlusterFS setup
#
# Instructions for quick gluster server (1 node) setup with a volume on LVM.
# No replication, just using localhost.
#
# See https://docs.gluster.org/en/latest/Administrator%20Guide/Brick%20Naming%20Conventions/
#
# Install GlusterFS
add-apt-repository ppa:gluster/glusterfs-4.0
apt-get install glusterfs-server
@attilah
attilah / X.Y.Z.Sources.csproj
Last active April 18, 2024 08:52
X.Y.Z.Sources nuget package
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>contentFiles</ContentTargetFolders>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>