Skip to content

Instantly share code, notes, and snippets.

View inspiredearth's full-sized avatar

Inspired Earth inspiredearth

View GitHub Profile
@erkobridee
erkobridee / 01__second-brain-system.md
Last active March 22, 2024 23:49
Second Brain System and productive useful references
@maqp
maqp / real_keys.py
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
maqp / pythagorean_factorization.py
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
pduchnovsky / optimize.sh
Last active December 11, 2023 11:40
Image size optimization for webpages jpg/png | https://duchnovsky.com/2020/11/images-optimization-for-web/
#!/bin/bash
# Script adapted by pduchnovsky
# https://duchnovsky.com/2020/11/images-optimization-for-web/
# Add list of folder names to ignore array here, separated by space
ignore=("./themes/*" "./resources/*" "./assets/*")
# Array of png optimizers with their arguments
optimizers=(
"optipng -nb -nc"
@ayyybe
ayyybe / ccdl.command
Last active April 9, 2024 09:04
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@lukecav
lukecav / Commands
Last active January 9, 2024 06:48
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
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
<?php
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
@ngearing
ngearing / sips-web-optimise.sh
Last active December 14, 2020 00:40
sips resize and compress images quickly
#!/bin/bash
# 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
iamphilrae / phpMyAdmin Export Filename Template, Including Date and Time
Last active April 3, 2024 20:30
phpMyAdmin Export Filename Template, Including Date and Time
@DATABASE@__%Y-%m-%d_%H-%M-%S