Skip to content

Instantly share code, notes, and snippets.

View exabrial's full-sized avatar

Jonathan S. Fisher exabrial

View GitHub Profile
@exabrial
exabrial / cleanup-gitlab-pipelines.sh
Created December 1, 2023 17:47 — forked from chrishoerl/cleanup-gitlab-pipelines.sh
Bulk delete gitlab pipelines older than a given date
#!/bin/bash
# Purpose: Bulk-delete GitLab pipelines older than a given date
# Author: github.com/chrishoerl
# GitLab API: v4
# Requirements: jq must be instaled ($ sudo apt install jq)
# API example: https://gitlab.example.com/api/v4/projects
# API example: https://gitlab.example.com/api/v4/projects/<projectid>/pipelines
#
# NOTE: Script is just a dryrun. To really delete pipelines, simply uncomment line 49 to activate
#
@exabrial
exabrial / scar_tissue.md
Created May 28, 2023 02:24 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

@exabrial
exabrial / xtrabackup_full_increment_restore.sh
Created January 11, 2023 22:12 — forked from SQLadmin/xtrabackup_full_increment_restore.sh
Automate xtrabackup for FULL/Incremental and restore
#!/bin/bash
# This is my production backup script.
# https://sqlgossip.com
set -e
set -u
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: Perform Full Backup"
[Unit]
Description=xxx ${project.artifactId} ${project.version}
After=network.target
[Service]
Environment=SERVER_BASEPORT=${xxx.server.baseport} JAVA_HOME=/usr/lib/jvm/${runtime-jdk}
EnvironmentFile=/etc/default/${project.artifactId}
Type=simple
WorkingDirectory=/opt/${project.artifactId}
ExecStart=/usr/bin/authbind --depth 3 /usr/lib/jvm/${runtime-jdk}/bin/java -jar /opt/${project.artifactId}/${project.artifactId}-exec.jar
@exabrial
exabrial / fixed-rewrite-config-prettyfaces.xsd
Created April 8, 2021 14:40
fixed-rewrite-config-prettyfaces.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2013 Lincoln Baxter, III
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@exabrial
exabrial / haproxy.cfg
Created November 12, 2020 15:51 — forked from phemmer/haproxy.cfg
haproxy log SSL master key
global
lua-load haproxy.lua
frontend X
tcp-request session set-var(sess.ssl_session_id) ssl_fc_session_id,hex if { ssl_fc }
tcp-request content lua.ssl-log-key if { ssl_fc }
@exabrial
exabrial / Confirm-gitlab-email.md
Created August 6, 2020 16:34 — forked from macdja38/Confirm-gitlab-email.md
Confirm gitlab email by CLI

On your gitlab server run gitlab-rails console production

Find your user via user = User.find_by(email: "youroldemail@example.com")

Optionally change the user's email with user.email = "yournewemail@example.com" Then run user.save!

Get the user's token with user.confirmation_token

https://PutYourGitlabHere/users/confirmation?confirmation_token=PutYourTokenHere

@exabrial
exabrial / junit4-expected-to-junit5-assertThrows.md
Created July 27, 2020 18:13
Regular Expression to Match Junit4 "expected=" tests and convert them to Junit5 "assertThrows()->" tests in Eclipse

Search for this in Eclipse:

(?s)\t@Test\(expected = (\w+\.class)\)\r?\n\tpublic void (test\w+\(\)) (?:throws \w*Exception )?\{(\r?\n\t\t.*?\r?\n\t)\}\r?\n

Replace with the following:

#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.