File size: 2,976 Bytes
d15f07c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Maintenance Scripts

System maintenance, cleanup, and development utilities.

## Cleanup Scripts

### cleanup_disk_space.sh
Frees up disk space by removing temporary files and caches.

**Usage:**
```bash
./scripts/maintenance/cleanup_disk_space.sh
```

**What it removes:**
- Docker images and containers
- Python cache files
- Node.js cache
- Temporary build artifacts

**⚠️ Does NOT remove:**
- Application data cache (`data/cache/`)
- Database files
- Important project data

### cleanup_frontend_junk.sh
Removes frontend build artifacts and dependencies.

**Usage:**
```bash
./scripts/maintenance/cleanup_frontend_junk.sh
```

### docker-cleanup.sh
Docker-specific cleanup (removes unused images, containers, volumes).

**Usage:**
```bash
./scripts/maintenance/docker-cleanup.sh
```

**What it cleans:**
- Stopped containers
- Unused images
- Dangling volumes
- Unused networks

## Project Maintenance

### clear_notebook_outputs.py
**🔒 Security:** Clears cell outputs from Jupyter notebooks to prevent sensitive data leaks.

**Usage:**
```bash
# Clear specific notebooks
python scripts/maintenance/clear_notebook_outputs.py path/to/notebook.ipynb

# Clear all notebooks in scripts/datasources/
python scripts/maintenance/clear_notebook_outputs.py
```

**Why this matters:**
- ✅ Prevents database credentials from being committed
- ✅ Removes API keys from cell outputs
- ✅ Cleans file paths that might contain usernames
- ✅ Removes execution counts (cleaner diffs)

**When to use:**
- Before committing Colab notebooks
- After running notebooks with sensitive data
- When notebook outputs contain database URLs

**Automatic protection:**
- Pre-push hook checks for outputs in staged notebooks
- Blocks commits if outputs detected
- Reminds you to clear outputs before pushing

**Example:**
```bash
# Edit notebook in Colab, run cells with secrets
# Before committing:
python scripts/maintenance/clear_notebook_outputs.py \
  packages/scrapers/src/scrapers/youtube/load_youtube_events_colab.ipynb

git add packages/scrapers/src/scrapers/youtube/load_youtube_events_colab.ipynb
git commit -m "Update YouTube loading notebook"
git push  # Pre-push hook automatically checks for outputs
```

### migrate-docs.sh
Migrates documentation from project root to website/docs/ (Docusaurus format).

**Usage:**
```bash
./scripts/maintenance/migrate-docs.sh
```

**What it does:**
- Moves .md files from root to website/docs/
- Adds YAML frontmatter
- Converts filenames to kebab-case

## System Utilities

### prevent_terminal_corruption.sh
Prevents terminal corruption from Unicode characters.

**Usage:**
```bash
source scripts/maintenance/prevent_terminal_corruption.sh
```

### move_secrets_to_home.sh
Moves secrets to home directory for security.

**Usage:**
```bash
./scripts/maintenance/move_secrets_to_home.sh
```

## Development

### test-app.py
Quick test script for application functionality.

**Usage:**
```bash
python scripts/maintenance/test-app.py
```