Skip to content

Instantly share code, notes, and snippets.

View Rhinogradentia's full-sized avatar

Nadine Rhinogradentia

  • Vienna (Austria)
View GitHub Profile
@Rhinogradentia
Rhinogradentia / drone-cleanup.php
Created November 28, 2022 10:52 — forked from MorrisJobke/drone-cleanup.php
Script to cleanup drone builds after a given retention period
<?php
/*
Script that cleans up old builds of all repos of a drone server.
Dependencies:
$ # having PHP and composer installed
$ composer require "guzzlehttp/guzzle=^6.3"
@Rhinogradentia
Rhinogradentia / remove_old_builds.sql
Created November 23, 2022 08:31 — forked from david-zw-liu/remove_old_builds.sql
Keep 1000 builds per repos for DroneCI (sqlite3 version >= 3.25 required)
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite
-- Enable to delete logs by cascading delete
PRAGMA foreign_keys = ON;
WITH n_build_ids_per_repo as (
SELECT build_id
FROM (
SELECT
build_id,
build_repo_id,
HANDY ONE-LINE SCRIPTS FOR AWK 30 April 2008
Compiled by Eric Pement - eric [at] pement.org version 0.27
Latest version of this file (in English) is usually at:
http://www.pement.org/awk/awk1line.txt
This file will also be available in other languages:
Chinese - http://ximix.org/translation/awk1line_zh-CN.txt
USAGE: