Skip to content

Instantly share code, notes, and snippets.

View Den1al's full-sized avatar
🎯
Focusing

Den1al Den1al

🎯
Focusing
View GitHub Profile
@Den1al
Den1al / func-deps.py
Last active February 28, 2024 23:48
Get the dependencies of functions in python using abstract syntax trees
from pathlib import Path
import ast
from typing import Any, List, Tuple
from dataclasses import dataclass, field
@dataclass
class Dependencies:
arguments: List[ast.arg] = field(default_factory=list)
variables: List[ast.Name] = field(default_factory=list)
@Den1al
Den1al / wget-download-directory-listing.sh
Created February 6, 2022 12:14
Use WGET to download all files recursively from a directory listing
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains <DOMAIN> \
--no-parent <URL>
@Den1al
Den1al / docker-deep-save.py
Last active June 18, 2022 19:21
Save a docker image and extract all layers to disk
from pathlib import Path
from argparse import ArgumentParser, Namespace
import tarfile
import os
import tempfile
from tempfile import _TemporaryFileWrapper
import json
from subprocess import check_output, CalledProcessError