Skip to content

Instantly share code, notes, and snippets.

View JoSSte's full-sized avatar

JoSSte

View GitHub Profile
@JoSSte
JoSSte / JobCleanup.groovy
Created October 13, 2023 06:36
Jenkins failed/aborted jobs cleanup
import java.util.ArrayList
import hudson.model.*;
def ArrayList<String> getJobList(String pipelineName) {
def hi = hudson.model.Hudson.instance;
def item = hi.getItemByFullName(pipelineName);
def jobs = item.getAllJobs();
def arr = new ArrayList<String>();
@JoSSte
JoSSte / netperf.md
Last active October 13, 2023 06:35
Network Performance

Assume the port is 11234 (above 1024 so no admin privileges required) and that the host has ip 10.10.10.240

On the host:

netserver -p 11234

On the client:

netperf -H 10.10.10.240 -p 11234 -l 100

shutting down the server

@JoSSte
JoSSte / gitTricks.md
Last active November 13, 2023 10:24
Git tricks

1 Housekeeping

1.1 Remove local cache of deleted branches on remote

When you have merged a branch into another and deleted it on bitbucket, it may still exist on your PC. if you experience that there are too many of these, this command will remove them. Consider cleaning up your local branches first.

git remote update origin --prune

1.2 Clean up local branches

@JoSSte
JoSSte / dmi.md
Created May 10, 2022 14:51
DMI weather units regex

Regular expression to parse DMI's API Unit confluence page into json

Regex

([a-z0-9_\*]*)\t([a-zA-Z\/°²\-\%]*)\t(.+)\t(.+)\t[X]{0,1}\t[X]{0,1}

If testing at https://regexr.com/ use /gm

/^([a-z0-9_\*]*)\t([a-zA-Z\/°²\-\%]*)\t(.+)\t(.+)\t[X]{0,1}\t[X]{0,1}$/gm
@JoSSte
JoSSte / ownCA.md
Created May 5, 2022 21:14
Act as your own Certificate Authority (CA)

Act as your own Certificate Authority (CA)

❗ on git bash on windows you may need to turn off path conversion.
You can do so with export MSYS_NO_PATHCONV=1

1 Setting up the CA

First of all you need to have a Root Certificate to sign your issued certificates with

@JoSSte
JoSSte / Vagrantfile
Last active May 29, 2021 21:10
Vagrantfile to generate Ubuntu box with gui and vscode
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for