https://github.com/vanvanni/system
System Library - Used for server operations
https://github.com/vanvanni/system
Last synced: about 1 year ago
JSON representation
System Library - Used for server operations
- Host: GitHub
- URL: https://github.com/vanvanni/system
- Owner: vanvanni
- Created: 2024-07-21T13:10:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T23:15:26.000Z (over 1 year ago)
- Last Synced: 2025-02-10T05:13:55.857Z (over 1 year ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# System Repo
My collection of utilities used on servers.
## Bin
Scripts and binaries that can be used in PATH for making life easier.
## Lib
All libaries("modules") that can be used for creating your system utility scripts like backups and etc.
### Script.sh
The base library of each script. Containing several useful functions.
##### load {LIB_NAME}
Loads a library from the lib folder.
```bash
load "use-env"
```
##### is_root
Will check if the executing user is a root user.
```bash
is_root
```
##### rid
Generates a random string with 8 characters on default.
```bash
RANDOM_SIZE=8 # Default in script.sh. Add to script to override
MY_ID=$(rid)
```
##### tz
Spits out the current timestamp based on the `DATE_FORMAT`
```bash
BACKUP_TIME=$(tz)
```
## Scripts
All the scripts are assumed to be living in the root directory of the repository. Therefore you could also fork this repo to add your own scripts. If you want scripts not to be public(added to repo), prefix them with `private-`.