Skip to content

Instantly share code, notes, and snippets.

Tres Finocchiaro tresf

Block or report user

Report or block tresf

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View network_compat.diff
diff --git a/js/qz-tray.js b/js/qz-tray.js
index 8455a7f..7e1e0ea 100644
--- a/js/qz-tray.js
+++ b/js/qz-tray.js
@@ -528,8 +528,7 @@ var qz = (function() {
isAlgorithmCompatible: function() {
//if not connected yet we will assume compatibility exists for the time being
if (_qz.websocket.connection) {
- var semver = _qz.websocket.connection.version.split(/[.-]/g);
- if (semver[0] === "2" && semver[1] === "0") {
View sign-message-sha256.js
// API
setSignaturePromise: function(promiseGen, alg) {
_qz.security.signaturePromise = promiseGen;
// TODO: Detect QZ version, warn
_qz.security.signatureAlg = alg;
}
// Implementation
View gist:a3b2c0c82f25afa24b43fbbc020f2065
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@tresf
tresf / make-service.bat
Last active Nov 18, 2019
QZ Tray Service
View make-service.bat
REM ###### 1. Run the site to be using QZ Tray and click "Remember this decision"
REM ###### 2. Create a batch file that launches QZ Tray
echo java -Xms512M -jar "%~dp0\qz-tray.jar" %* > "%PROGRAMFILES%\QZ Tray\qz-tray.bat"
REM ###### 3. Make a location for SYSTEM certificate white-list
mkdir "%WINDIR%\System32\config\systemprofile\AppData\Roaming\qz"
REM ###### 4. Copy the "allowed.dat" to the SYSTEM
copy /Y "%APPDATA%\qz\allowed.dat" "%WINDIR%\System32\config\systemprofile\AppData\Roaming\qz\allowed.dat"
View fix_blank_pages.java
String[] methods = { "impl_updatePeer", "doUpdatePeer" };
for(String method : methods) {
for(Method m : webView.getClass().getDeclaredMethods()) {
if(m.getName().equals(method)) {
if(!m.isAccessible()) {
m.setAccessible(true);
}
try {
m.invoke(webView);
View gist:e313849d5690fca2e617f283fdde0375
[ERROR] 2019-11-12 11:59:17,973 @ qz.utils.PrintingUtilities:161
Failed to print
java.lang.NullPointerException
at qz.utils.LoggerUtilities.optionWarn(LoggerUtilities.java:15)
at qz.printer.PrintOptions.<init>(PrintOptions.java:244)
at qz.utils.PrintingUtilities.processPrintRequest(PrintingUtilities.java:148)
at qz.ws.PrintSocketClient.processMessage(PrintSocketClient.java:345)
at qz.ws.PrintSocketClient.onMessage(PrintSocketClient.java:233)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
View crypt32.java
public boolean add(File certFile) {
log.info("Writing certificate {} to {} store using Crypt32...", certFile, certType);
try {
PEMParser pem = new PEMParser(new FileReader(certFile));
X509CertificateHolder certHolder = (X509CertificateHolder)pem.readObject();
byte[] bytes = certHolder.getEncoded();
Pointer pointer = new Memory(bytes.length);
pointer.write(0, bytes, 0, bytes.length);
WinCrypt.HCERTSTORE certStore = openStore(certType);
View certs-rewrite-EofException.log
[INFO] 2019-11-06 15:56:26,827 @ qz.ws.PrintSocketClient:?
Connection closed: 1001 - null
[INFO] 2019-11-06 15:56:26,834 @ qz.ws.SocketConnection:?
Closing all communication channels for localhost
[INFO] 2019-11-06 15:56:27,359 @ qz.ws.PrintSocketClient:?
Connection opened from /127.0.0.1:57126 on socket port 8181
[DEBUG] 2019-11-06 15:56:27,408 @ qz.ws.PrintSocketClient:?
Message: {"certificate":"-----BEGIN CERTIFICATE-----\nMIIFAzCCAuugAwIBAgICEAIwDQYJKoZIhvcNAQEFBQAwgZgxCzAJBgNVBAYTAlVT\nMQswCQYDVQQIDAJOWTEbMBkGA1UECgwSUVogSW5kdXN0cmllcywgTExDMRswGQYD\nVQQLDBJRWiBJbmR1c3RyaWVzLCBMTEMxGTAXBgNVBAMMEHF6aW5kdXN0cmllcy5j\nb20xJzAlBgkqhkiG9w0BCQEWGHN1cHBvcnRAcXppbmR1c3RyaWVzLmNvbTAeFw0x\nNTAzMTkwMjM4NDVaFw0yNTAzMTkwMjM4NDVaMHMxCzAJBgNVBAYTAkFBMRMwEQYD\nVQQIDApTb21lIFN0YXRlMQ0wCwYDVQQKDAREZW1vMQ0wCwYDVQQLDAREZW1vMRIw\nEAYDVQQDDAlsb2NhbGhvc3QxHTAbBgkqhkiG9w0BCQEWDnJvb3RAbG9jYWxob3N0\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtFzbBDRTDHHmlSVQLqjY\naoGax7ql3XgRGdhZlNEJPZDs5482ty34J4sI2ZK2yC8YkZ/x+WCSveUgDQIVJ8
View qt5.rb
# Patches for Qt5 must be at the very least submitted to Qt's Gerrit codereview
# rather than their bug-report Jira. The latter is rarely reviewed by Qt.
class Qt5 < Formula
desc "Cross-platform application and UI framework"
homepage "https://www.qt.io/"
url "https://download.qt.io/archive/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.xz"
mirror "https://www.mirrorservice.org/sites/download.qt-project.org/archive/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.xz"
sha256 "6f028e63d4992be2b4a5526f2ef3bfa2fe28c5c757554b11d9e8d86189652518"
revision 1
@tresf
tresf / Default.aspx
Last active Nov 15, 2019
C# PageMethods Signing
View Default.aspx
<!-- 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>
<script type="text/javascript" src="js/qz-tray.js"></script>
<script>
qz.security.setSignaturePromise(function (toSign) {
return function (resolve, reject) {
PageMethods.SignMessage(toSign, resolve, reject);
You can’t perform that action at this time.