Skip to content

Instantly share code, notes, and snippets.

View s4eidhp's full-sized avatar

s4eidhp s4eidhp

  • Advanced Electronics Research & Development
  • Iran
View GitHub Profile

Wave audio format

  • Developed by Microsoft and has become one of the primary formats of uncompressed audio
  • A file can have multiple combinations of header and data, though many files just have one header and one data section.
  • Install required packages
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake \
                     ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
  • Get esp-idf
git clone --recursive https://github.com/espressif/esp-idf.git

Linux Programming Interface

CHAPTER 2

  • Kernel Tasks:
    • Process Schedulling
    • Memory Managment
    • Provision of a file system
    • Creation and termination of processes
    • Access to devices
    • Networking
  • Provision of a system call application programming interface (API)

SSH into Windows using Key Authentication

  • Install OpenSSH Server on remote machine
  • Set OpenSSH Authentication Agent service & OpenSSH Server service to start automatically
  • Start both services
  • Edit C:\ProgramData\ssh\sshd_config file
PubKeyAuthentication      yes
PasswordAuthentication    no
# Match group admin ...
# Authorized key file ...

Toolchain

cd ~
git clone https://github.com/crosstool-ng/crosstool-ng.git  
cd crosstool-ng 
git checkout crosstool-ng-1.26.0        # currently latest stable version
./bootstrap
./configure --prefix=${PWD}
make
make install

Assembly Language and Shellcode for x86_64

  • Compilation process
hello.c -> hello.i -> hello.s -> hello.o + some other object files -> hello.exe
  • Findout CPU arch
lscpu

GNU Debugger Megaprimer

  • Find binary file info (if debug symbols exist)
info functions
info variables              # for global variables
info registers              # inspect CPU registers
info scope <scope_name>     # for local variables

How to build

  • install dependencies
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev fakeroot dwarves
  • download latest kernel from kernel.org in tarball format and extract it
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.9.9.tar.xz
tar -xf linux-6.9.9.tar.xz
rm linux-6.9.9.tar.xz

How to install a package on a machine which does not have internet access?

Steps

  • download apt-offline .deb package file from https://packages.ubuntu.com and transfer it to offline machine

  • install apt-offline

sudo dpkg -i apt-offline_<version>_all.deb

Steps on Linux server

  • download appropriate executable from github release page or build it from source using project instructions
  • install ffmpeg on system to download best quality of videos (for more information see this post)
  • download browser cookies using firefox or chrome extension and copy it on the server
  • use --cookies flag to pass cookies file to the yt-dl
./yt-dlp --cookies cookies.txt <video_link>