Skip to content

Instantly share code, notes, and snippets.

Avatar
/-/

Marc Duiker marcduiker

/-/
View GitHub Profile
@marcduiker
marcduiker / homework-links.md
Last active Sep 30, 2020
CREATE: Serverless Homework
View homework-links.md
@marcduiker
marcduiker / RetryCallsAndEscalate.cs
Created Sep 16, 2020
Possible solution to retry calls and escalate when the callee does not respond within a certain time.
View RetryCallsAndEscalate.cs
namespace DurableFunctions.Demo.DotNetCore.RetryCallsWithBackup
{
public class EscalatingCallsOrchestrator
{
[FunctionName(nameof(RunEscalatingCallsOrchestrator))]
public async Task RunEscalatingCallsOrchestrator(
[OrchestrationTrigger] IDurableOrchestrationContext context,
ILogger logger)
{
var escalatingCallsInput = context.GetInput<EscalatingCallsInput>();
@marcduiker
marcduiker / EscalateCallsOrchestrator.cs
Created Sep 16, 2020
Escalate calls orchestrator with time out.
View EscalateCallsOrchestrator.cs
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace DurableFunctions.Demo.DotNetCore.EscalateCalls
@marcduiker
marcduiker / ffmpeg_increase_audio_level
Last active Sep 15, 2020
Increase the audio level of an existing mp4 file with ffmpeg
View ffmpeg_increase_audio_level
ffmpeg -i input.mp4 -af "volume=10dB" -c:v copy -c:a aac -b:a 192k output.mp4
@marcduiker
marcduiker / incremental_rename.ps1
Last active Aug 9, 2020
Incrementally rename files for ffmpeg
View incremental_rename.ps1
$prefix="frame_"
$files = Get-ChildItem "<Path where the pngs are>" -Filter *.png | Sort-Object
$fileCount = 0
$files |
Foreach-Object {
$fileCount++
$currentFileNumber = [int]$_.BaseName.Substring($prefix.Length)
if ($currentFileNumber -ne $fileCount) {
$newFileFormat = "$prefix{0:d4}.png" -f $fileCount
Rename-Item $_.FullName $newFileFormat
@marcduiker
marcduiker / ffmpeg_video_for_twitter.md
Last active Aug 10, 2020
FFmpeg command for creating video for Twitter
View ffmpeg_video_for_twitter.md

This FFmpeg command reads images named frame_[4 char digit].png and converts it to an mp4 using the h264 encoding which Twitter accepts. The bitrate is set to 5M to reduce blocking as much as possible. Reduce the bitrate to obtain a smaller file size.

ffmpeg -framerate 10 -i frame_%04d.png -c:v h264_qsv -b:v 5M video.mp4

@marcduiker
marcduiker / set_kv__access_policy_for_function_app.ps1
Last active Jun 24, 2020
Azure CLI to add an access policy for a Function App to KeyVault
View set_kv__access_policy_for_function_app.ps1
$principalId = az functionapp identity show -n FUNC_APP_NAME -g RESOURCE_GROUP_NAME --query principalId
$appId = az ad sp show --id $principalId --query appId
az keyvault set-policy -n KEYVAULT_NAME --spn $appId --secret-permissions get
View MSBuild questions.md

My definition of serverless

My definition of serverless is that:

  • You don't have full responsibility of the infrastructure, which is a good thing.
  • Your resources should scale up and down automatically, based on the load.
  • You only pay for what you actually use, so the consumption model.

Usages

  • Glue code, connect services
View ServerlessDays Amsterdam Conference Script.md

Serverless Days Amsterdam Conference Script

This document contains the script for the online ServerlessDays Amsterdam Conferene. We're using a combination of OBS, Skype & NDI Tools to combine our streams. Streaming is done to Restream.io which in turn forwards it to YouTube, Twitch and Periscope.

Roles

The lines in the script are prefixed with the role of the person who needs to undertake an action.

  • TECH = The person who's controlling OBS
View Speaker instructions.md

Hi ServerlessDays speaker!

Here are the instructions for joining our conference on May 8th. Please read them through carefully so the experience on the conference day will be as smooth as possible. Another email will follow, which contains the exact time you need to be online during the conference.

There are three actions we ask you to do now:

  1. Read this entire message, yes, all of it!
  2. Send us your prerecorded session before Friday if you haven't done so already.
  3. Connect with our co-organizer, Marc Duiker, on Skype: m.duiker_1

Tech requirements

You can’t perform that action at this time.