const ws = require('ws');
const qz = require('qz-tray');
qz.api.setWebSocketType(ws);
fetch('https://production.courierapi.co.uk/api/couriers/v1/Test/create-label',
{
method: 'POST',
headers: {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
keywords=('developer-low' 'door-open' 'fuser-over-temp' 'fuser-under-temp' 'input-tray-missing' 'interlock-open' 'interpreter-resource-unavailable' 'marker-supply-empty' 'marker-supply-low' 'marker-waste-almost-full' 'marker-waste-full' 'media-empty' 'media-jam' 'media-low' 'media-needed' 'moving-to-paused' 'opc-life-over' 'opc-near-eol' 'output-area-almost-full' 'output-area-full' 'output-tray-missing' 'paused' 'shutdown' 'spool-area-full' 'stopped-partly' 'stopping' 'timed-out' 'toner-empty' 'toner-low') | |
echo "INFO: This is an informational message, I guess?" >&2 | |
for i in {1..290} | |
do | |
echo "STATE: ${keywords[$i % 29]}" >&2 | |
sleep .1 | |
done |
- Although DOSBox offers printing support, the documentation is sparse and most articles refer to printing on a Windows host.
- Using DOSBox 0.7.4-3 I was unable to get printing working, so I'm using DOSBox-X instead.
- Using Ubuntu 20.04 and a fork of DOSBox called DOSBox-X, printing can be configured as follows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Author: A. Tres Finocchiaro | |
* License: Public Domain | |
*/ | |
import "https://raw.githubusercontent.com/qzind/tray/v2.2.2/js/qz-tray.js"; | |
import { encode, decode } from "https://deno.land/std/encoding/base64.ts"; | |
// Load certificate | |
qz.security.setCertificatePromise(function(resolve, reject) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tpe = require('thermal-printer-encoder'); | |
let ws = require('ws'); | |
let qz = require('qz-tray'); | |
let encoder = new tpe({ | |
language: 'esc-pos' | |
}); | |
let result = encoder | |
.initialize() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><meta charset="UTF-8"></head> | |
<body> | |
<!-- USAGE: index.php?var1=some_value_to_print --> | |
<?php | |
if (isset($_GET["var1"])) { | |
echo '<!-- FROM PHP --><script>var var1 = "' . htmlspecialchars($_GET["var1"]) . '";</script>'; | |
} else {?> | |
<form action="index.php" method="get">Some value: <input type="text" name="var1"><br> |
Custom session stealer for Windows fast user switching
For a pure Batch solution, see here instead: https://gist.github.com/tresf/ff91bd29f1f6846c13bf6f8bc255ab55
Custom session stealer for Windows fast user switching
For a pure PowerShell solution, see here instead: https://gist.github.com/tresf/4e19e15ad38354af6732ee701c990102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adopted from: https://www.reddit.com/r/PowerShell/comments/306mcn/wtsenumeratesessions/ | |
# Original Author: u/geostude | |
$_WTSMyStruct_Def = @' | |
namespace mystruct { | |
using System; | |
using System.Runtime.InteropServices; | |
[StructLayout(LayoutKind.Sequential)] | |
public struct WTS_SESSION_INFO { | |
public Int32 SessionID; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
NET SESSION >nul 2>&1 | |
if %ERRORLEVEL% EQU 0 ( | |
echo Administrator PRIVILEGES Detected! | |
) else ( | |
echo NOT AN ADMIN! | |
pause | |
exit | |
) |