Skip to content

Instantly share code, notes, and snippets.

View inspiredearth's full-sized avatar

Inspired Earth inspiredearth

View GitHub Profile
erkobridee /
Last active March 22, 2024 23:49
Second Brain System and productive useful references
maqp /
Last active January 5, 2021 01:35
Pythagorean factorization in the world of real RSA keys.
import math
import time
from cryptography.hazmat.primitives.asymmetric import rsa
def main():
key_sizes_to_test = [512, 640, 768, 896]
number_of_keys_per_size_to_generate = 10000
I had a chat with a buddy of mine (Topi Talvitie) who's a postdoc researcher here at Helsinki Uni.
He reverse engineered the logic on how a fake solver algorithm, such as the one by Grant's, can be created.
I've tried to to translate it the best I can:
The goal is to find integers p and q so that pq = N [N being the public key].
The problem is then rephrased so that the goal is to find a single integer C = (p+q) / 2.
This is because finding the value of a single variable appears easier than solving an equation with two variables.
maqp /
Last active January 4, 2021 06:38
Pythagorean Factorization
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
import math
import multiprocessing
import random
import time
from multiprocessing import Queue, Process
from typing import Tuple
pduchnovsky /
Last active December 11, 2023 11:40
Image size optimization for webpages jpg/png |
# Script adapted by pduchnovsky
# Add list of folder names to ignore array here, separated by space
ignore=("./themes/*" "./resources/*" "./assets/*")
# Array of png optimizers with their arguments
"optipng -nb -nc"
ayyybe / ccdl.command
Last active May 20, 2024 22:48
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
lukecav / Commands
Last active May 19, 2024 14:55
Speed up wp db export using WP-CLI
# Export site database using wp db export
wp db export /wp-content/wordpress-dump.sql --all-tablespaces --single-transaction --quick --lock-tables=false
# Gzip compress the recent database export
gzip wordpress-dump.sql
# Export sites database using wp db export and gzip compress
wp db export --all-tablespaces --single-transaction --quick --lock-tables=false - | gzip -9 - > wordpress-dump.sql.gz
ebetancourt / wp-disable-plugin-update.php
Last active March 29, 2024 13:03 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
* Prevent update notification for plugin
* Place in theme functions.php or at bottom of wp-config.php
function disable_plugin_updates( $value ) {
ngearing /
Last active December 14, 2020 00:40
sips resize and compress images quickly
# cd into the directory with the images you want to resize then run this.
# install slugify with brew install slugify
mkdir resized
sips -Z 1920 -s formatOptions 65 -s format jpeg * --out resized/
slugify -acdtu resized/*
iamphilrae / phpMyAdmin Export Filename Template, Including Date and Time
Last active April 3, 2024 20:30
phpMyAdmin Export Filename Template, Including Date and Time