Skip to content

Instantly share code, notes, and snippets.

View Rgghgh's full-sized avatar

Tomer Gandler Rgghgh

View GitHub Profile
@Rgghgh
Rgghgh / sc2.py
Created May 10, 2024 07:29
PDF overlay merger (file 1 is the base, file 2 is the overlay)
import fitz # Import PyMuPDF
def overlay_notes(original_pdf_path, notes_pdf_path, output_pdf_path):
# Open the original and notes documents
original_pdf = fitz.open(original_pdf_path)
notes_pdf = fitz.open(notes_pdf_path)
# Iterate through the pages and overlay notes onto the original
for page_number in range(len(original_pdf)):
original_page = original_pdf[page_number]
from scapy.all import *
from scapy.utils import PcapWriter
packets = rdpcap('cap.pcap')
new_cap = PcapWriter("cap_new.pcap")
# old: new
mapping = {
'203.76.192.10': '1.1.1.1'
}
@Rgghgh
Rgghgh / import.sql
Created April 8, 2020 10:36
Import apache2 access.log into mysql
LOAD DATA INFILE '<INSERT_FILE_PATH_HERE>' INTO TABLE accesslog
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY ''
LINES TERMINATED BY '\n';
@Rgghgh
Rgghgh / fix_whatsapp_images_dates.py
Last active December 27, 2019 14:34
Fix whatsapp image dates when restored from backup
from datetime import datetime
import piexif
import os
import time
folder = './'
def get_datetime(filename):
date_str = filename.split('-')[1]
@Rgghgh
Rgghgh / alert.html
Last active June 30, 2017 14:34
HTML & CSS Chrome dialog box
<style type="text/css">
body {
zoom: 250%;
}
#alert {
width: 500px;
height: 150px;
border: 1px solid #bababa;
background-color: #fbfbfb;
@Rgghgh
Rgghgh / run.sh
Created September 17, 2016 14:31
Clone all GitHub Repos
curl --user "<USERNAME>:<PASSWORD>" "https://api.github.com/user/repos" | grep -w clone_url | grep -o '[^"]\+://.\+.git' | xargs -L1 git clone