This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image_name := "debian.qcow2" | |
| set shell := ["bash", "-cu"] | |
| ansible_password := `(openssl rand -base64 12)` | |
| download: | |
| @curl -Lo {{image_name}} https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-nocloud-amd64.qcow2 | |
| prepare: | |
| @echo {{ansible_password}} > .password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //! ## Dependencies | |
| //! [dependencies] | |
| //! tracing = "0.1" | |
| //! tracing-subscriber = { version = "0.3", features = ["fmt", "env-filter"] } | |
| use tracing::{debug, error, info, instrument, warn}; | |
| use tracing_subscriber::{fmt, EnvFilter}; | |
| #[instrument(level = "trace")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use futures_util::stream::StreamExt; | |
| use lapin::{ | |
| options::{BasicAckOptions, BasicConsumeOptions, QueueDeclareOptions}, | |
| types::FieldTable, | |
| Connection, ConnectionProperties, | |
| }; | |
| use std::error::Error; | |
| use tracing::{info, instrument}; | |
| use tracing_subscriber; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exif --ifd=0 --tag=0x8298 --set-value='(c) 2010 Karsten Kroesch' campground.jpg | |
| exif --ifd=0 --tag=0x010e --set-value='Campground Mojave Desert' -o campground.jpg campground.jpg.modified.jpeg | |
| **Copyright Watermark:** | |
| convert desert.jpg -fill white -undercolor '#00000080' -gravity South -annotate +0+5 ' (c) 2010 Karsten Kroesch ' desert.jpg | |
| **Border:** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Example Ansible Playbook | |
| hosts: all | |
| become: true | |
| vars: | |
| paketname: "htop" | |
| quellpfad: "/pfad/zur/datei" | |
| zielpfad: "/pfad/zum/ziel" | |
| tasks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def pods [] { kubectl get pods -o yaml | from yaml | get items } | |
| pods | get metadata.name | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- layouts/shortcodes/chart.html --> | |
| <div id="{{ .Get "id" }}" style="width:{{ .Get "width" }}px;height:{{ .Get "height" }}px;"> | |
| </div> | |
| <script> | |
| let data = JSON.parse({{ .Inner }}) | |
| console.log(data) | |
| canvas = document.getElementById('{{ .Get "id" }}'); | |
| Plotly.newPlot( canvas, [{x: data.ord, y: data.absz}], { margin: { t: 0 } } ); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Return the number of days the given certificate file is still valid | |
| # | |
| if [ "$#" -eq 0 ]; then | |
| echo "Usage: crt_valid_days <certificate>" | |
| exit 1 | |
| fi | |
| if ! command -v openssl &> /dev/null; then | |
| echo "ERROR: OpenSSL not installed." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package functional | |
| func Map[TValue any](values []TValue, f func(TValue) TValue) { | |
| for i, value := range values { | |
| values[i] = f(value) | |
| } | |
| } | |
| func Reduce[TValue, TResult any](values []TValue, f func(TValue, TResult) TResult) TResult { |