Skip to content

Instantly share code, notes, and snippets.

@wcmatthysen
wcmatthysen / compute_etag.sh
Last active June 4, 2024 07:35 — forked from rajivnarayan/compute_etag.sh
Calculate checksum corresponding to the entity-tag hash (ETag) of Amazon S3 objects
#!/bin/bash
#
# Calculate checksum corresponding to the entity-tag hash (ETag) of Amazon S3 objects
#
# Usage: compute_etag.sh <filename> <part_size_mb>
#
# filename: file to process
# part_size_mb: chunk size in MiB used for multipart uploads.
# This is 8M by default for the AWS CLI See:
# https://docs.aws.amazon.com/cli/latest/topic/s3-config.html#multipart_chunksize
@wcmatthysen
wcmatthysen / mediaCheck.sh
Created January 24, 2023 15:24
Confirm all media in a path can be played back using ffmpeg
#!/bin/bash
# Name: mediaCheck
# Purpose: Confirm all media in a path can be played back using ffmpeg
# Requires:
# * ffmpeg in $PATH
# * date in $PATH
# * find in $PATH
function checkReqs {
# checks requirements for the script
find . -type f -exec mkvpropedit '{}' --edit track:2 --set name="English" \;
@wcmatthysen
wcmatthysen / encode_to_h265.sh
Created August 10, 2022 11:24
Re-encode H.264 to H.265 video
ffmpeg -hwaccel cuda -i input.mp4 -c:v hevc_nvenc -vtag hvc1 -preset slow -c:a copy output.mp4
@wcmatthysen
wcmatthysen / pocketchip_first-run.md
Last active September 22, 2020 12:47 — forked from boogah/pocketchip_first-run.md
PocketCHIP: First Run!

My suggested list of terminal commands for your brand new PocketCHIP.

First off, edit your /etc/apt/sources.list file to look like this:

deb http://deb.debian.org/debian/ jessie main contrib non-free
deb-src http://deb.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
@wcmatthysen
wcmatthysen / ComponentUtils.java
Created February 19, 2020 11:08
Set heavyweight tooltip popups for any component in Swing.
public final class ComponentUtils {
private ComponentUtils() { }
public static void forceHeavyWeightPopups(JComponent component) {
try {
Class<?> clazz = Class.forName("javax.swing.ClientPropertyKey");
Field field = clazz.getDeclaredField("PopupFactory_FORCE_HEAVYWEIGHT_POPUP");
field.setAccessible(true);
component.putClientProperty(field.get(null), Boolean.TRUE);
/*****************************************
* Read QSee/Zmodo cameras *
* Forward stream to FIFO pipe *
* Author: Daniel Osborne *
* Based on IP Cam Viewer by Robert Chou *
* License: Public Domain *
*****************************************/
/* Version history
* 0.43 - 2015-06-12
@wcmatthysen
wcmatthysen / TreeTableViewTest.java
Created November 21, 2019 19:41
TreeTableView Test Application
import java.util.List;
import javafx.application.Application;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
@wcmatthysen
wcmatthysen / TreeViewTest.java
Created November 21, 2019 19:04
TreeView Test Application
import java.util.List;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.MultipleSelectionModel;
import javafx.scene.control.SelectionMode;
@wcmatthysen
wcmatthysen / fix-osm-data.sql
Last active February 19, 2019 10:50
Fix up OSM Data to work with stylesheets.
/* Create missing columns */
alter table planet_osm_line drop column if exists name_en;
alter table planet_osm_line rename column "name:en" to name_en;
update planet_osm_line set name_en = name where name_en is null and name is not null;
alter table planet_osm_point drop column if exists population;
alter table planet_osm_point add column population text;
update planet_osm_point set population = tags->'population' where tags->'population' is not null;
alter table planet_osm_point drop column if exists capital;