Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond because too much is going on

David Tonhofer dtonhofer

💭
I may be slow to respond because too much is going on
View GitHub Profile
@dtonhofer
dtonhofer / core.clj
Last active Oct 9, 2019
"neighbor" function from page 94 of the Joy Of Clojure, 2nd edition, but modified. Also with pre/post conditions using specs, and test code.
View core.clj
; ===
; "neighbor" function from Chapter 5 (page 94) of the Joy Of Clojure, 2nd edition.
; ...modified and spec-ed!
;
; Applicable license is the unlicense: http://unlicense.org
; except for code taken from "Joy of Clojure, 2nd edition" (i.e. "neighbors-orig"),
; which is distributed under the Eclipse License.
;
; In a Leiningen project called "neighbor", this will be file src/neighbor/core.clj
; The project needs to declare these dependencies:
@dtonhofer
dtonhofer / resize_photos.sh
Created Jul 3, 2019
A shell script around the ImageMagick "convert" command. Shrink jpegs in a source directory to 25% of the original width/height.
View resize_photos.sh
#!/bin/bash
# This program passes shellcheck (www.shellcheck.net)
# Author: David Tonhofer
# Complexity: Low
# License: Public Domain / "The Unlicense" - https://unlicense.org/
# ===
#
# Synopsis:
#
@dtonhofer
dtonhofer / clean_root_homedir.sh
Last active Feb 3, 2020
A simple bash script to delete anything that might have accumulated in root's home directory, i.e. /root
View clean_root_homedir.sh
#!/bin/bash
# ===
# Author: David Tonhofer
# Rights: Public Domain
# ===
set -o nounset
ROOT=/root
@dtonhofer
dtonhofer / split_ca_bundle.pl
Created Apr 28, 2019
Split a certificate bundle like "/etc/pki/tls/certs/ca-bundle.crt" into individual certificates labeled by issuer
View split_ca_bundle.pl
#!/usr/bin/perl
use strict;
use warnings;
# ===
# Synopsis:
#
# sbin/split_ca_bundle.pl /etc/pki/tls/certs/ca-bundle.crt
# sbin/split_ca_bundle.pl /etc/pki/tls/certs/ca-bundle.crt
@dtonhofer
dtonhofer / installing_confluence_using_another_jre_than_the_embedded_one.txt
Last active May 7, 2019
How to install Atlassian Confluence (using the "installer" download), using another JRE than the embedded one
View installing_confluence_using_another_jre_than_the_embedded_one.txt
How to install Atlassian Confluence (using the "installer" download), using another JRE than the embedded one
=============================================================================================================
- When: 2019-04
- For Confluence 6.15.1
- On Linux/Unix (actually Fedora 29)
- See also: https://jira.atlassian.com/browse/CONFSERVER-57895 "Installing Confluence in OpenSUSE Tumbleweed through the installer fails"
So we have a problem because installation of Confluence using the binary INSTALL4J install module fails:
@dtonhofer
dtonhofer / test_dumper.pl
Last active May 7, 2019
Comparing behaviour of Perl Data::Dumper when using "Pure Perl" and "XS" mode for non-iso-8859-1 codepoints
View test_dumper.pl
#!/usr/bin/perl
# ===
# Testing what Perl's Data::Dumper does with "high" characters e.g.
#
# å -> iso-8859-1 : 0xE5
# Unicode UTF-16 : 0x00E5
# Unicode UTF-8 : 0xC3A5
#
# See also:
You can’t perform that action at this time.