Skip to content

Instantly share code, notes, and snippets.

View klabarge's full-sized avatar

Kyle LaBarge klabarge

View GitHub Profile
@klabarge
klabarge / s3-get.sh
Created January 22, 2024 14:21 — forked from mmaday/s3-get.sh
S3 signed GET in plain bash (Requires openssl and curl)
#!/usr/bin/env bash
#
# Usage:
# s3-get.sh <bucket> <region> <source-file> <dest-path>
#
# Description:
# Retrieve a secured file from S3 using AWS signature 4.
# To run, this shell script depends on command-line curl and openssl
#
# References:
@klabarge
klabarge / CreatePrinters.ps1
Last active March 4, 2022 00:15
Creates x number of printers with random drivers available to the system
<#
.DESCRIPTION
Create x number of printers based off drivers
available to the system.
#>
function AddPrinters($PrinterCount) {
function GetRandomDriver() {
$PrintDrivers = Get-PrinterDriver
return $PrintDrivers.Name | Get-Random
}
@klabarge
klabarge / sample-arrow.html
Created March 23, 2019 16:23
Sample.html using arrow functions
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<title>QZ Tray Sample Page</title>
</head>
<!-- Required scripts -->
<script type="text/javascript" src="js/dependencies/rsvp-3.1.0.min.js"></script>
<script type="text/javascript" src="js/dependencies/sha-256.min.js"></script>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<title>QZ Tray Sample Page</title>
</head>
<body onload="calibrate()">
Check the console.
</body>
@klabarge
klabarge / apache.md
Created August 31, 2017 03:21
Install homebrew apache
  1. Cleanup Apache default macOS comes with Apache. We want to disable the system default webserver and install from Homebrew
    #stop the apache service
    $ sudo apachectl stop
    #prevent apache from starting on boot
    $ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
  2. Add Homebrew repositories
@klabarge
klabarge / Windows10app.md
Created June 7, 2017 21:45
Windows 10 App
  1. Download and extract test.zip
  2. Navigate to \test\EdgeLabelPrinter_1.0.6.15_AnyCPU_Debug_Test
  3. Right click, Add-AppDevPackage.ps1 run with powershell
  4. Press Enter to continue when prompted
  5. UAC will appear to ask for administrator privileges, select yes
  6. Windows Settings will open in Explorer, change radio button to "Developer mode"
  7. Return to (second) PowerShell prompt
  8. You can now run (double click) EdgeLabelPrinter_1.0.6.15_AnyCPU_Debug.appx
<!DOCTYPE html>
<html>
<head>
<title>HTML Table</title>
</head>
<body>
<table border="1" style="width:100%">
<tr>
<th>Header 1</th>
<th>Header 2</th>
@klabarge
klabarge / promiseLoop.js
Created October 7, 2016 22:58
Queue print requests
function promiseLoop() {
var printData = [
{ "type": "pdf", "data": "assets/1.pdf" },
{ "type": "pdf", "data": "assets/2.pdf" },
{ "type": "pdf", "data": "assets/3.pdf" },
{ "type": "pdf", "data": "assets/4.pdf" },
{ "type": "pdf", "data": "assets/5.pdf" }
];
var printers = [
{ "printer": "PDFCreator" },
function promiseLoop() {
var printData = [
{ "type": "pdf", "data": "assets/1.pdf" },
{ "type": "pdf", "data": "assets/2.pdf" },
{ "type": "pdf", "data": "assets/3.pdf" },
{ "type": "pdf", "data": "assets/4.pdf" },
{ "type": "pdf", "data": "assets/5.pdf" },
];
var printers = [
{ "printer": "PDFCreator" },
@klabarge
klabarge / OpenSSL.md
Last active August 31, 2016 02:21
OpenSSL on Windows

The steps below document how to easily get the OpenSSL command line utility running in a Windows environment.

  1. Download OpenSSL from Shining Light Productions. The Windows 32-bit lightweight installer works well, however it only includes the most commonly used functions
  2. Run the .exe
  3. Open up cmd prompt and change directory to OpenSSL-Win32\bin
 cd C:\OpenSSL-Win32\bin