Skip to content

Instantly share code, notes, and snippets.

View dbazile's full-sized avatar

David Bazile dbazile

View GitHub Profile
@dbazile
dbazile / ansible_variable_precedence.md
Created December 2, 2022 14:58 — forked from ekreutz/ansible_variable_precedence.md
Ansible variable precedence (order, hierarchy)
#!/bin/env python3
import argparse
import json
import logging
import os
import re
import yaml
@dbazile
dbazile / burn_subtitles.sh
Created December 1, 2021 01:20
ffmpeg burn mkv subtitles
ffmpeg \
-hide_banner \
-i "$infile" \
-filter_complex "[0:v] [0:s] overlay, scale=-1:720" \
-preset fast \
-vcodec libx264 \
-acodec aac \
-sn \
-y \
-map_metadata -1 \
#!/bin/bash
set -e
NEW_CONFIG='/root/grub.cfg.new'
OLD_CONFIG='/boot/efi/EFI/fedora/grub.cfg'
checkpoint() { echo -e "\033[1m\n$*\033[0m"; }
ABSTRACT
An attempt to programmatically apply highlights to a complex DOM
element using a set of character ranges. Ultimately, this
implementation does not work properly as the highlighted nodes go
off track when there are multiple ranges in the same text node. I
got tired of looking at it (and will probably go with rangy or
something) but something in here may be useful someday.
Updated 2021-02-25: I think I fixed it. The problem was that I
@dbazile
dbazile / create-user.sh
Last active May 13, 2021 16:34
create account via LDAP in FreeIPA and Active Directory
#
# FreeIPA
#
ldapmodify \
-h 'ipa.test.priv' \
-x \
-D "$BIND_DN" \
-w "$BIND_PW" \
"$@" \
@dbazile
dbazile / JdbiMockTest.java
Last active March 8, 2021 20:40
A test mock harness for Jdbi 3. Hideous and potentially brittle but it works (probably).
/*
* Versions:
* JDK 11, Jdbi 3.16.0, Mockito 3.6.28
*/
package bazile;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
@dbazile
dbazile / ldapsearch.sh
Created February 8, 2021 17:48
openldap ldapsearch per-call cert override
LDAPTLS_CACERT=/path/to/ca.pem \
ldapsearch ...
@dbazile
dbazile / pom.xml
Created February 6, 2021 22:24
java maven build properties bundler thingymadoodle
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>bazile</groupId>
<artifactId>test-build-props</artifactId>
<version>0.0.0</version>
<properties>
<maven.compiler.source>11</maven.compiler.source>
@dbazile
dbazile / PluginDownloader.java
Created February 6, 2021 20:24
Jenkins plugin download
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;