Skip to content

Instantly share code, notes, and snippets.

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

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@shirayu
shirayu / TensorRT + Ubuntu 22.04 (on WSL2).md
Last active April 1, 2024 01:16
TensorRT + Ubuntu 22.04 (on WSL2)

TensorRT + Ubuntu 22.04 (on WSL2)

I revolced the following warnings related to libnvinfer.so.7 and libnvinfer_plugin.so.7

W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: xxxxx
W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: xxxxx
W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
@mahmoudimus
mahmoudimus / Mac OS X 10_5_ Windows Ctrl.xml
Created January 9, 2023 07:12 — forked from fljot/Mac OS X 10_5_ Windows Ctrl.xml
AutoHotkey mappings to emulate OSX keyboard shortcuts on Windows
<!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ -->
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
<keyboard-shortcut first-keystroke="meta INSERT" />
<keyboard-shortcut first-keystroke="control C" />
<keyboard-shortcut first-keystroke="control INSERT" />
</action>
<action id="$Cut">
@mahmoudimus
mahmoudimus / hello_world_plugin.py
Created December 26, 2022 17:34 — forked from cmatthewbrooks/hello_world_plugin.py
The simplest possible IDA plugin with multiple actions
##############################################################################
#
# Name: hello_world_plugin.py
# Auth: @cmatthewbrooks
# Desc: A test plugin to learn how to make these work; Specifically, how to
# have multiple actions within the same plugin.
#
# In plain English, IDA will look for the PLUGIN_ENTRY function which
# should return a plugin object. This object can contain all the
# functionality itself, or it can have multiple actions.
@mahmoudimus
mahmoudimus / inject.py
Created December 22, 2022 22:11 — forked from romainthomas/inject.py
Mach-O code injection with LIEF and shell-factory
#!/usr/bin/env python
# Script associated with the blog post: https://lief-project.github.io/blog/2022-05-08-macho/
# It demonstrates code injection with shell-factory and LIEF
import lief
import pathlib
from pathlib import Path
CWD = Path(__file__).parent
@mahmoudimus
mahmoudimus / CodeCaveFinder.md
Last active December 22, 2022 19:30
(Python) Code Cave By Jean-Pierre LESUEUR

(Python) Code Cave By Jean-Pierre LESUEUR

Taken from https://unprotect.it/snippet/code-cave/54/

Description

-f / --file : Valid PE File location (Ex: /path/to/calc.exe).
-p / --payload : Shellcode Payload (Example: "\x01\x02\x03…\x0a").
-x / --encrypt : Encrypt main section (entry point section).
@mahmoudimus
mahmoudimus / fcntl.py
Created December 21, 2022 01:01
Fake fcntl module for windows
"""
This *fake* module is for windows only
Based on:
- https://github.com/facebook/tornado/blob/master/tornado/win32_support.py
- https://github.com/typecode/wikileaks/blob/23a6243df473102a9a1b84f5dde66173df3132b5/lib/tornado/win32_support.py
- https://raw.githubusercontent.com/twisted/twistedmatrix.com-trac-attachments/0a05e3294e7488d8864a73666a007db842c9633e/ticket/bc1/bc1a1f5e1875e3916492b3b509f58cd420eba1d5/b683c2d57b5d19e4fb24a78b44e76ad9129fe19f.patch
- https://github.com/yt-dlp/yt-dlp/blob/1fc089143c79b02b8373ae1d785d5e3a68635d4d/yt_dlp/utils.py#L2095-L2150
"""
@mahmoudimus
mahmoudimus / mac4win.ahk
Last active January 17, 2023 13:39
autohotkey mac4win/emacs
/*
Symbol Key
^ RCtrl
! Alt
# Windows Key (cmd in mac keyboard)
+ SHIFT
#c::Send, ^c
#v::Send, ^v
#x::Send, ^x

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@mahmoudimus
mahmoudimus / README.md
Created November 12, 2022 05:30 — forked from adithyabsk/README.md
HOWTO: Convert iBook EPUBs to standard EPUBs

How to Convert iBook EPUBs to standard EPUBs

iBooks EPUBs actually show up on macOS as folders. If you need the actual file you can use the above script to convert your iBook directory of files to a destination directory.

The path of iBook files as of macOS 10.15.7 is: /Users/${USER}/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents

Usage

@mahmoudimus
mahmoudimus / GHIDRA-MACOS.md
Last active January 14, 2023 23:13
Ghidra Launch Properties (using ZGC)

Setting up Ghidra.

Setting up Debugger

Install llvm (brew install llvm), and gradle (brew install gradle).

Clone Ghidra source. Open terminal at this directory, type in gradle -I gradle/support/fetchDependencies.gradle init

Edit the ghidra/Ghirda/Debug/Debugger-swig-lldb/buildNatives.gradle file with VSCode. Replace all $llvm_dir/lldb/include with $llvm_dir/include. Save and close.