Skip to content

retifrav/bash-scripts

Repository files navigation

Bash scripts

My Bash scripts.

lorem-ipsum

Lorem ipsum generator. Prints Lorem ipsum text to ./lorem-ipsum.txt specified number of times:

$ ./lorem-ipsum.sh -n 999

download-and-verify-archives

Downloads archives from links provided in a file using cURL and verifies their contents against "blueprints" (text files with contents expected to be inside each archive) using diff:

$ ./download-and-verify-archives.sh -t "ACCESS-TOKEN-HERE"

temporary-file

Based on https://stackoverflow.com/a/66070270/1688203.

Creates a temporary file, performs some checks and sets a trap for deleting it afterwards:

$ ./temporary-file.sh
$ less ./some.log

This is supposed to be used as a part of actual scripts for "batched" logging, when several process might be writing to the same log file, so you'd need to ensure that their logs rows are not mixed together.

copy-files-with-rclone

Copies files with rclone from a remote server on cron schedule:

$ mkdir ~/scripts ~/logs

$ crontab -e
20 * * * * ~/scripts/copy-files-with-rclone.sh >> ~/logs/copy-files-with-rclone.log 2>&1

Don't forget to remove --dry-run from copy commands.

generate-dependencies-list-from-vcpkg

Generates a text file with a lazy list of dependencies collected from listings in vcpkg_installed/vcpkg/info/ folder:

ls -L1 /path/to/some/project/build/vcpkg_installed/vcpkg/info/ | head -5
assimp_5.3.1_myvr-arm64-osx.list
brotli_1.1.0_myvr-arm64-osx.list
catch2_3.5.3_myvr-arm64-osx.list
clara_1.1.5_myvr-arm64-osx.list
cpp-base64_2.0.8_myvr-arm64-osx.list

$ ./generate-dependencies-list-from-vcpkg.sh -p /path/to/some/project/build/vcpkg_installed/vcpkg/info/

$ head -5 ./3rd-party.txt
assimp_5.3.1
brotli_1.1.0
catch2_3.5.3
clara_1.1.5
cpp-base64_2.0.8

About

My Bash scripts

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages