An open API service indexing awesome lists of open source software.

https://github.com/cybersecurity-dev/bash-toolkit

Bash Toolkit: Your Swiss Army Knife for the Command Line
https://github.com/cybersecurity-dev/bash-toolkit

bash bash-profile bash-script bash-scripting bash-scripts bashrc bashrc-configs scripting-language shell-script

Last synced: 8 days ago
JSON representation

Bash Toolkit: Your Swiss Army Knife for the Command Line

Awesome Lists containing this project

README

          






# **[Bash](https://wikipedia.org/wiki/Bash_(Unix_shell)) Toolkit** | _Your Swiss Army Knife for the Command Line_

[![Linux](https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black)](https://github.com/cybersecurity-dev/awesome-bash-scripting-language)
[![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white)](https://youtube.com/playlist?list=PL9V4Zu3RroiVE4xP0WgiRLa_Fiszl83s0&si=bUeRrjG-EsewaOnO)
[![Reddit](https://img.shields.io/badge/Reddit-FF4500?style=for-the-badge&logo=reddit&logoColor=white)](https://www.reddit.com/r/bash/)


GitHub
 
YouTube
 
My Awesome Lists

## Alias List

```bash
alias cat="batcat"
```

* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](#)
```bash
alias cmd_system_update='sudo apt update && sudo apt full-upgrade -y && \
sudo apt autoremove && sudo apt clean && \
sudo apt autoclean && sudo apt autopurge'
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](#)
```bash
alias cmd_system_update='sudo dnf upgrade --refresh -y && \
sudo dnf autoremove -y && sudo dnf clean all'
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](#)
```bash
alias cmd_system_update='sudo zypper refresh && \
sudo zypper dist-upgrade -y --auto-agree-with-licenses && \
sudo zypper ps -s && sudo zypper clean --all && \
sudo zypper remove-orphaned'
```

## [SCP](https://man7.org/linux/man-pages/man1/scp.1.html)/[RSYNC](https://man7.org/linux/man-pages/man1/rsync.1.html)
Remote (and local) file-copying Tools
* DOWNLOAD
```bash
scp -r username@server_ip:/source/path/to/folder /destination/local/path/
```
```bash
rsync -avz username@server_ip:/source/path/to/folder /destination/local/path/
```
* UPLOAD
```bash
scp -r /source/local/path/ username@server_ip:/destination/path/to/folder
```
```bash
rsync -avz /source/local/path/ username@server_ip:/destination/path/to/folder
```
* COPY/SYNC between two Servers
```bash
scp -r username1@server_ip1:/source/path/to/folder/* username2@server_ip2:/destination/path/to/folder/*
```
```bash
rsync -avz username1@server_ip1:/source/path/to/folder/* username2@server_ip2:/destination/path/to/folder/*
```
```bash
rsync -avzh -e ssh --progress \
username1@server_ip1:/source/path/to/folder/* \
username2@server_ip2:/destination/path/to/folder/*
```
Noteworthy `rsync` options include:
* -r: Recurse through directories
* -a: for syncing archives recursively, preserving symbolic links, modification times, groups, owners, and permissions.
* -z: This option is for compressing the files before sending them in order to reduce the bandwidth when copying them.
* -h: human-readable, output numbers in a human-readable format.
* -p: preserve permissions
* -P: same as --partial --progress
* -u: skip files that are newer on the receiver
* -e: specify the remote shell to use
* `--include='*.txt'` # _rsync will include only files with the `.txt` extension from the /source/path/to/folder/* directory during the transfer._
* `--exclude='*.ext'` # _rsync will exclude files with the specified extension `*.ext` from the /source/path/to/folder/* directory during the transfer._

## TMUX List
* List session:
```bash
tmux ls
```
* New session:
```bash
tmux new -s
```
* Attach session:
```bash
tmux a -t
```
* Remove session:
```bash
tmux kill-session -t
```
* Quit session:
```bash
q
```

## Install SSH server

* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](#)
```bash
sudo apt-get install -y openssh-server && sudo systemctl enable ssh --now
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](#)
```bash
sudo dnf install -y openssh-server && sudo systemctl enable sshd --now
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](#)
```bash
sudo zypper install --no-confirm openssh && sudo systemctl enable sshd --now
```

* Add Firewall Rure
```bash
sudo firewall-cmd --permanent --add-service=ssh && sudo firewall-cmd --reload
```

## Verify that ssh service running
```bash
sudo systemctl status ssh
```

## Generate ssh-key
```bash
ssh-keygen -t rsa
```

```console
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Created directory '/home/user/.ssh'.
Enter passphrase (empty for no passphrase):
```
After that you will see public key :
```console
Your public key has been saved in /home/user/.ssh/id_rsa.pub
The key fingerprint is: ...
```
copy fingerprint and paste into:
```bash
vim /home/user_remote/.ssh/authorized_keys
```
or copy and install the public key using `ssh-copy-id` command in Linux

```bash
ssh-copy-id user_remote@user_remote_ip
```

and than you will connect via ssh without password but if you entered passphrase, system will ask you this.

## Install Applications
### Programming Language
#### [![C](https://img.shields.io/badge/C-00599C?logo=c&logoColor=white)](#) [![C++](https://img.shields.io/badge/C++-%2300599C.svg?logo=c%2B%2B&logoColor=white)](#)
* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](https://www.debian.org/)
* LLVM
```bash
sudo apt-get update && sudo apt-get install -y clang && clang version
```
* GCC
```bash
sudo apt-get update && sudo apt-get install -y build-essential && g++ version
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](https://www.fedoraproject.org/)
* LLVM
```bash
sudo dnf upgrade --refresh && sudo dnf install -y clang && clang version
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](https://www.opensuse.org/)
```bash
sudo zypper refresh && sudo zypper install -y clang && clang version
```
#### [![Go](https://img.shields.io/badge/Go-%2300ADD8.svg?&logo=go&logoColor=white)](#)
* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](https://www.debian.org/)
```bash
sudo apt-get update && sudo apt-get install -y golang && go version
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](https://www.fedoraproject.org/)
```bash
sudo dnf upgrade --refresh && sudo dnf install -y go && go version
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](https://www.opensuse.org/)
```bash
sudo zypper refresh && sudo zypper install -y go && go version
```

#### [![Python](https://img.shields.io/badge/Python-3776AB?logo=python&logoColor=fff)](#)
* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](https://www.debian.org/)
```bash
sudo apt-get update && sudo apt-get install -y -y python3 python3-pip python3-devel && pip3 --version && pip3 install --upgrade pip && pip3 --version
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](https://www.fedoraproject.org/)
```bash
sudo dnf upgrade --refresh && sudo dnf install -y python3 python3-pip python3-devel && pip3 --version && pip3 install --upgrade pip && pip3 --version
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](https://www.opensuse.org/)
```bash
sudo zypper refresh && sudo zypper install -y python3 python3-pip python3-devel && pip3 --version
```

#### [![Rust](https://img.shields.io/badge/Rust-%23000000.svg?e&logo=rust&logoColor=white)](#)
* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](https://www.debian.org/)
```bash
sudo apt-get update && sudo apt-get install -y rustc && rustc -V
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](https://www.fedoraproject.org/)
```bash
sudo dnf upgrade --refresh && sudo dnf install -y rustc && rustc -V
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](https://www.opensuse.org/)
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh && rustc -V
```
* Windows Subsystem for Linux
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh && rustc -V
```
#### [![Solidity](https://img.shields.io/badge/Solidity-363636?logo=solidity&logoColor=fff)](https://soliditylang.org/)
* [![Debian](https://img.shields.io/badge/Debian-A81D33?logo=debian&logoColor=fff)](https://www.debian.org/)
```bash
sudo add-apt-repository ppa:ethereum/Ethereum
```
```bash
sudo apt-get update && sudo apt-get install -y solc && solc --version
```
* [![Fedora](https://img.shields.io/badge/Fedora-51A2DA?logo=fedora&logoColor=fff)](https://www.fedoraproject.org/)
```bash
sudo snap install solc && && solc --version
```
* [![openSUSE](https://img.shields.io/badge/openSUSE-73BA25?style=flat&logo=SUSE&logoColor=white)](https://www.opensuse.org/)
```bash
sudo snap install solc && solc --version
```

##

### My Awesome Lists
You can access the my awesome lists [here](https://cyberthreatdefence.com/my_awesome_lists)

### Contributing

[Contributions of any kind welcome, just follow the guidelines](contributing.md)!

### Contributors

[Thanks goes to these contributors](https://github.com/cybersecurity-dev/Bash-Toolkit/graphs/contributors)!

[🔼 Back to top](#bash-toolkit--your-swiss-army-knife-for-the-command-line)