Quick Tip zum synchen von Tags in Forks (Git) hinzugefügt.
All checks were successful
ci/woodpecker/push/default Pipeline was successful
All checks were successful
ci/woodpecker/push/default Pipeline was successful
This commit is contained in:
parent
9e7b8f8faa
commit
4525956c0d
3 changed files with 58 additions and 0 deletions
20
docs/Quick Tips/Docker/aufraeumen.md
Normal file
20
docs/Quick Tips/Docker/aufraeumen.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Aufräumen und Platz sparen
|
||||
|
||||
# Inaktive Container und unbenötigte Objekte löschen
|
||||
Docker sammelt im Laufe der Zeit jede Menge alte Images und Container an, die nicht mehr benötigt werden. Diese sollten regelmäßig gelöscht werden. Am umfassensten geht dies mit
|
||||
|
||||
``` bash
|
||||
# System (Network, Container, dangling Image, dangling Cache)
|
||||
docker system prune
|
||||
```
|
||||
|
||||
Dies löscht alle gestoppten Container sowie Networks, Images und Caches, die nicht getagged sind und zu keinem existierenden Container gehören.
|
||||
Daher sollte man sicherstellen, dass alle noch benötigten Container laufen.
|
||||
|
||||
# Unbenötigte Images löschen
|
||||
Weiterer Platz lässt sich sparen, indem man auch Images löscht, die getagged sind, aber zu keinen aktiven Container gehören.
|
||||
|
||||
``` bash
|
||||
# Images (unused) löschen
|
||||
docker image prune -a
|
||||
```
|
58
docs/Quick Tips/Git/sync-tags-branches.md
Normal file
58
docs/Quick Tips/Git/sync-tags-branches.md
Normal file
|
@ -0,0 +1,58 @@
|
|||
# Branches und Tags in einem Fork von Upstream synchen
|
||||
|
||||
Manchmal ist es notwendig, einen Fork auf den aktuellen Stand zu bringen und dabei auch die Branches und Tags aus dem Upstream zu übernehmen,
|
||||
z.B. für Mkdocs Material Insiders notwendig, da die Pull-App versagt...
|
||||
|
||||
1. Fork lokal clonen
|
||||
2. Upstream Remote anlegen
|
||||
``` bash
|
||||
git remote add upstream <REPO-URL>
|
||||
git pull upstream
|
||||
```
|
||||
3. Skript zur Synchronisation anlegen (sync.sh) [^1]:
|
||||
``` bash
|
||||
## Checkout all branches from remote as tracking branches. Based on https://stackoverflow.com/questions/379081/track-all-remote-git-branches-as-local-branches/6300386#6300386
|
||||
|
||||
UPSTREAM=$1
|
||||
MYREPO=$2
|
||||
|
||||
usage() {
|
||||
echo "Usage:"
|
||||
echo "$0 <upstream-remote> <target-remote>"
|
||||
echo ""
|
||||
echo "Example which ensures remote named 'maxandersen' have all the same branches and tags as 'origin'"
|
||||
echo "$0 origin maxandersen"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -z "$UPSTREAM" ]
|
||||
then
|
||||
echo Missing upstream remote name.
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -z "$MYREPO" ]
|
||||
then
|
||||
echo Missing target remote name.
|
||||
usage
|
||||
fi
|
||||
|
||||
read -p "1. This will setup '$MYREPO' to track all branches in '$UPSTREAM' - Are you sure ?" -n 1 -r
|
||||
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
for brname in `git branch -r | grep "$UPSTREAM" | grep -v master | grep -v HEAD | sed -e 's/.*\///g'`; do git branch --track $brname $UPSTREAM/$brname ; done
|
||||
fi
|
||||
|
||||
read -p "2. This will push all local branches and tags into '$MYREPO' - Are you sure ?" -n 1 -r
|
||||
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
git push --all $MYREPO
|
||||
git push --tags $MYREPO
|
||||
fi
|
||||
```
|
||||
4. synchronisieren mit ``` ./sync.sh upstream origin ```
|
||||
|
||||
|
||||
[^1]: How to update my fork to have the same branches and tags as the original repository on github? [Stackoverflow](hhttps://stackoverflow.com/questions/15779740/how-to-update-my-fork-to-have-the-same-branches-and-tags-as-the-original-reposit)
|
14
docs/Quick Tips/Proxmox/aufraeumen.md
Normal file
14
docs/Quick Tips/Proxmox/aufraeumen.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Aufräumen und Platz sparen
|
||||
|
||||
# QCow-Images schrumpfen
|
||||
Die von Proxmox verwendeten Images beginnen sehr klein und wachsen dann mit zunehmender Benutzung des Gastsystems. Dies erlaubt Overprovisioning.
|
||||
|
||||
Allerdings schrumpfen die Images danach nicht mehr. Haben Sie einmal eine bestimmte Größe erreicht, behalten sie diese bei, auch wenn der Platz vom Gastsystem nicht mehr benötigt wird.
|
||||
|
||||
Dies lässt sich jedoch einfach manuell (oder gescriptet) erledigen:
|
||||
|
||||
1. Auf dem Host libguestfs-tools installieren
|
||||
2. Image schrumpfen
|
||||
``` bash
|
||||
virt-sparsify --in-place disk.qcow2
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue