Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en-US"></html>
<head>
<meta charset="utf-8" />
<title>Imported SVG Symbols Example</title>
<link rel="stylesheet" href="plot.css" />
<script src="https://d3js.org/d3.v7.min.js"></script>
</head>
<body>
<div id="chart"></div>
@ubigene
ubigene / retry.sh
Created January 25, 2024 00:28
Retrying a shell (Bash) command
CMD=(command --with multiple --arguments)
max_retries=5
try_num=1
while true; do
"$${CMD[@]}" && break || sleep 5
[[ $try_num -eq $max_retries ]] && echo "Failed!" && exit 1
((try_num++))
done
@ubigene
ubigene / main.yaml
Last active January 8, 2025 18:58
Create Docker image pull secret for GCP in an idempotent way using Ansible
- name: Generate Docker registry secret manifest
changed_when: false
shell: |
kubectl -n finops create secret docker-registry gcr-json-key \
--docker-server=europe-docker.pkg.dev \
--docker-username=_json_key \
--docker-password="$(cat "${GCR_SECRET}")" \
--dry-run=client --output=json
register: docker_config
@ubigene
ubigene / azure-pipelines.yml
Created July 21, 2022 12:34
Simple Azure YAML pipeline for a Python app that consists of 3 stages: Build, Deploy and Test.
# Python to Linux Web App on Azure
# Build your Python project and deploy it to Azure as a Linux Web App.
# Change python version to one thats appropriate for your application.
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
trigger:
- master
variables:
# Azure Resource Manager connection created during pipeline creation