Skip to content

Instantly share code, notes, and snippets.

@motebaya
motebaya / Microsoft.PowerShell_profile.ps1
Last active April 5, 2024 06:35
personal windows powershell config
# theme
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/craver.omp.json" | Invoke-Expression
# aliases
New-Alias py python310
New-Alias rb ruby
# Omp history
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
set debuginfod-url "https://debuginfod.ubuntu.com"
set debuginfod-index-urls "https://debuginfod.ubuntu.com"
set debuginfod enabled on
@motebaya
motebaya / solve_gdb.md
Last active February 23, 2024 10:12
GDB: ptrace: Operation not permitted.
This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
Downloading separate debug info for /usr/bin/php7.4
(No debugging symbols found in /usr/bin/php7.4)                                               
(gdb) attach 350091
Attaching to program: /usr/bin/php7.4, process 350091
@motebaya
motebaya / concurrency-vs-parallelism-io.rb
Last active March 24, 2024 14:33
diving deeper and experiment with concurrency and parallelism in Ruby for I/O bound operations.
#!/usr/bin/ruby
# copyright - 2024.03.12 motebaya
require "async"
require "async/barrier"
require "async/http/internet"
require "benchmark"
require "httparty"
require "concurrent"
require "parallel"
@motebaya
motebaya / asmtool.py
Created April 17, 2024 18:02
simple script that help me to RE python bytecode
#!/usr/bin/python3.11
# it help me for RE, @github.com/motebaya
# useless tool :) tools 17.04.2024
from typing import Dict
from xdis import magics
import re, os, types, marshal, argparse
class Asmtool:
def __init__(self) -> None:
@motebaya
motebaya / track_pid.sh
Last active May 29, 2024 12:44
Tracking PID based on the program name being executed by php7.4 and give it into GDB
#!/usr/bin/bash
track_pid() {
ps_output=$(ps aux | grep programname | head -1)
while IFS= read -r line; do
if [[ $line == *"php7.4"* ]]; then
pid=$(echo "$line" | awk '{print $2}')
echo "[OK] Found PHP process with PID: $pid"
# sleep 1
gdb -p "$pid" -x "command.txt"