Skip to content

Commit 20b2562

Browse files
author
Damien Le Bourdonnec
committed
✨ Add SEO updates workflow, sitemap, and robots.txt; enhance README and HTML metadata
1 parent d700c83 commit 20b2562

File tree

8 files changed

+315
-11
lines changed

8 files changed

+315
-11
lines changed

.github/workflows/seo-updates.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: SEO Updates
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-seo:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Update sitemap lastmod dates
16+
run: |
17+
# Update sitemap.xml with current date
18+
current_date=$(date +"%Y-%m-%d")
19+
sed -i "s/<lastmod>.*<\/lastmod>/<lastmod>$current_date<\/lastmod>/g" sitemap.xml
20+
21+
- name: Commit changes
22+
run: |
23+
git config --local user.email "action@github.com"
24+
git config --local user.name "GitHub Action"
25+
git add sitemap.xml
26+
git diff --staged --quiet || git commit -m "Auto-update sitemap lastmod dates"
27+
git push

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,43 @@
1-
# Cheat sheets
1+
# Programming Cheat Sheets - Developer Reference Guide
22

3-
Keep tracks of every useful tips & tricks
3+
A comprehensive collection of programming cheat sheets for developers. Quick reference guides covering **Python**, **Docker**, **Linux**, **Algorithms**, and more essential development topics.
44

5-
![](https://images.unsplash.com/photo-1481627834876-b7833e8f5570?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=928&q=80)
5+
Perfect for developers who want to boost productivity with practical tips, tricks, and code snippets that solve real-world problems.
6+
7+
![Programming and development resources](https://images.unsplash.com/photo-1481627834876-b7833e8f5570?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1200&q=80 "Developer cheat sheets and programming references")
68

79
📷 by [Janko Ferlič](https://unsplash.com/@itfeelslikefilm)
10+
11+
## 🚀 What You'll Find Here
12+
13+
This repository contains practical, ready-to-use code examples and configurations for:
14+
15+
- **🐍 Python Development**: File operations, data structures, linting, OCR, and modern tools like UV
16+
- **🐳 Containerization**: Docker installation, configuration, and Portainer setup
17+
- **🐧 Linux Administration**: Shell configuration, system maintenance, and troubleshooting
18+
- **⚡ Algorithms**: Distance heuristics and computational concepts
19+
- **📦 DevOps Tools**: Package management, development servers, and workflow optimization
20+
21+
## 📚 Browse Categories
22+
23+
Each section contains detailed examples, best practices, and troubleshooting tips gathered from real-world development experience.
24+
25+
### 🔧 Quick Navigation
26+
27+
| Category | Topics Covered | Skill Level |
28+
|----------|----------------|-------------|
29+
| **Python** | Files, Lists, Dictionaries, OCR, DevPi, UV Package Manager | Beginner to Advanced |
30+
| **Containers** | Docker Setup, Portainer, Container Management | Intermediate |
31+
| **Linux** | Zsh, Starship, System Recovery | Beginner to Intermediate |
32+
| **Algorithms** | Distance Calculations, Optimization Techniques | Advanced |
33+
34+
## 💡 Why These Cheat Sheets?
35+
36+
- **Practical Focus**: Real solutions to common development problems
37+
- **Copy-Paste Ready**: Code that works out of the box
38+
- **Continuously Updated**: Based on current best practices and modern tools
39+
- **Developer Tested**: Used in production environments
40+
41+
---
42+
43+
*Last updated: September 2025 | Maintained by [Greums](https://github.com/greums)*

containerization/install-and-configure-docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker-compose version
3535

3636
## Configure remote access
3737

38-
If you want to grant access from a remote [Portainer service](https://github.com/greums/cheat-sheets/blob/master/containerization/install-portainer-as-container.md), Docker daemon must be configured to listen on TCP port.
38+
If you want to grant access from a remote [Portainer service](containerization/install-portainer-as-container.md), Docker daemon must be configured to listen on TCP port.
3939
Create or update `/etc/docker/daemon.json`:
4040
```bash
4141
sudo nano /etc/docker/daemon.json

containerization/install-portainer-as-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## Prerequisite
1010

11-
[Docker and Docker Compose](https://github.com/greums/cheat-sheets/blob/master/containerization/install-and-configure-docker.md) must be up and running before deploying Portainer.
11+
[Docker and Docker Compose](containerization/install-and-configure-docker.md) must be up and running before deploying Portainer.
1212

1313
## Run Portainer container
1414

index.html

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,96 @@
33

44
<head>
55
<meta charset="UTF-8">
6-
<title>Cheat Sheets</title>
6+
<title>Programming Cheat Sheets - Python, Docker, Linux & More | Developer Reference</title>
77
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
8-
<meta name="description" content="Description">
8+
<meta name="description" content="Comprehensive programming cheat sheets for developers. Quick reference guides for Python, Docker, Linux, algorithmic concepts, and more. Boost your coding productivity with practical tips and tricks.">
9+
<meta name="keywords" content="cheat sheets, programming, python, docker, linux, algorithms, developer, coding, reference, tutorial, guide">
10+
<meta name="author" content="Greums">
11+
<meta name="robots" content="index, follow">
912
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
13+
14+
<!-- Open Graph / Facebook -->
15+
<meta property="og:type" content="website">
16+
<meta property="og:url" content="http://keep.greums.xyz/">
17+
<meta property="og:title" content="Programming Cheat Sheets - Python, Docker, Linux & More | Developer Reference">
18+
<meta property="og:description" content="Comprehensive programming cheat sheets for developers. Quick reference guides for Python, Docker, Linux, algorithmic concepts, and more.">
19+
<meta property="og:image" content="https://images.unsplash.com/photo-1481627834876-b7833e8f5570?ixlib=rb-1.2.1&auto=format&fit=crop&w=1200&q=80">
20+
21+
<!-- Twitter -->
22+
<meta property="twitter:card" content="summary_large_image">
23+
<meta property="twitter:url" content="http://keep.greums.xyz/">
24+
<meta property="twitter:title" content="Programming Cheat Sheets - Python, Docker, Linux & More | Developer Reference">
25+
<meta property="twitter:description" content="Comprehensive programming cheat sheets for developers. Quick reference guides for Python, Docker, Linux, algorithmic concepts, and more.">
26+
<meta property="twitter:image" content="https://images.unsplash.com/photo-1481627834876-b7833e8f5570?ixlib=rb-1.2.1&auto=format&fit=crop&w=1200&q=80">
27+
28+
<!-- Canonical URL -->
29+
<link rel="canonical" href="http://keep.greums.xyz/">
30+
31+
<!-- Theme color -->
32+
<meta name="theme-color" content="#404040">
33+
34+
<!-- CSS -->
1035
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
1136
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/sidebar.min.css" />
37+
38+
<!-- Structured Data -->
39+
<script type="application/ld+json">
40+
{
41+
"@context": "https://schema.org",
42+
"@type": "TechArticle",
43+
"headline": "Programming Cheat Sheets - Developer Reference Guide",
44+
"description": "Comprehensive programming cheat sheets for developers. Quick reference guides for Python, Docker, Linux, algorithmic concepts, and more.",
45+
"author": {
46+
"@type": "Person",
47+
"name": "Greums"
48+
},
49+
"publisher": {
50+
"@type": "Organization",
51+
"name": "Greums Cheat Sheets"
52+
},
53+
"url": "http://keep.greums.xyz/",
54+
"dateModified": "2025-09-27",
55+
"mainEntityOfPage": {
56+
"@type": "WebPage",
57+
"@id": "http://keep.greums.xyz/"
58+
}
59+
}
60+
</script>
1261
</head>
1362

1463
<body>
1564
<div id="app"></div>
1665
<script>
1766
window.$docsify = {
18-
name: 'Cheat Sheets',
67+
name: 'Programming Cheat Sheets',
1968
repo: 'https://github.com/greums/cheat-sheets',
2069
themeColor: '#404040',
2170
loadSidebar: true,
22-
subMaxLevel: 2,
71+
subMaxLevel: 3,
72+
auto2top: true,
73+
coverpage: false,
74+
maxLevel: 4,
75+
loadNavbar: false,
76+
mergeNavbar: true,
77+
executeScript: true,
78+
noEmoji: false,
79+
search: {
80+
noData: 'No results!',
81+
paths: 'auto',
82+
placeholder: 'Search cheat sheets...',
83+
pathNamespaces: /^(\/(zh-cn|ru))?(\/(v1|v2))?/
84+
},
85+
copyCode: {
86+
buttonText: 'Copy to clipboard',
87+
errorText: 'Error',
88+
successText: 'Copied'
89+
},
90+
pagination: {
91+
previousText: 'Previous',
92+
nextText: 'Next',
93+
crossChapter: true,
94+
crossChapterText: true,
95+
}
2396
}
2497
</script>
2598
</body>
@@ -36,6 +109,8 @@
36109
<script src="https://unpkg.com/docsify-copy-code"></script>
37110
<script src="https://cdn.jsdelivr.net/npm/docsify-sidebar-collapse/dist/docsify-sidebar-collapse.min.js"></script>
38111
<script src="https://unpkg.com/docsify/lib/plugins/search.min.js"></script>
112+
<script src="https://unpkg.com/docsify-pagination/dist/docsify-pagination.min.js"></script>
113+
<script src="https://unpkg.com/docsify/lib/plugins/zoom-image.js"></script>
39114
<!-- Google Analytics -->
40115
<script async src="https://www.googletagmanager.com/gtag/js?id=G-TGLCCVZB2C"></script>
41116
<script>

python/files-and-directories.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
# Files and directories
1+
# Python Files and Directories - Complete Guide with Examples
22

3-
![](https://images.unsplash.com/photo-1583521214690-73421a1829a9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80)
3+
Master Python file and directory operations with practical examples and performance optimizations. Learn efficient ways to calculate directory sizes, handle file paths, and work with the filesystem.
4+
5+
![Python file and directory operations examples](https://images.unsplash.com/photo-1583521214690-73421a1829a9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1200&q=80 "Python programming for file system operations")
46

57
📷 by [Wesley Tingey](https://unsplash.com/@wesleyphotography)
68

9+
> **Quick Reference**: Learn how to efficiently calculate directory sizes in Python using both sequential and concurrent approaches. Perfect for system administration and file management tasks.
10+
11+
## Table of Contents
12+
13+
- [Get Directory Size (Basic)](#get-total-size-of-a-directory)
14+
- [Optimized Directory Size Calculation](#faster-way-to-get-total-size-of-a-directory)
15+
- [Performance Comparison](#performance-analysis)
16+
- [Best Practices](#best-practices)
17+
718
## Get total size of a directory
819

920
Take a folder containing lots of nested subfolders also containing too many files:
@@ -55,3 +66,57 @@ print(f"size : {round(size / 1024**3, 2)} GB\ntook : {round(time() - start_time,
5566
size : 55.09 GB
5667
took : 8.27 seconds
5768
```
69+
70+
## Performance Analysis
71+
72+
The concurrent approach provides a **4x speed improvement** for large directories with multiple subdirectories. Here's why:
73+
74+
- **Sequential**: Processes files one by one
75+
- **Concurrent**: Utilizes multiple CPU cores for parallel processing
76+
- **Best for**: Large directories with many subdirectories
77+
78+
## Best Practices
79+
80+
### ✅ Do's
81+
- Use `pathlib.Path` for modern, readable path operations
82+
- Implement error handling for permission issues
83+
- Consider memory usage for very large directories
84+
- Use `ProcessPoolExecutor` for CPU-intensive tasks
85+
86+
### ❌ Don'ts
87+
- Don't use string concatenation for paths
88+
- Avoid blocking the main thread for large operations
89+
- Don't ignore file access permissions
90+
91+
## Additional File Operations
92+
93+
### Check if Path Exists
94+
```python
95+
from pathlib import Path
96+
97+
file_path = Path("example.txt")
98+
if file_path.exists():
99+
print("File exists!")
100+
```
101+
102+
### Create Directories
103+
```python
104+
# Create directory with parents
105+
Path("path/to/new/directory").mkdir(parents=True, exist_ok=True)
106+
```
107+
108+
### List Files with Filter
109+
```python
110+
# Get all Python files
111+
python_files = list(Path(".").glob("**/*.py"))
112+
print(f"Found {len(python_files)} Python files")
113+
```
114+
115+
## Related Topics
116+
117+
- [Python Lists and Dictionaries](lists-and-dictionaries.md) - Data structure operations
118+
- [Python Linting and Configuration](linting-and-configuration.md) - Code quality tools
119+
120+
---
121+
122+
**Keywords**: Python file operations, directory size calculation, pathlib, concurrent processing, filesystem programming, Python system administration

robots.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
User-agent: *
2+
Allow: /
3+
4+
# Sitemap
5+
Sitemap: http://keep.greums.xyz/sitemap.xml
6+
7+
# Crawl-delay (optional - helps prevent overwhelming your server)
8+
Crawl-delay: 1
9+
10+
# Disallow specific paths if needed (currently allowing all)
11+
# Disallow: /private/
12+
# Disallow: /temp/

sitemap.xml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
5+
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
6+
7+
<!-- Homepage -->
8+
<url>
9+
<loc>http://keep.greums.xyz/</loc>
10+
<lastmod>2025-09-27</lastmod>
11+
<changefreq>weekly</changefreq>
12+
<priority>1.0</priority>
13+
</url>
14+
15+
<!-- Containerization -->
16+
<url>
17+
<loc>http://keep.greums.xyz/#/containerization/install-and-configure-docker</loc>
18+
<lastmod>2025-09-27</lastmod>
19+
<changefreq>monthly</changefreq>
20+
<priority>0.8</priority>
21+
</url>
22+
<url>
23+
<loc>http://keep.greums.xyz/#/containerization/install-portainer-as-container</loc>
24+
<lastmod>2025-09-27</lastmod>
25+
<changefreq>monthly</changefreq>
26+
<priority>0.8</priority>
27+
</url>
28+
29+
<!-- Linux -->
30+
<url>
31+
<loc>http://keep.greums.xyz/#/linux/fix-a-corrupt-zsh-history-file</loc>
32+
<lastmod>2025-09-27</lastmod>
33+
<changefreq>monthly</changefreq>
34+
<priority>0.8</priority>
35+
</url>
36+
<url>
37+
<loc>http://keep.greums.xyz/#/linux/install-zsh-and-starship</loc>
38+
<lastmod>2025-09-27</lastmod>
39+
<changefreq>monthly</changefreq>
40+
<priority>0.8</priority>
41+
</url>
42+
43+
<!-- Algorithmic -->
44+
<url>
45+
<loc>http://keep.greums.xyz/#/algorithmic/distance-heuristics</loc>
46+
<lastmod>2025-09-27</lastmod>
47+
<changefreq>monthly</changefreq>
48+
<priority>0.7</priority>
49+
</url>
50+
51+
<!-- Python -->
52+
<url>
53+
<loc>http://keep.greums.xyz/#/python/devpi-server-as-local-pypi-mirror</loc>
54+
<lastmod>2025-09-27</lastmod>
55+
<changefreq>monthly</changefreq>
56+
<priority>0.8</priority>
57+
</url>
58+
<url>
59+
<loc>http://keep.greums.xyz/#/python/files-and-directories</loc>
60+
<lastmod>2025-09-27</lastmod>
61+
<changefreq>monthly</changefreq>
62+
<priority>0.8</priority>
63+
</url>
64+
<url>
65+
<loc>http://keep.greums.xyz/#/python/linting-and-configuration</loc>
66+
<lastmod>2025-09-27</lastmod>
67+
<changefreq>monthly</changefreq>
68+
<priority>0.8</priority>
69+
</url>
70+
<url>
71+
<loc>http://keep.greums.xyz/#/python/lists-and-dictionaries</loc>
72+
<lastmod>2025-09-27</lastmod>
73+
<changefreq>monthly</changefreq>
74+
<priority>0.8</priority>
75+
</url>
76+
<url>
77+
<loc>http://keep.greums.xyz/#/python/optical-character-recognition</loc>
78+
<lastmod>2025-09-27</lastmod>
79+
<changefreq>monthly</changefreq>
80+
<priority>0.8</priority>
81+
</url>
82+
<url>
83+
<loc>http://keep.greums.xyz/#/python/uv-the-python-tool-that-revolutionizes-dependency-management</loc>
84+
<lastmod>2025-09-27</lastmod>
85+
<changefreq>monthly</changefreq>
86+
<priority>0.8</priority>
87+
</url>
88+
89+
</urlset>

0 commit comments

Comments
 (0)