Skip to content

Instantly share code, notes, and snippets.

@blaisep
blaisep / make_ci_image.sh
Last active July 31, 2023 16:53
Devops kata #01 - build OCI image
# Copied from https://github.com/kpfleming/ci-python-image/blob/main/workflow-support/make_ci_image.sh
# the goal of the kata is to make an OCI image for CI.
# The referene uses sh, but the suggestion is to refactor using an atuomation tool.
# ---
#!/usr/bin/env bash
set -ex
scriptdir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
base_image=${1}; shift
@blaisep
blaisep / podman_pypyr.md
Last active July 18, 2023 01:32
Outline for an exercise in migrating a shell command to pypyr

Beyond shell scripts

Background: The objective is to run python everywhere and my first step is to replace shell activity with pypyr. These notes relate to the process of automating a common task: running a containerized application in a local virtual host. It happens to the podman, but the structure is similar to Docker, Vagrant, kubectl, etc. The naive workkflow of "copy/paste commands into yaml blocks" resulted in the question of how to handle common failure scenarios. So I wonder if there is an approach or even some scaffolding for the "typical launch script"

Starting a service requiring a Docker host

What things could go wrong?

The happy path is usually what is left over after everything else has failed. My intuition is that one should probe for the common failure conditions first.

@blaisep
blaisep / jenkins-pipeline-git-cred.md
Created October 20, 2016 23:33
Insert git credentials into Jenkins Pipeline Script projects

Suppose you want to inject a credential into a Pipeline script. The cloudbees note does not include Pipeline script examples. https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs

The Jenkins Pipeline Docs' description of the git pushmethod doesn't have an example using injected credentials. (https://jenkins.io/doc/pipeline/examples/#push-git-repo)

The Snippet generator is helpful, but not not if you try to follow the instructions at: https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin

@blaisep
blaisep / public_contributions.md
Last active November 2, 2022 13:42
Highlights of various open source contributions

Keybase proof

I hereby claim:

  • I am blaisep on github.
  • I am blaisepabon (https://keybase.io/blaisepabon) on keybase.
  • I have a public key ASBqAeFHyU7b2rmjVAwPS_033rRGNvxiGZUOByDNyVOfwAo

To claim this, I am signing this object:

@blaisep
blaisep / insiders-2020-05-01.md
Created September 15, 2022 23:40 — forked from alexellis/insiders-2020-05-01.md
Insiders Update: 1st May 2020 - Netbooting the Raspberry Pi for Kubernetes and OpenFaaS enhancements

Welcome to this week's Insiders Update! Insiders gain exclusive access to early previews, tutorials, updates, news, and events on my OSS work.

✅ Subscribe today and pay whatever you want 👉 through GitHub Sponsors

Insiders Update: 1st May 2020 - Netbooting the Raspberry Pi for Kubernetes and OpenFaaS enhancements

RPi netbooting

Pictured: netbooted Raspberry Pi cluster with Kubernetes (k3s)

Code as docs - notes for the flyless.dev group

About this talk

We seek to surprise and delight developers. - devs don't like to write docs (or code, for that matter) - code is structured by nature - can we leverage the structure of code to produce docs? (spoiler: YES)

The four (plus one) categories

Docs are easy(ish) to write, but hard to maintain

The situation gets even worse where there are "too many cooks in the kitchen". In long-lived projects (many years, many versions) where there are lots of contributors, keeping docs current is a nightmare. As trust in the docs fails, so does confidence in the project ( cough >jenkins< cough ).

How do the big kids do it?

By way of example, allow me to present a few project we're all familiar with, because they are similar to Sanic and because we don't hear people complaining about the docs:

@blaisep
blaisep / workplace_webhook.md
Last active March 4, 2020 03:32
Facebook Workplace Admin Event Webhook integration

Process Facebook Workplace Admin Events using webhooks

Facebook Workplace charges extra to log admin events. Facebook will publish Admin events for free via webhooks. You can "subscribe" they don't queue and they don't retransmit. To subscribe, you'll need to register a public URL with a recognized TLS certificate. Finally, you'll need a handler at that URL to participate in a rudimentary verification handshake before Facebook will register a webhook destination.

Considering these requirements, the solution has to:

  • set up an externally accessible server
  • get a domain name and a public SSL cert
@blaisep
blaisep / brew-install-script.sh
Created April 28, 2019 23:29 — forked from CliffordAnderson/brew-install-script.sh
Brew install script for OSX
#!/bin/sh
# Homebrew Script for OSX
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh`
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing brew cask..."
brew tap caskroom/cask