Skip to content

Instantly share code, notes, and snippets.

@srpatcha
srpatcha / AdbCommands
Created March 25, 2022 23:12 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@srpatcha
srpatcha / page_fault_mechanism_stack.c
Created August 29, 2019 02:53
growing downwards on a fault" behavior for virtual memory can be requested by arbitrary user programs with the MAP_GROWSDOWN flag being passed to the mmap syscall.
/* find the pid of the program (via ps) and look at /proc/$THIS_PID/maps */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
int main() {
long page_size = sysconf(_SC_PAGE_SIZE);
@srpatcha
srpatcha / ios_dcsd_output_set.c
Created August 29, 2019 02:40 — forked from matteyeux/ios_dcsd_output_set.c
Setting up /dev/uart.debug-console output for DCSD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <assert.h>
#include <fcntl.h>
#include <errno.h>
#include <termios.h>
#include <unistd.h>
#include <sys/event.h>
@srpatcha
srpatcha / Docker_help.sh
Created May 15, 2018 17:14
Docker Help
Help : https://devhints.io/
#List local available images
$ docker images
$docker run <image>
$docker run -d <image> = run in disconnected / daemon mode
KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@srpatcha
srpatcha / GDB_debugging :
Last active September 19, 2018 01:13
GDB debugging :
Compile Source Code with -g to load debugging symbols :
Example : gcc -g -o hellow helloworld.c
GDB Debugging :
$ gdb a.out
gdb) b main
@srpatcha
srpatcha / chipsettype
Created March 22, 2018 21:26
Why 64 bits is AMD64 and 32 bit is i386?
Why 64 bits is AMD64 and 32 bit is i386?
i386: Intel initially called metonymy specification IA-32(Intel Architecture 32 bit) invented by Intel. IA-32e and EM64T then later settled with "Intel 64".
AMD64: AMD developed 64 bit ISA, At this time Intel was developing Itanium, Later intel also adopted AMD's 64 bit ISA.Intel 80386's instruction set programming model and binary encodings are still the common denominator for all 32-bit processors and hence i386, a.k.a x86 or IA-32.other names being x64, x86_64, x86-64.
@srpatcha
srpatcha / git_reset
Created March 21, 2018 19:29
Remove the latest commit in git repo
git log
git reset --hard HEAD~1 // for latest
git reset --hard <sha1-commit-id> // for commit ID or specific 5th commit HEAD~5
git log
git push origin HEAD --force
@srpatcha
srpatcha / Gist_fork_file1
Created March 21, 2018 18:46
Working with fork and Keeping up to date
1. Clone your fork:
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
2. Add remote from original repository in your forked repository:
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git remote -v
git fetch upstream
3. Updating your fork from original repo to keep up with their changes: