Skip to content

Instantly share code, notes, and snippets.

View sdvcrx's full-sized avatar
🎯
Focusing

sdvcrx sdvcrx

🎯
Focusing
View GitHub Profile
@sdvcrx
sdvcrx / migrate.py
Last active December 28, 2021 02:54
Sync dockerhub images to ghcr.io or other registry
"""
Sync dockerhub images to ghcr.io or other registry
Usage:
1. create tag list file `tags.txt` that syncing to ghcr.io
```
git tag > tags.txt
{{ $repo := .Get "repo" }}
{{ $detail := getJSON "https://api.github.com/repos/" $repo }}
<article class="shortcode-card">
<a href="https://github.com/{{ $repo }}" target="_blank" rel="noopener">
<header>
<img alt="{{ $repo }}" src="https://opengraph.githubassets.com/1/{{ $repo }}" />
</header>
<div class="shortcode-card-content">
<h2>{{ .Get "repo" }}</h2>
{{ with $detail }}
@sdvcrx
sdvcrx / compress_img.py
Last active December 8, 2024 11:52
Compressing images using libvips
import os
import sys
import pyvips
options = {
'Q': 75,
'quant_table': 3,
'interlace': True,
'strip': True,
'optimize_coding': True,