Skip to content

Instantly share code, notes, and snippets.

View corneliusdavid's full-sized avatar

David Cornelius corneliusdavid

View GitHub Profile
@corneliusdavid
corneliusdavid / BuildHugoPhotoPage.go
Created February 17, 2023 16:56
A simple console app written in Go to build Hugo pages for a personal photo album, specifying a title, description, source folder for images, and a thumbnail.
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
@corneliusdavid
corneliusdavid / plugin-off.cmd
Created June 2, 2022 16:46
simple batch file to disable a Retail Pro plugin; must be running in DOS Command shell as Administrator; pass in the name of the plugin without extension
if not exist %1.mnf goto AlreadyOFF
regsvr32 /u %1.dll
ren %1.mnf %1._mnf
goto END
:AlreadyOFF
echo %1 already off
:END
@corneliusdavid
corneliusdavid / plugin-on.cmd
Last active June 2, 2022 16:46
simple batch file to enable a Retail Pro plugin; must be running in DOS Command shell as Administrator; pass in the name of the plugin without extension
if not exist %1._mnf goto AlreadyON
ren %1._mnf %1.mnf
regsvr32 %1.dll
goto END
:AlreadyON
echo %1 already on
:END
@corneliusdavid
corneliusdavid / CCLogo.svg
Created May 30, 2022 05:32
The Cornelius Concepts company logo in SVG format
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@corneliusdavid
corneliusdavid / ReportAppUsage.php
Last active May 11, 2022 04:47
PHP script called by ReportAppUsage.pas that updates a MySQL database with parsed NAME=VALUE parameters from the URL.
<!DOCTYPE html>
<html>
<body>
<?php
$ip = $_SERVER["REMOTE_ADDR"];
echo "ip: $ip ... ";
$mysqli = new mysqli("localhost", "db_user", "db_password", "database");
if ($mysqli->connect_errno) {
@corneliusdavid
corneliusdavid / ReportAppUsage.pas
Last active May 11, 2022 04:46
Delphi procedure to report application usage by building a parameterized URL and calling a remote PHP script that updates a MySQL database.
procedure ReportAppUsage;
{ send a bunch of information out to a PHP script to remotely log application usage }
function EncodeURIComponent(const ASrc: string): UTF8String;
{ from excellent blog: https://marc.durdin.net/2012/07/indy-tiduri-pathencode-urlencode-and-paramsencode-and-more/ }
const
HexMap: UTF8String = '0123456789ABCDEF';
function IsSafeChar(ch: Integer): Boolean;
begin
@corneliusdavid
corneliusdavid / InstallBrowsers.ps1
Last active February 11, 2022 16:44
PowerShell/Chocolatey script to install several browsers; run as administrator
$StopWatch = [system.diagnostics.stopwatch]::StartNew();
choco feature enable -n allowGlobalConfirmation
# required for some browsers
choco install chocolatey-core.extension
Write-Host "=== Install Vivaldi ==="
choco install vivaldi.portable
choco install vivaldi
@corneliusdavid
corneliusdavid / InstallTools.ps1
Last active February 8, 2022 19:33
PowerShell/Chocolatey script to install my favorite tools; run as administrator; modify line for PDFXChangePro if it's not licensed or your license file is somewhere else
$StopWatch = [system.diagnostics.stopwatch]::StartNew();
choco feature enable -n allowGlobalConfirmation
choco install sysinternals
choco install treesizefree
choco install xml-notepad
choco install 7zip
choco install putty
choco install winscp
@corneliusdavid
corneliusdavid / InstallSQLite.ps1
Last active February 8, 2022 19:34
PowerShell/Chocolatey script to install SQLite and relate tools; run as administrator
$StopWatch = [system.diagnostics.stopwatch]::StartNew();
choco feature enable -n allowGlobalConfirmation
Write-Host "=== Installing SQLite ==="
choco install sqlite
Write-Host "=== Installing SQLite Shell ==="
choco install sqlite.shell
@corneliusdavid
corneliusdavid / InstallChocolatey.ps1
Created February 8, 2022 19:23
PowerShell script to install Chocolatey--straight from chocolatey.org but with preface text
# Install Chocolatey!
# this script is taken from https://chocolatey.org/install#individual and modified only slightly
Write-Host "Did you run this from PowerShell started as Admin?"
Write-Host "If not, abort it now and restart; otherwise, continue..."
Read-Host
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072