Skip to content

Instantly share code, notes, and snippets.

View bitsgalore's full-sized avatar

Johan van der Knijff bitsgalore

View GitHub Profile
@bitsgalore
bitsgalore / geolocateDomains.py
Last active January 29, 2020 17:21
Geolocation of web domains
#! /usr/bin/env python3
"""
Geolocate web domains. Input file is a text file where each line contains
1 web domain.
Author: Johan van der Knijff
Requirements:
1. Unix/Linux environment with 'host' tool installed,
@bitsgalore
bitsgalore / jp2kmagicDifferences.md
Last active January 29, 2020 13:42
JPEG 2000 differences shared-mime-info vs Unix File
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns="http://openpreservation.org/ns/jpylyzer/v2/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openpreservation.org/ns/jpylyzer/v2/ http://jpylyzer.openpreservation.org/jpylyzer-v-2-0.xsd">
<toolInfo>
<toolName>jpylyzer</toolName>
<toolVersion>2.0.0</toolVersion>
</toolInfo>
<file xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ns0="adobe:ns:meta/" xmlns:ns2="http://ns.adobe.com/xap/1.0/" xmlns:ns4="http://ns.adobe.com/photoshop/1.0/" xmlns:ns5="http://ns.adobe.com/xap/1.0/mm/" xmlns:ns6="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:ns7="http://ns.adobe.com/tiff/1.0/" xmlns:ns8="http://ns.adobe.com/exif/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<fileInfo>
<fileName>jpeg2000_2x.jp2</fileName>
<filePath>/home/johan/Downloads/jpeg2000_2x.jp2</filePath>
@bitsgalore
bitsgalore / checkLastModified.sh
Last active November 12, 2019 10:03
Report last-modified date header for a list of URLs
#!/bin/bash
# Check value of last-modified date header for list of URLs
#
# Uses curl: https://curl.haxx.se/
# Display usage message if command line does not contain expected
# number of arguments
if [ "$#" -ne 2 ] ; then
echo "Usage: checkLastModified.sh fileIn fileOut" >&2
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns="http://openpreservation.org/ns/jpylyzer/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openpreservation.org/ns/jpylyzer/ http://jpylyzer.openpreservation.org/jpylyzer-v-1-1.xsd">
<toolInfo>
<toolName>jpylyzer</toolName>
<toolVersion>1.18.0</toolVersion>
</toolInfo>
<fileInfo>
<fileName>openJPEG15.jp2</fileName>
<filePath>/home/johan/jpylyzer-test-files/openJPEG15.jp2</filePath>
<fileSizeInBytes>670372</fileSizeInBytes>

Proposed jpylyzer output format changes

Johan van der Knijff, 3 July 2019

This document describes some proposed changes to the jpylyzer output format for the upcoming jpylyzer 2.0 release (which is foreseen for November 2019). The main occasion for these changes is the addition of raw codestream validation functionality. Since this functionality will lead to a small (but nevertheless breaking) change to jpylyzer's output format, this is a good moment for fixing a few other inconsistencies.

Related Github issues are:

Reading a tape with dd and mt

In the simplest case, reading data from a tape involves nothing more than a dd command line such as this one:

dd if=/dev/nst0 of=file0001.dd bs=16384

Here, the "if" argument tells dd to read input from the non-rewind block device /dev/nst0, and the value of "of" defines the file where

@bitsgalore
bitsgalore / jpylyzer2-multi-jp2.xml
Created July 3, 2019 15:31
Example jpylyzer 2 output file, using --format jp2, multiple input files
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns="http://openpreservation.org/ns/jpylyzer/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openpreservation.org/ns/jpylyzer/ http://jpylyzer.openpreservation.org/jpylyzer-v-2-0.xsd">
<toolInfo>
<toolName>jpylyzer</toolName>
<toolVersion>2.0.0a1</toolVersion>
</toolInfo>
<file>
<fileInfo>
<fileName>aware.jp2</fileName>
<filePath>/home/johan/test/aware.jp2</filePath>
@bitsgalore
bitsgalore / jpylyzer2-jp2.xml
Last active July 3, 2019 15:28
Example jpylyzer 2 output file, using --format jp2
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns="http://openpreservation.org/ns/jpylyzer/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openpreservation.org/ns/jpylyzer/ http://jpylyzer.openpreservation.org/jpylyzer-v-2-0.xsd">
<toolInfo>
<toolName>jpylyzer</toolName>
<toolVersion>2.0.0a1</toolVersion>
</toolInfo>
<file>
<fileInfo>
<fileName>aware.jp2</fileName>
<filePath>/home/johan/test/aware.jp2</filePath>
@bitsgalore
bitsgalore / jpylyzer2-j2c.xml
Last active July 3, 2019 15:24
Example jpylyzer 2 output file, using --format j2c
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns="http://openpreservation.org/ns/jpylyzer/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openpreservation.org/ns/jpylyzer/ http://jpylyzer.openpreservation.org/jpylyzer-v-2-0.xsd">
<toolInfo>
<toolName>jpylyzer</toolName>
<toolVersion>2.0.0a1</toolVersion>
</toolInfo>
<file>
<fileInfo>
<fileName>is_codestream.j2c</fileName>
<filePath>/home/johan/test/is_codestream.j2c</filePath>