GitLab recently decided to silently delete any repositories that hadn't been accessed in the last year. The announcement didn't go over well and they soon caved to public pressure and decided to instead back up inactive repos to object storage instead of unilaterally deleting them. I'm glad they reconsidered, but the experience left me with a bad taste in my mouth, so I decided to look into (relatively) low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| SCRIPT_NAME="$(basename "$0")" | |
| usage() { | |
| cat <<EOF | |
| $SCRIPT_NAME — multi-format compressor (zstd, xz, gzip, lz4, snappy, brotli, zpaq) | |
| Quick guide (which algo to use?): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # ============================================================================= | |
| # check_axios_compromise.sh | |
| # Scans project subdirectories AND global package manager caches/stores for | |
| # compromised axios versions (SNYK-JS-AXIOS-15850650) | |
| # | |
| # Affected versions : axios@1.14.1 | axios@0.30.4 | |
| # Malicious dep : plain-crypto-js@4.2.1 | |
| # Supported PMs : npm · yarn (v1 classic & v2/v3 Berry) · pnpm · bun | |
| # Node version mgrs : nvm · fnm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Helper Comments: | |
| # This script helps manage Docker images by cleaning up old and unused images | |
| # while keeping a specified number of recent images per repository. | |
| # | |
| # Usage: | |
| # ./clean-docker-images.sh [--keep N] [--prune-containers] [--prune-dangling] | |
| # | |
| # Parameters: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jQuery import | |
| global.jQuery = require('jquery'); | |
| var $ = global.jQuery; | |
| window.$ = $; | |
| // Bootstrap 4 depends on Popper.js | |
| // Popper.js import | |
| //import Popper from 'popper.js'; | |
| //window.Popper = Popper; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup mongodb from docker container | |
| docker exec -i ${CONTAINER_NAME} mongodump --uri=${DB_URI} --archive --gzip > $(date +%Y%m%d_%H%M%S)_${DB_NAME}.pgsql.gz | |
| # Restore mongodb from docker container | |
| cat ${FILENAME}.mongodump.gz | docker exec -i ${CONTAINER_NAME} mongorestore --uri=${DB_URI} --nsFrom="${SRC_DB}.*" --nsTo="${DB}.*" --archive --gzip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup postgresql db from postgresql docker container | |
| docker exec -i ${CONTAINER_NAME} pg_dump -U ${USERNAME} -w ${DB_NAME} -O -x | gzip -9 > $(date +%Y%m%d_%H%M%S)_${DB_NAME}.pgsql.gz | |
| # Restore the postgresql db to postgresql docker container | |
| gunzip -c ${FILENAME}.pgsql.gz | sudo docker exec -i ${CONTAINER_NAME} pg_restore -U ${USERNAME} -w -d ${DB_NAME} -C --clean -Fc -O -x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Enable systemd-networkd debugging | |
| mkdir -p /etc/systemd/system/systemd-networkd.service.d/ | |
| Create Drop-In /etc/systemd/system/systemd-networkd.service.d/10-debug.conf with following content: | |
| [Service] | |
| Environment=SYSTEMD_LOG_LEVEL=debug | |
| And restart systemd-networkd service: | |
| systemctl daemon-reload |
NewerOlder