-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateWriteups.py
More file actions
41 lines (30 loc) · 890 Bytes
/
updateWriteups.py
File metadata and controls
41 lines (30 loc) · 890 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
from pathlib import Path
from urllib.parse import quote_plus
text = """
# TGHACK 25
> Writeups and challenges resources for TGHACK25
## Table of content
- [afk](#afk)
- [beginner](#beginner)
- [coding](#coding)
- [crypto](#crypto)
- [forensics](#forensics)
- [misc](#misc)
- [osint](#osint)
- [pwn](#pwn)
- [reversing](#reversing)
- [stego](#stego)
- [web](#web)
---
## Writeups
"""
sortkey = lambda path: path.name.lower()
for category in sorted(Path("./writeups").glob("*/"), key=sortkey):
text += f"\n### {category.name}\n"
for chall in sorted(category.glob("*/"), key=sortkey):
text += f" - **{chall.name}**\n"
for writeup in sorted(chall.glob("*/"), key=sortkey):
url = "/".join(quote_plus(part) for part in writeup.parts)
text += f"\t - [{writeup.name}]({url}/) \n"
open('README.md', 'w').write(text)