Skip to content

Instantly share code, notes, and snippets.

View mahmoudimus's full-sized avatar
💭
@_@

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@mahmoudimus
mahmoudimus / chrome-history-synced-tabs-exporter-with-postprocessors-4-marvelous-suspender-and-sessionbuddy.js
Last active February 8, 2025 18:47
Chrome history tabs iphone history export syncedTabs chrome://history/syncedTabs
/**
* This script extracts synced tabs from Chrome’s History page and post-processes tab URLs.
*
* It traverses the page’s shadow DOM to locate the list of synced devices and then iterates over
* each device card to collect the device name and its open tabs (each with a title and URL).
*
* For tabs whose URLs are prefixed by Marvelous Suspender (i.e. URLs that start with a chrome-extension
* scheme and include "/suspended.html#"), the script extracts the actual URL from the "uri" query parameter.
*
* The URL processing is designed to be extensible. Simply add additional processor functions to the
@apfelchips
apfelchips / macOS-shortcuts.ahk
Last active February 17, 2025 17:36
First remap modifier keys with sharpkeys; AHK script has to run as Administrator to work on System Windows / Apps running as Administrator; see Watchdog ScheduledTask below, when you do this make sure to remove the inherited file permissions from C:/tools and only allow administrators write access.
#SingleInstance force
;#Persistent https://www.autohotkey.com/docs/commands/_Persistent.htm
;#InstallKeybdHook ; see: https://www.autohotkey.com/docs/v1/lib/_HotkeyModifierTimeout.htm
;#NoTrayIcon
TraySetIcon("accessibilitycpl.dll","6") ; Keyboard Icon
SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.
; Debugging
; #Warn All, OutputDebug ; Show Warnings in DebugView ( https://learn.microsoft.com/en-us/sysinternals/downloads/debugview )
@mahmoudimus
mahmoudimus / pygil.py
Created November 23, 2020 19:37
Python's GIL implemented in pure Python
"""
A pure python implementation of the CPython GIL
Note: this code will not run if you will try to execute it, because it's missing bytecode execution logic.
Originally from: https://rushter.com/blog/python-gil-thread-scheduling/
Some things to note:
- Each thread executes its code in the separate execution_loop which is run by the real OS threads.
- When Python creates a thread it calls the take_gil function before entering the execution_loop.
@mahmoudimus
mahmoudimus / ChangeAnnotationAtRuntime.java
Created November 6, 2020 17:46 — forked from henrrich/ChangeAnnotationAtRuntime.java
Modify annotation at runtime, java 8 support
public final class RuntimeAnnotations {
private static final Constructor<?> AnnotationInvocationHandler_constructor;
private static final Constructor<?> AnnotationData_constructor;
private static final Method Class_annotationData;
private static final Field Class_classRedefinedCount;
private static final Field AnnotationData_annotations;
private static final Field AnnotationData_declaredAnotations;
private static final Method Atomic_casAnnotationData;
private static final Class<?> Atomic_class;
@mahmoudimus
mahmoudimus / Online code utilities.md
Created September 29, 2020 20:30 — forked from fghber/Online code utilities.md
Online code utilities

Web IDEs

ideone Ideone is an online compiler and debugging tool which allows youto compile source code and execute it online in more than 60 programming languages and share links to the code.
repl.it Like ideaone, can also install missing Python packages.
Onlilne GDB Online compiler and debugger forC, C++, Python, Java, PHP, Ruby, Perl, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog, and more.
Coding Ground Advanced IDEs for C/C++, C#, GO, Java, PHP, Perl, Python, Octave/MATLOAB, R, Ruby, Scala, and compiler/interpreter for many other languages and frameworks.
JDOODLE very similar to ideone but a somewhat different set of languagse/compilers.

Dedicated:

@MickaelWalter
MickaelWalter / disassemble-luajit-v1.py
Created August 29, 2020 14:27
Quick&dirty verbose LuaJIT's bytecode version 1 disassembler
#!/usr/bin/env python3
import sys
import struct
import math
# Constants
# Internal (LEB128 buffer)
MAX_ULEB_SIZE = 256 # Maximum proto size here is 2^7^256
@Hanan-Natan
Hanan-Natan / revil_strings_p3.py
Last active March 19, 2025 05:07 — forked from OALabs/revil_strings.py
Decrypt REvil ransomware strings with IDA Python
import idaapi, idc, idautils
class DecryptorError(Exception):
pass
def rc4crypt(key, data):
x = 0
box = list(range(256))
@mahmoudimus
mahmoudimus / emacs.sh
Last active October 2, 2022 18:03 — forked from ca7023/emacs.sh
Run Emacs.app as Client/Server, for someone who likes GUI emacs and emacsclient to speed up start-up time.
#!/bin/bash
BG_RED=`tput setaf 1`
BG_GREEN=`tput setaf 2`
BOLD=`tput bold`
RESET=`tput sgr0`
EMACS='/Applications/Emacs.app'
EMACS_CLIENT='/Applications/Emacs.app/Contents/MacOS/bin/emacsclient'
DEFAULT_EVAL='(switch-to-buffer "*scratch*")'
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active April 16, 2025 15:50
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@emad7105
emad7105 / BLS_Signature.md
Created June 18, 2020 08:08
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.