Skip to content

Misc

To get the long and short names of paths in windows:

Terminal window
dir /x "C:\"
02/20/2025 12:34 PM <DIR> PROGRA~1 Program Files
02/20/2025 12:34 PM <DIR> PROGRA~2 Program Files (x86)

To replace a specific string with another using python, use named match groups:

pattern = r"!\[\[(?P<imageName>\S*)\]\]";
patternToReplaceWith = r'![\g<imageName>][assets\\HTB Walkthroughs\\Blazorized\\\g<imageName>]'
life = re.sub(pattern, patternToReplaceWith, xx)

To download a website:

Terminal window
wget --mirror --convert-links --adjust-extensions --page-requisites --no-parent https://website