Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mitio
mitio / jenkins-pipeline-error-handling.md
Last active April 3, 2023 14:43
Jenkins Pipeline error handling methods

unstable(message):

  • like a warning: doesn't abort nor the current step, neither the entire build, code continues running
  • current step is flagged in orange
  • the build is flagged as UNSTABLE (if not already flagged as FAILED as build status can only get worse, not better)
  • the step's log is not expanded by default in BlueOcean

error(message):

  • like an exception, similar to throw new Exception(message): aborts both the current step as well as the entire build (only code from current parallel steps continues until completion)
@mitio
mitio / ebpf-and-linux-observability.md
Created July 21, 2021 11:25
eBPF and Linux observability

eBPF (or, simply BPF)

Why these tools? Why eBPF?

Linux tracing overview

linux tracing systems

But first, perf

@mitio
mitio / README.md
Last active November 14, 2019 14:37
A rudimentary example of a distributed in-memory key-value store (with lots of bugs)

A distributed in-memory key-value store

A rudimentary example of a distributed in-memory key-value store (with lots of bugs)

Usage

In one terminal:

ruby server.rb 4001
@mitio
mitio / graph-obd-data.rb
Created July 13, 2019 12:22
Graphs OBD data exported from Auto Doctor and generates HTML. Depends on https://metricsgraphicsjs.org/ and D3.js. Usage: `ruby graph-obd-data *.csv`
#!/usr/bin/env ruby
require 'csv'
require 'time'
require 'cgi'
require 'erb'
require 'json'
template =
<<~HTML
@mitio
mitio / example-computer-science-basics-curriculum.md
Created May 30, 2019 19:21
Примерен учебен план за програмиране

Примерен учебен план за програмиране

Темите, маркирани тук, са неща, за които е добре да имате някаква идея, ако искате да се развивате в посока програмиране. Темите са ориентировъчни и списъкът е далеч от изчерпателен, но все пак, дава начало и посока.

Има различни специализации на програмиране – web разработка (front end, back end), мобилни приложения (iOS, Android, ...), machine learning, QA инженери, пишещи автоматизирани тестове и други. Web разработката е много перспективна и универсално приложима. Специализацията може да дойде впоследствие. За почти всички тях, частично познаване на тези теми ще е полезно.

@mitio
mitio / aws-auth.sh
Last active October 22, 2019 14:55
Easily authenticate against AWS for CLI or API access when MFA is activated and forced
aws-auth() {
aws_profile="$1"
if [ -z "$aws_profile" ]; then
echo "Usage: $0 <aws-profile>" >&2
return 1
fi
echo "Obtaining MFA ARN for profile '$aws_profile'..."
if ! response=`aws --profile "$aws_profile" iam list-mfa-devices` || \
@mitio
mitio / ._readme.md
Last active December 19, 2018 10:38
An overview of the tooling I use

Tooling

Basic setup, macOS tips & misc

  • Homebrew for installing packages & brew cask for precompiled binaries.
  • brew services list for managing daemons.
  • Booting Rack apps with puma-dev via HTTPS – I've added its unique CA to my system's trusted certs (see how here).
  • Dash for offline docs. It's running constantly and a global hotkey (Cmd + Shift + Space) shows its window. It's also integrated with my editor.

Ensure will always catch Timeout::Error but nested rescue clauses will not, unless a custom exception class is used as per the docs:

The exception thrown to terminate the given block cannot be rescued inside the block unless klass is given explicitly.

No rescue:

irb(main):001:0> Timeout.timeout 1 do
irb(main):002:1*   puts 'sleeping'
irb(main):003:1>   sleep 2

Kubernetes Networking Workshop

Goal

ns (10.192.10.200/24) -- veth pair -- cni0 bridge (10.192.10.1/24) -- flannel.1 vxlan (10.192.10.0/32) -- ec2 -- ec2 -- flannel.1 vxlan (10.192.11.0/32) -- cni0 bridge (10.192.11.1/24) -- veth pair -- ns (10.192.11.200/24)

Step 1: VXLAN

@mitio
mitio / README.md
Last active September 5, 2018 06:40
Ruby basics workshop #1

Ruby workshop agenda

  1. Data types
  2. Basic syntax
  3. Objects, data types/structures (basic)
  4. Ecosystem – gems, docs; C extensions
  5. Blocks & loops

Advanced: