Skip to content

Instantly share code, notes, and snippets.

Avatar

Ian McDougall iemcd

View GitHub Profile
View gist:de2ee717c91aaae8eec56e8d12bd0851
I install comictagger with:
`$ pip install --user comictagger`
Then I try:
`$ comictagger`
and I get:
`(process:6616): GLib-CRITICAL **: 19:16:12.048: g_hash_table_contains: assertion 'hash_table != NULL' failed`
`(process:6616): GLib-CRITICAL **: 19:16:12.048: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed`
`Segmentation fault (core dumped)`
Confirmed that it happens on two computers, both running Mageia.
`$ python3 -q -X faulthandler .local/bin/comictagger`
@iemcd
iemcd / cbzclean
Last active May 8, 2020
A script to clean-up cbz and cbr files
View cbzclean
#!/bin/bash
#TODO: evaluate using --store option for recompression
#TODO: fix case-sensitive match in basename (not an issue for me)
shopt -s nocaseglob
suffix='(clean)'
maxjobs=16
@iemcd
iemcd / thumbnailer
Created May 8, 2020
A script to run ffmepgthumbnailer on a cron job (needs arguments supplied)
View thumbnailer
#!/bin/bash
shopt -s nocasematch
function thumbnail
{
local FILE
for FILE in "$@"
do
# echo "$FILE"
@iemcd
iemcd / dice_part.py
Created Mar 24, 2020
Partitioning Hands of Dice, Better
View dice_part.py
#!/usr/bin/python3
# Starting over, a little cleaner and a little better
# Ian McDougall, March 2020
import math
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
@iemcd
iemcd / 7d6.py
Created Mar 24, 2020
Partitioning Hands of Dice
View 7d6.py
#!/usr/bin/python3
import math
import numpy as np
#import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
def decrement(X):
if sum(X) == len(X): #this is a kludge to make the while loop stop
View boatmath.m
% Estimating the length & beam of boats from their tonnage.
% Ian McDougall
% 25 July 2019
clear all, close all, nfig=0;
% The Thames Measurement (TM) estimates the tonnage of a ship given its length (LOA) and beam in feet. It is intended for yachts.
function tons = TM(LOA,beam)
tons = ((LOA - beam).*beam.^2)/188;
endfunction
@iemcd
iemcd / Ynn.toc.pdfmark
Created Apr 9, 2019
Ynn ToC in pdfmark
View Ynn.toc.pdfmark
[ /Title (Contents)
/Page 3
/OUT pdfmark
[ /Title (Part 1: Introduction)
/Page 4
/Count -17
/OUT pdfmark
[ /Title (What Are The Gardens of Ynn?)
@iemcd
iemcd / pdfmarker.pl
Created Apr 7, 2019
PDF Annotation Tools
View pdfmarker.pl
#!/bin/perl
use strict;
use warnings;
use 5.22.3;
use List::Util qw( min max );
# Fields are: char, x1, y1, x2, y2, pp
open(my $table, "<", $ARGV[0]) or die "Can't open $ARGV[0]: $!";
You can’t perform that action at this time.