Skip to content

Instantly share code, notes, and snippets.

View JJTech0130's full-sized avatar

James Gill JJTech0130

View GitHub Profile
@crazybyte
crazybyte / encrypt_openssl.txt
Created November 25, 2012 10:10
File encryption using OpenSSL
For symmetic encryption, you can use the following:
To encrypt:
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt
To decrypt:
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt
For Asymmetric encryption you must first generate your private key and extract the public key.
@neonprimetime
neonprimetime / hash_remote_file.py
Last active December 14, 2022 00:07 — forked from brianewing/remotemd5.py
Python Hash (MD5, SHA) of remote file (URL)
import os, hashlib, urllib2, optparse
def get_remote_md5_sum(url,algorithm):
remote = urllib2.urlopen(url)
return hash(remote, algorithm)
def hash(remote, algorithm="md5"):
max_file_size=100*1024*1024
if algorithm=="md5":
hash = hashlib.md5()
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 30, 2025 12:55
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@knightsc
knightsc / gist:758783181e41a986fceea6901b8853e3
Created August 20, 2020 13:48
AKNativeAnisetteService.m
//
// AKNativeAnisetteService.m
// akd
//
// Created by Scott Knight on 5/10/19.
// Copyright © 2019 Scott Knight. All rights reserved.
//
#import <AuthKit/AuthKit.h>
#import "AKNativeAnisetteService.h"
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@rbrick
rbrick / msa.go
Last active April 19, 2025 17:50
package main
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"golang.org/x/oauth2"
"golang.org/x/oauth2/microsoft"
import argparse, requests, urllib, os
from pyquery import PyQuery as pq
# CLI arguments
parser = argparse.ArgumentParser(description='OverDrive helper script')
parser.add_argument('--session',
help='manually set the session id (overrides \'OD_SESSION\' env)')
parser.add_argument('book',
@JJTech0130
JJTech0130 / dvmt-unlock.md
Last active July 4, 2025 23:07
Change DVMT pre-alloc. memory using RU.efi. Originally from Reddit.

WARNING: BIOS modding can be dangerous. You run the risk of bricking your device. I am not responsible for broken devices.

This tutorial was created for my HP Pavilion 15 laptop. I cannot confirm that this works on any other devices.


Finding variable

We need to find the offset, varstore, and possible values for the DVMT pre-alloc.

Extracting BIOS

@JJTech0130
JJTech0130 / UIApplication+VolumeButtons.swift
Created June 30, 2022 23:38
Extension for UIApplication that allows capturing Volume Button events in Swift
//
// UIApplication+VolumeButtons.swift
//
// Based on https://stackoverflow.com/a/70815088
//
import UIKit
// Stub protocol to allow us to call private methods
@objc private protocol UIApplicationPrivate {