Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int value = 10; | |
int *pointer = &value; | |
// print the address of the variable and the pointer value | |
printf("Address of 'value': %p\n", (void *)&value); | |
printf("Value of 'pointer': %p\n", (void *)pointer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
// demonstrate pointer basics | |
void pointerBasics() { | |
int a = 42; | |
int *ptr = &a; | |
printf("Pointer Basics:\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
get_heap_size() { | |
local pid=$1 | |
local heap_size=0 | |
# Read the /proc/[pid]/maps file | |
while read -r line; do | |
if [[ "$line" == *"heap"* ]]; then | |
local start_addr=$(echo "$line" | awk '{print $1}' | cut -d'-' -f1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -t nat -F | |
iptables -t mangle -F | |
iptables -F | |
iptables -X |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tcpdump -i wlan0 host 192.168.1.201 -w - -U | tee tama_`date +%F`.pcap | tcpdump -r - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
OLED: | |
GND -> GND | |
VCC -> 5v | |
SCK -> A5 | |
SDA -> A4 | |
IR Receiver: | |
GND -> GND | |
VCC -> 5v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clear existing rules | |
#sudo iptables -F | |
#sudo iptables -t nat -F | |
#sudo iptables -X | |
# allow forwarding for related and established connections | |
sudo iptables -A FORWARD -i wlan0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT | |
# allow forwarding from wlan0 to wlan0 (both directions) | |
sudo iptables -A FORWARD -i wlan0 -o wlan0 -j ACCEPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Conversion Functions | |
hex2dec() { | |
printf "%d\n" "0x$1" | |
} | |
bin2dec() { | |
echo "$((2#$1))" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import select | |
from logzero import logger | |
# python forwarder.py localhost:1337 ipinfo.io:80 | |
# curl -v http://localhost.com:1337 -H "Host: ipinfo.io" | |
# video: https://www.youtube.com/watch?v=32KKwgF67Ho | |
class Forwarder: |
NewerOlder