Skip to content

Instantly share code, notes, and snippets.

@dcommander
dcommander / tjfilterexample.c
Last active August 28, 2024 17:41
Program, based on tjexample.c, that demonstrates how to use the TurboJPEG 3 API to capture DCT coefficients from a JPEG file, modify them, and write them to another JPEG file
/*
* Copyright (C)2011-2012, 2014-2015, 2017, 2019, 2021-2024
* D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
@dcommander
dcommander / .gitattributes
Last active November 30, 2021 22:35
Test script and images for verifying that cjpeg properly generates grayscale JPEG images from grayscale input images
*.pgm binary
*.ppm binary
@dcommander
dcommander / debsig-import
Last active August 6, 2020 20:52
Script that imports a public key for use with debsig-verify
#!/bin/bash
set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT
TMPDIR=
@dcommander
dcommander / .gitignore
Last active February 13, 2023 20:17
Simple Java application that demonstrates https://github.com/TurboVNC/turbovnc/issues/186
JavaAppLauncher
*.app
*.class
*.jar
@dcommander
dcommander / imdiff
Last active March 7, 2019 19:39
Bash script that duplicates the functionality of VirtualGL's imgdiff program using ImageMagick, in a more compatible (and probably more accurate) way
#!/bin/bash
# Copyright (C)2019 D. R. Commander. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
@dcommander
dcommander / buildtvnchelperjars
Last active February 20, 2022 01:41
A script that automates building JNI JAR files for the TurboVNC Helper libraries in a specific release of TurboVNC
#!/bin/bash
set -u
set -e
trap onexit INT
trap onexit TERM
trap onexit EXIT
TMPDIR=
@dcommander
dcommander / git-initimg
Last active January 25, 2022 20:45
Scripts that facilitate using Git to track changes to photo/video content without actually committing the content
git config filter.heicfilter.clean heicsig
git config filter.heicfilter.smudge cat
git config filter.heicfilter.required true
git config filter.imgfilter.clean imgsig
git config filter.imgfilter.smudge cat
git config filter.imgfilter.required true
git config filter.vidfilter.clean vidsig
git config filter.vidfilter.smudge cat
git config filter.vidfilter.required true
cat >.gitattributes <<EOF
@dcommander
dcommander / vncsession
Last active December 23, 2018 16:15
Rudimentary TurboVNC Session Manager
#!/bin/bash
#
# Copyright (C) 2016 D. R. Commander
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
@dcommander
dcommander / Makefile
Last active April 2, 2024 10:12
Simple program to demonstrate OpenGL rendering without an X server
all: egltest
egltest: egltest.c
cc -O3 -Wall -Werror -I. -o $@ $^ -lOpenGL -lEGL
clean:
rm -f *.o egltest
@dcommander
dcommander / gencert.cn
Last active March 11, 2023 03:30
Scripts/config file that I use to create X.509 certificates for TurboVNC testing
set -e
SUBJ="/C=US/ST=Texas/L=Austin/O=The VirtualGL Project/OU=Software Development/"
# Fake Server CA
openssl genrsa -out ca_server.key 2048
openssl req -new -newkey rsa:2048 -nodes -out ca_server.csr -keyout ca_server.key -subj "$SUBJ""CN=VeNCryptFakeServerCA"
openssl x509 -req -days 3650 -startdate -enddate -in ca_server.csr -signkey ca_server.key -out ca_server.crt
rm -f *.csr *.srl