Skip to content

Instantly share code, notes, and snippets.

@petevb
petevb / add-cert-and-hostname-to-web-apps.md
Last active January 9, 2024 19:47
Azure CLI cheatsheet

Using Azure CLI to add cert and hostname to web apps

These notes assume that you already have an app service plan running a number of sites (web apps) that ALL want the same wildcard cert.

The problem being solved was how to point a number of sites to a company domain.

The aliases (e.g. alias trainer.foo-uk.com onto CNAME pvb-live-eun-trainer-as.azurewebsites.net) MUST already be configured in DNS -- Azure will check!

First, how to get the interesting App Service Plan

@petevb
petevb / .bash-aliases
Last active May 18, 2023 09:52
[dotfiles] copy to `%userprofile%`
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# twotime: https://www.npmjs.com/package/twotime
@petevb
petevb / README.md
Last active March 12, 2023 21:14
[Boxstarter] From clean machine to all the things installed.
@petevb
petevb / Bash Prompt with Git Status Info
Created November 19, 2021 12:12 — forked from sundeepgupta/Bash Prompt with Git Status Info
Bash Prompt with Git Status Info
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@petevb
petevb / blog.md
Created September 27, 2021 16:31
test

‎‎​

@petevb
petevb / index.html
Created September 18, 2018 12:05
Hierarchical Config// source https://jsbin.com/gudubop
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Hierarchical Config">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@petevb
petevb / launch.json
Last active May 17, 2021 20:56
Attach debugger in VS Code for WSL
{
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "publish",
"program": "${workspaceFolder}/bin/Debug/net5.0/sample1.dll",
"args": [],
"cwd": "${workspaceFolder}",
@petevb
petevb / .gitignore
Last active July 29, 2020 12:55
Create Azure Environment in bash with az CLI
_oauth-permissions.json
_disable-oauth-permissions.json
@petevb
petevb / ETagMiddleware.cs
Last active July 21, 2020 09:40 — forked from madskristensen/ETagMiddleware.cs
ASP.NET Core ETAg middleware
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Net.Http.Headers;
using System.IO;
using System.Security.Cryptography;
using System.Threading.Tasks;
public class ETagMiddleware
{