Skip to content

Instantly share code, notes, and snippets.

Avatar

Johan van der Knijff bitsgalore

View GitHub Profile
@bitsgalore
bitsgalore / tweet-example.json
Created November 20, 2022 13:32
Example of JSON format used in Twitter archive for one single Tweet (from tweets.js)
View tweet-example.json
{
"tweet" : {
"edit_info" : {
"initial" : {
"editTweetIds" : [
"1588159317974319106"
],
"editableUntil" : "2022-11-03T13:51:02.000Z",
"editsRemaining" : "5",
"isEditEligible" : false
@bitsgalore
bitsgalore / ht2jk-jpylyzer.xnl
Created August 3, 2022 18:52
Jpylyzer output for High Throughput JPEG 2000 codestream downloaded from https://chafey.github.io/openjphjs/test/browser/index.html
View ht2jk-jpylyzer.xnl
<?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>
<fileInfo>
<fileName>6e3Gf8Mu</fileName>
<filePath>/home/johan/test/6e3Gf8Mu</filePath>
@bitsgalore
bitsgalore / readme.md
Last active June 14, 2022 15:20
Storage media type detection using the Windows API and Python
@bitsgalore
bitsgalore / iso9660-withschema.xml
Created April 19, 2022 16:54
Isolyzer output with added namespace and XSD schema definitions
View iso9660-withschema.xml
<?xml version="1.0" ?>
<isolyzer xmlns="http://kb.nl/ns/isolyzer/v1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://kb.nl/ns/isolyzer/v1/ https://raw.githubusercontent.com/KBNLresearch/isolyzer/xsd/xsd/isolyzer-v-1-0.xsd">
<toolInfo>
<toolName>cli.py</toolName>
<toolVersion>1.4.0a2</toolVersion>
</toolInfo>
<image>
<fileInfo>
<fileName>iso9660.iso</fileName>
<filePath>/home/johan/isolyzer/testFiles/iso9660.iso</filePath>
@bitsgalore
bitsgalore / highsierra.xml
Created April 14, 2022 15:09
Isolyzer output for High Sierra file system
View highsierra.xml
<?xml version="1.0" ?>
<isolyzer>
<toolInfo>
<toolName>cli.py</toolName>
<toolVersion>1.4.0a1</toolVersion>
</toolInfo>
<image>
<fileInfo>
<fileName>BOOKSHELF.iso01.iso</fileName>
<filePath>/home/johan/kb/iso-identification/HSF/BOOKSHELF.iso01.iso</filePath>
@bitsgalore
bitsgalore / test-cli-wildcard.py
Created April 12, 2022 16:49
Cross-platform CLI file input with wildcards
View test-cli-wildcard.py
import sys
import os
import glob
import platform
import codecs
import argparse
# Create parser
parser = argparse.ArgumentParser(
description="Test CLI input with wildcards, multiple platforms")
@bitsgalore
bitsgalore / saveToWayback.py
Last active April 22, 2021 22:01
Saves URLs (from either list or root URL) to internet Archive's Wayback Machine
View saveToWayback.py
#! /usr/bin/env python3
#
"""
Save web pages to Wayback Machine. Argument urlsIn can either be
a text file with URLs (each line contains one URL), or a single
URL. In the first (input file) case it will simply save each URL.
In the latter case (input URL) it will extract all links from the URL, and
save those as well as the root URL (useful for saving a page with all
of its direct references). The optional --extensions argument can be used
to limit this to one or more specific file extensions. E.g. the following
View warc-capture-script-response.py
#! /usr/bin/env python3
from warcio.capture_http import capture_http
import requests
def main():
# Existing warc.gz file (created with wget, then compressed using warcio's
# 'recompress' command)
with capture_http("ziklies.home.xs4all.nl.warc.gz"):
for indexOnder in range(1, 8):
for indexMidden in range(1, 8):
View instructies-omsipcreator.md

Instructies omSipCreator

Waarschuwing

Gebruik omSipCreator voor de tests op kopieën van batches, en NIET op de originele opslaglocaties! Dit is vooral omdat omSipCreator in 'prune' modus (opschoonfunctie) batches wijzigt en daarbij data verwijdert!!

Ik neem in de voorbeelden hieronder even aan dat Python onder de volgende folder geïnstalleerd is:

C:\Python37\
@bitsgalore
bitsgalore / imagemagick-openjpeg-build-install.md
Created February 26, 2020 14:14
Imagemagick + openjpeg build and install notes
View imagemagick-openjpeg-build-install.md

ImageMagick / OpenJPEG build and install notes

I always end up getting this wrong; steps below worked for Linux Mint 19.3 (based on Ubuntu 18.04). Build/installation order is important; JPEG 2000 support in ImageMagick only works if OpenJPEG is found at build time, so we have to start with that. Note that for OpenJPEG an 'openjpeg-dev' Debian package exists. As I'm not entirely sure this is the most up-to-date version, and JPEG 2000 support is important for me, I'm compiling this library from the sources here. Otherwise everything under the 'OpenJPEG' could probably be subsituted by the one-liner sudo at-get install openjpeg-dev).

Cmake