Skip to content

Instantly share code, notes, and snippets.

View bettse's full-sized avatar

Eric Betts bettse

View GitHub Profile
@mishimay
mishimay / remove_alpha_channel.swift
Created July 7, 2019 01:35
Remove alpha channel from png using Swift
// Usage: swift remove_alpha_channel.swift filename.png
import Foundation
import CoreImage
let arguments = CommandLine.arguments
let filename = arguments[1]
let dataProvider = CGDataProvider(filename: filename)!
let cgImage = CGImage(pngDataProviderSource: dataProvider, decode: nil, shouldInterpolate: true, intent: .defaultIntent)!
@Vladlex
Vladlex / UIImage+Flip.swift
Created June 22, 2019 08:57
UIImage Flip
public extension UIImage {
public struct FlipOptions: OptionSet {
public typealias RawValue = Int
public let rawValue: RawValue
public init(rawValue: RawValue) {
self.rawValue = rawValue
@yifanlu
yifanlu / Ghidra-OSX-Launcher-Script.scpt
Last active April 16, 2025 20:01
Ghidra.app launcher for OSX
/*
* Star Micronics
*
* CUPS Filter
*
* [ Linux ]
* compile cmd: gcc -Wl,-rpath,/usr/lib -Wall -fPIC -O2 -o rastertostar rastertostar.c -lcupsimage -lcups
* compile requires cups-devel-1.1.19-13.i386.rpm (version not neccessarily important?)
* find cups-devel location here: http://rpmfind.net/linux/rpm2html/search.php?query=cups-devel&submit=Search+...&system=&arch=
*
@tresf
tresf / evolis.prn
Last active December 2, 2021 01:17
evolis.prn
Psync;1;0 # **RESERVED COMMAND**
<HEADER>Psmgr;1 # **RESERVED COMMAND**
Ppws;1537499426 # **RESERVED COMMAND**
Pps;0;n # Printer status after reply. (0=disable 1=enable);(n=force no persistent, 0=disable printer status extension;1=enable printer status extension)
Pcla;1 # **RESERVED COMMAND**
Psid;2 # **RESERVED COMMAND** Set current session identification number
Pr;0;t # Read ribbon value (0=RIBBON_YMCKO);(t=Previous parameter is a number, not a string)
Pwres;300;300;0 # Card resolution?
Psk;10 # Monochrome print speed (10=fastest, 1=slowest)
Piqla;a;d # Print quality level adjust (a=activate adjustment, d=disable)
@warewolf
warewolf / README.md
Last active April 27, 2025 16:15
Phison drive mode configuration

Phison PS2251-xx USB flash drive controller mode configuration

Overview

Phison based flash drives have various modes that dictate how they operate;

  1. as a regular flash drive (mode 3)
  2. as a dual-volume flash drive (mode 7)
  3. as a single volume flash drive + cdrom (mode 21)
@tobozo
tobozo / Mac.cpp
Last active May 7, 2025 03:42
Spacehuhn's minimalistic deauth detector shimmed for ESP32 and ESP8266
#include "Mac.h"
Mac::Mac(){
for(int i=0;i<6;i++){
adress[i] = 0x00;
}
}
Mac::Mac(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth, uint8_t fifth, uint8_t sixth){
adress[0] = first;
@ldez
ldez / gmail-github-filters.md
Last active April 16, 2025 20:12
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
url - https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/
Finding hard-coded credentials in your code
Hopefully you’re excited about deploying credentials to EC2 that are automatically rotated. Now that you’re using Roles, a good security practice would be to go through your code and remove any references to AKID/Secret. We suggest running the following regular expressions against your code base:
Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after.
Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after.
If grep is your preferred tool, run a recursive, Perl-compatible search using the following commands
@tadija
tadija / FontNames-iOS-17.4.swift
Last active January 11, 2025 00:45
iOS - All Font Names
/*
*** Academy Engraved LET ***
AcademyEngravedLetPlain
---------------------
*** Al Nile ***
AlNile
AlNile-Bold
---------------------
*** American Typewriter ***
AmericanTypewriter