Skip to content

Instantly share code, notes, and snippets.

@actionjack
actionjack / trivy-db-check.sh
Last active August 13, 2024 10:30
trivy-db-check.sh
#!/bin/bash
# GitHub Container Registry API URL for trivy-db container package
API_URL="https://api.github.com/orgs/aquasecurity/packages/container/trivy-db/versions"
# Function to run jq using Docker
docker_jq() {
docker run --rm -i alpine:latest sh -c "apk add --no-cache jq > /dev/null 2>&1 && jq $*"
}
@actionjack
actionjack / gist:e33cd9b59f32ce65cf56713437ee5ca5
Created May 10, 2024 10:34
Parallelise Jenkins components in Groovy
def components = ["component1", "component2", "component3", "component4", "component5"]
def processComponent(component) {
echo "Processing $component..."
// Add your processing logic here
sleep 2 // Simulating some processing time
echo "$component processed."
}
stage('Process Components') {
@actionjack
actionjack / kill_all.groovy
Created April 29, 2024 15:01 — forked from steven-terrana/kill_all.groovy
[Kill All Builds] kill all queued and running jobs #Jenkins
import java.util.ArrayList
import hudson.model.*;
// Remove everything which is currently queued
def q = Jenkins.instance.queue
for (queued in Jenkins.instance.queue.items) {
q.cancel(queued.task)
}
// stop all the currently running jobs
@actionjack
actionjack / gist:096945c9816b047414ea56d3bc6e922a
Created January 18, 2024 21:57
Streamlining DevOps: The Power of Automated DORA Metrics and Actionable Thresholds
# Streamlining DevOps: The Power of Automated DORA Metrics and Actionable Thresholds
## Introduction
Welcome to the ever-evolving world of DevOps, where precision and agility are paramount. For professionals across the spectrum, from beginners to veterans, mastering DORA (DevOps Research and Assessment) metrics is a critical step. These metrics – Deployment Frequency, Lead Time for Changes, Change Failure Rate, and Time to Restore Service – act as key indicators of your DevOps health. However, the real magic happens when you automate these metrics and establish insightful thresholds to trigger actions. Let's delve into how this approach not only simplifies your process but significantly elevates your DevOps game.
## Why Opt for Automation?
### 1. **Real-Time Data for Proactive Management**
Imagine having a dashboard that updates you instantly on your team's performance. Automated DORA metrics provide these updates, enabling you to tackle issues promptly and maintain a streamlined workflow.
@actionjack
actionjack / gist:6cd422bf5a48803ff50ce5dacecd70d5
Created January 17, 2024 17:41
Incorporating Solo Work into Pairing-Based Teams: Striking the Right Balance
# Incorporating Solo Work into Pairing-Based Teams: Striking the Right Balance
**Introduction**
In the world of Agile and DevOps, pairing has established itself as a cornerstone practice, particularly in software development. Pair programming, where two developers work together at one workstation, is not just a technique to improve code quality but also an excellent way to share knowledge and foster team collaboration. However, it's crucial to recognize the importance of solo work in these environments. Balancing pairing with opportunities for individual work can lead to even greater productivity and job satisfaction. This blog explores how to effectively incorporate solo work into pairing-based teams.
**Understanding the Need for Solo Work**
Before we delve into strategies, it's important to understand why solo work is necessary even in a pairing-centric environment. Solo work offers several benefits:
@actionjack
actionjack / gist:05be6be0e6aad04b2a8a8e98567ad09e
Created January 16, 2024 15:44
Enhancing DevOps: Beyond DORA Metrics - A Holistic Measurement Strategy
**Title:**
"Enhancing DevOps: Beyond DORA Metrics - A Holistic Measurement Strategy"
**Introduction:**
Our previous exploration into the limitations of DORA (DevOps Research and Assessment) metrics highlighted their importance in measuring software development team performance while acknowledging their constraints. This follow-up post aims to expand on these insights, integrating real-world case studies and actionable strategies to create a more comprehensive approach to DevOps success measurement.
**1. Understanding DORA Metrics and Their Limitations:**
We revisit the core aspects of DORA metrics - their focus on deployment frequency, change lead time, change failure rate, and mean time to recover. We'll address common criticisms such as their potential for encouraging velocity over value, the risk of oversimplification, and the danger of 'gaming the system.'
**2. Real-World Case Studies:**
@actionjack
actionjack / gist:e670ddcefd6a723174bd436791048574
Created January 15, 2024 15:03
Navigating the Maintenance Mode of a Software Project: Best Practices and Strategies
**Introduction:**
In the ever-evolving landscape of software development, reaching the Maintenance Mode phase is both an achievement and a new challenge. This stage, often misunderstood, is where a software project transitions from active development of new features to a focus on supporting and enhancing the existing codebase. It’s a critical period that ensures the long-term success and sustainability of a software product. In this post, we’ll explore the best practices and strategies for effectively managing the Maintenance Mode of a software project.
**Understanding Maintenance Mode:**
Maintenance Mode is not about stagnation; it’s about stability and reliability. This phase typically involves:
1. **Bug Fixes and Minor Enhancements**: Addressing existing issues and making small improvements.
2. **Performance Optimization**: Enhancing the efficiency and responsiveness of the application.
3. **Security Updates**: Keeping the software secure against new vulnerabilities.
4. **Compatibility Maintenance**: Ens
@actionjack
actionjack / gist:03d74a0150a3545b29c3736b88461fe8
Created January 13, 2024 15:27
Understanding the Limitations of DORA Metrics in DevOps
# Understanding the Limitations of DORA Metrics in DevOps: A Balanced Perspective
## Introduction
In the rapidly evolving tech industry, the DORA (DevOps Research and Assessment) metrics have emerged as a popular tool for measuring software development team performance. However, as with any measurement system, it's crucial to understand its limitations. In this blog post, we'll explore some critiques of the DORA metrics and provide insights on how to use them effectively.
### The Emphasis on Velocity
DORA metrics often focus on velocity, gauging the frequency of code deployments. While this can indicate efficiency, it's not always a reliable measure of software quality or value. High deployment rates might not equate to meaningful contributions to the project or the end user.
### The Risk of Reductionism
Additionally, DORA metrics concentrate on a limited set of indicators, potentially oversimplifying the complex landscape of software development and delivery. This reductionist approach can obscure vital
# Bash best practices and style-guide
Just simple methods to keep the code clean.
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/).
## Quick big rules
* All code goes in a function
* Always double quote variables
@actionjack
actionjack / gist:ef70853fad990f7cc62abff8c782b790
Created December 19, 2023 11:13
Bash script with concurrency control
#!/usr/bin/env bash
MAX_CONCURRENCY=10 # max task slots
sub_task() {
sleep $(( ( RANDOM % 10 ) + 1 ))
echo "Task $1 finished at $(date)"
}
mkfifo testfifo