Skip to content

Instantly share code, notes, and snippets.

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

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@mahmoudimus
mahmoudimus / riscv.md
Created March 2, 2023 05:45 — forked from cb372/riscv.md
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@mahmoudimus
mahmoudimus / java.flags.txt
Created February 25, 2023 18:55 — forked from ornicar/java.flags.txt
java -Xms30g -Xmx30g -XX:+UseG1GC -XX:+PrintCodeCache -XX:NonProfiledCodeHeapSize=512m -XX:NonNMethodCodeHeapSize=32m -XX:ReservedCodeCacheSize=2g -XX:InitialCodeCacheSize=512m -XX:CodeCacheExpansionSize=2m -XX:+PrintFlagsFinal
/opt/jabba/jdk/openjdk@1.17/bin/java -Xms30g -Xmx30g -XX:+UseG1GC -XX:+PrintCodeCache -XX:NonProfiledCodeHeapSize=512m -XX:NonNMethodCodeHeapSize=32m -XX:ReservedCodeCacheSize=2g -XX:InitialCodeCacheSize=512m -XX:CodeCacheExpansionSize=2m -XX:+PrintFlagsFinal
[Global flags]
int ActiveProcessorCount = -1 {product} {default}
uintx AdaptiveSizeDecrementScaleFactor = 4 {product} {default}
uintx AdaptiveSizeMajorGCDecayTimeScale = 10 {product} {default}
uintx AdaptiveSizePolicyCollectionCostMargin = 50 {product} {default}
uintx AdaptiveSizePolicyInitializingSteps = 20 {product} {default}
uintx AdaptiveSizePolicyOutputInterval = 0 {product} {default}
uintx AdaptiveSizePolicyWeight = 10
@mahmoudimus
mahmoudimus / disassemble-luajit-v1.py
Created February 3, 2023 05:41 — forked from MickaelWalter/disassemble-luajit-v1.py
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
@mahmoudimus
mahmoudimus / cwb_markers.py
Created January 29, 2023 02:27 — forked from Andoryuuta/cwb_markers.py
cwb_markers.py v0.3.0
import idautils
import idc
import ida_bytes
from pprint import pprint, pformat
def demangle_name(name):
return idc.Demangle(name, idc.GetLongPrm(idc.INF_SHORT_DN)) or name
def get_primary_vtables():
@mahmoudimus
mahmoudimus / auto_include.ahk
Created January 19, 2023 03:10 — forked from davebrny/auto_include.ahk
📃 (autohotkey) - create a list of .ahk files to be #included in your main script
/*
[search folders]
folder_1 =
folder_2 =
[ignore paths]
C:\Users\documents\scripts\example script name.ahk
C:\Users\documents\scripts\example folder name
[settings]
@mahmoudimus
mahmoudimus / capslock.ahk
Created January 11, 2023 17:19 — forked from scottming/capslock.ahk
; Autohotkey Capslock Remapping Script
; Autohotkey Capslock Remapping Script
; - Deactivates capslock for normal (accidental) use.
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar).
; - Access the following functions when pressing Capslock:
;Cursor keys - h, j, k, l
;Home,End - N, ;
;Page up,down - - =
;Esc - CapsLock only
;CapsLock - Space
@mahmoudimus
mahmoudimus / macOS-shortcuts.ahk
Created January 10, 2023 00:24 — forked from apfelchips/macOS-shortcuts.ahk
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.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#NoTrayIcon
Menu, Tray, Icon, accessibilitycpl.dll, 6 ; Keyboard Icon
;#Persistent https://www.autohotkey.com/docs/commands/_Persistent.htm
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force
; Debugging
#Warn All, OutputDebug ; Show Warnings on DebugView
; Colemak layout for AutoHotkey (MS Windows)
; 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain.
; See http://www.autohotkey.com/ for more information
; For this to work you have to make sure that the US (QWERTY) layout is installed,
; that is set as the default layout, and that it is set as the current layout.
; Otherwise some of the key mappings will be wrong.
;
; This is mainly useful for those who don't have privileges to install a new layout
; This doesn't support the international features of the Colemak layout.
#MaxHotkeysPerInterval 20000
@mahmoudimus
mahmoudimus / core-keys.ahk
Created January 9, 2023 23:47 — forked from sriramkswamy/core-keys.ahk
Windows AutoHotKey script for some shotrcuts
;; Change the basic layout of the keyboard a little bit
; Use just the Home key for Win Tab
Home::#Tab
; Use the End key to quit programs
End::!F4
; Switch between virtual desktops with Page Up and Page Down
PgUp::#^Left
@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">