Skip to content

Instantly share code, notes, and snippets.

@wangweihong
wangweihong / collect_env.sh
Created March 12, 2025 03:32
采集容器内pytorch显卡相关信息
#!/bin/bash
set -ex
# usage: CONTAINER_NAME=xxx ./collect_env.sh
CONTAINER_NAME=${CONTAINER_NAME:-xxxx}
cat << 'EOF' > ./collect_env.py
# mypy: allow-untyped-defs
{
"[python]": {
"editor.formatOnType": true
},
"python.defaultInterpreterPath": "C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python310\\python.exe",
"editor.unicodeHighlight.nonBasicASCII": false,
"workbench.editor.enablePreview": false,
"tabnine.experimentalAutoImports": true,
"[html]": {
@wangweihong
wangweihong / gist:cc0376e094687663d1236a37d6338df2
Created August 19, 2021 08:45
restore stuck in New phase velero' log
time="2021-08-19T16:14:15+08:00" level=info msg="Backed up 16 items out of an estimated total of 17 (estimate will change throughout the backup)" backup=velero/b1 logSource="pkg/backup/backup.go:394" name=sdfsfsdfd namespace=restic progress= resource=deployments.apps
time="2021-08-19T16:14:15+08:00" level=info msg="Processing item" backup=velero/b1 logSource="pkg/backup/backup.go:354" name=sync-timezone namespace=restic progress= resource=podpresets.settings.k8s.io
time="2021-08-19T16:14:15+08:00" level=info msg="Backing up item" backup=velero/b1 logSource="pkg/backup/item_backupper.go:121" name=sync-timezone namespace=restic resource=podpresets.settings.k8s.io
time="2021-08-19T16:14:15+08:00" level=info msg="Backed up 17 items out of an estimated total of 17 (estimate will change throughout the backup)" backup=velero/b1 logSource="pkg/backup/backup.go:394" name=sync-timezone namespace=restic progress= resource=podpresets.settings.k8s.io
time="2021-08-19T16:14:16+08:00" level=info msg="Backed up a total of 17
@wangweihong
wangweihong / docker_images.sh
Created May 19, 2018 03:56 — forked from hydra1983/docker_images.sh
Save and load docker images in batch
#!/bin/bash
readonly DB_FILE="$(pwd)/images.db"
readonly IMG_DIR="$(pwd)/images"
save-images() {
echo "Create ${DB_FILE}"
echo "$(docker images|grep -v 'IMAGE ID'|awk '{printf("%s %s %s\n", $1, $2, $3)}'|column -t)" > "${DB_FILE}"
echo "Read ${DB_FILE}"