Skip to content

rt75272/Bash

Repository files navigation

BASH

Bash tools and stuff  


Prereq

Install Linux Debain 12

$ sudo apt -y isntall screenfetch
$ screenfetch

screenfetch output
screenfetch


Grep for multiple phrases

$ ls | grep 'phrase1\|phrase2' 

Bash encryption tool

$ sudo apt -y install mcrypt
$ nano test_file.txt #create test file

GNU nano  test_mcrypt.txt

encrypt this file with mcrypt

testing...

42
 42
  42
   42
  42
 42
42
$ nano key.txt #create key

GNU nano  key.txt

greatPassword42!
$ mcrypt test_mcrypt.txt --keyfile key.txt # encrypt file 
$ rm test_mcrypt.txt # remove original
$ ls
key.txt  README.md  test_mcrypt.txt.nc
$ mcrypt --decrypt text_mcrypt.txt.nc --keyfile key.txt
$ ls
key.txt  README.md  test_mcrypt.txt.nc  test_mcrypt.txt  

  Require a password/key to view decrypted file

$ mcrypt encrypted_file.txt; rm encrypted_file.txt # only the encrypted file remains
Enter passphrase:
$ mcrypt -d encrypted_file.txt.nc
Enter passphrase: 
File encrypted_file.txt was encrypted.

Now you can encrypt all of your files so no one view them without the key/passphrase


Look pro

$ sudo apt -y install hollywood
$ hollywood

Hollywood Screenshot Hollywood


Internet speed test CLI

After cloning this bash repo...

$ sudo apt -y install speedtest-cli
$ speedtest

Speedtest Output


Running Bash via Python

prereq

$ sudo apt -y install cmatrix

bash.py

import os

bash_command = os.popen('konsole --fullscreen -e cmatrix')
output = bash_command.read()
print(output)
$ python bash.py

bash.py outputs cmatrix bash.py output


Send command via SSH to Raspberry Pi

$ ssh pi@localhost 'ls -l'

Running dog

Have a dog running accross your screen

$ sudo apt -y install oneko
$ oneko -dog -fg cyan

oneko dog


Cow delivered fortune

$ sudo apt -y install fortune 
$ sudo apt -y install cowsay
$ fortune | cowsay

Fortune Cow


Generate random addresses

$ sudo apy -y install rig
$ rig

Random Address


Wikipedia Data

Could be useful for gathering semi-random data for data science/machine learning programs
 
Prereq

$ sudo apt -y install nodejs

Wiki package install

$ sudo apt -y install wikit -g

Run a wiki query

$ wikit "machine learning"

wikit machine learning output
wikit machine learning


Battery Status

$ sudo apt -y install acpi
$ acpi -b
Battery 0: Discharging, 16%, 00:27:07 remaining

Fuzzy Finder Search

$ sudo apt -y install fzf
$ fzf

fuzzy search tool  
Searching for mcrypt encrypted files within this bash repo using fzf


Terminal Search

$ conda install googler

Terminal Train

$ sudo apt -y install sl 

Sl Train