Skip to content

Instantly share code, notes, and snippets.

View tresf's full-sized avatar

Tres Finocchiaro tresf

View GitHub Profile
@tresf
tresf / add-update-github-access-token-on-mac.md
Last active July 6, 2024 19:07 — forked from jonjack/add-update-refresh-github-access-token-on-mac.md
Adding & Updating GitHub Access Token on Mac

As outlined here, there are a couple of situations where you may want/need to authenticate with GitHub by using an Access Token:-

  1. If you have Two-Factor Authentication (2FA) enabled.
  2. You are accessing an organisations protected content using SAML Single-Sign On (SSO).

Using an Access Token for the first time

Create an Access Token

In your GitHub account, go to Settings / Developer settings / Personal access tokens and select Generate New Token. Make a note of the token somewhere safe since this is the only chance you get to see it.

@tresf
tresf / HelloGUI.java
Last active October 10, 2022 22:34 — forked from 0x000000AC/HelloGUI
Hello World using the JOptionPane
/***********************************************
* HelloGUI.java
* Aaron P. Clark, A. Tres Finocchiaro
***********************************************/
import javax.swing.*;
public class HelloGUI {
public static void main(String ... args) throws Throwable {
SwingUtilities.invokeAndWait(() -> JOptionPane.showMessageDialog(null, "Hello, World!"));
}
@tresf
tresf / FindJava.ps1
Last active June 24, 2019 14:47 — forked from elresleff/Find_java_CFs.ps1
Search Java for Commercial Features
# 2019 Tres Finocchiaro, Ed Resleff - CC0/Public Domain
# - Searches the system for Java
# - Looks for specified files or features (e.g. Commercial Features)
# Whether or not to show script debbuging information
$SHOW_DEBUG = $True;
# List of possible Java Runtime locations (including JDK) search locations
# Also traverses through 32-bit registry hive (WOW6432Node)
$JRE_SEARCH = @{
var printData = [
'\x1B' + '\x40' + 'Lite Finocchiaro' +'\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A', // Some text and a few line feeds to make sure the initiation and first line are coming through
'\x1D' + '\x28' + '\x6B' + '\x04' + '\x00' + '\x31' + '\x41' + '50' + '0', //select the model (model 2 in this case for my Epson TM-T88V)
'\x1D' + '\x28' + '\x6B' + '\x03' + '\x00' + '\x31' + '\x43' + '3', //set the size of the module
'\x1D' + '\x28' + '\x6B' + '\x03' + '\x00' + '\x31' + '\x45' + '48', //select level of error correction (48,49,50,51) printer-dependent
'\x1D' + '\x28' + '\x6B' + '16' + '0' + '\x31' + '\x50' + '\x30' + 'Testing 1 2 3', //send your data (testing 123) to the image storage area in the printer
'\x1D' + '\x28' + '\x6B' + '\x03' + '\x00' + '\x31' + '\x51' +'48', //print the symbol data in the symbol storage area
'\x1D' + '\x28' + '\x6B' + '\x03' + '\x00' + '\x31' + '\x52' +'48', //Transmit the size information of the symbol data in the sym