2
0
Fork 0
mirror of https://github.com/alexanderepstein/Bash-Snippets synced 2018-11-08 02:59:35 +01:00
#Bash #Snippets
Find a file
2017-12-20 14:36:28 -05:00
.github Only homebrew and git 2017-08-30 22:52:40 -04:00
bash-snippets-interactive-test Outthentic interactive tests for bash-snippets tools (#89) 2017-07-28 11:05:11 -04:00
cheat Updating to 1.20.0 2017-11-09 09:53:55 -05:00
cloudup Updating to 1.20.0 2017-11-09 09:53:55 -05:00
crypt Updating to 1.20.0 2017-11-09 09:53:55 -05:00
cryptocurrency Updating cryptocurrency to use rate.sx 2017-12-20 14:36:28 -05:00
currency Use unset (#155) 2017-12-15 14:33:53 -05:00
extras Updating to 1.20.0 2017-11-09 09:53:55 -05:00
geo Updating to 1.20.0 2017-11-09 09:53:55 -05:00
lyrics Updating to 1.20.0 2017-11-09 09:53:55 -05:00
meme Updating to 1.20.0 2017-11-09 09:53:55 -05:00
movies Updating to 1.20.0 2017-11-09 09:53:55 -05:00
newton Updating to 1.20.0 2017-11-09 09:53:55 -05:00
pwned Create pwned (#153) 2017-12-12 11:14:55 -05:00
qrify Added the option to decode a QR code (#154) 2017-12-16 09:52:02 -05:00
short Updating to 1.20.0 2017-11-09 09:53:55 -05:00
siteciphers Updating to 1.20.0 2017-11-09 09:53:55 -05:00
stocks Fixing stocks exchange name and picture 2017-11-09 11:59:42 -05:00
taste Updating to 1.20.0 2017-11-09 09:53:55 -05:00
tests Updating cryptocurrency to use rate.sx 2017-12-20 14:36:28 -05:00
todo Updating to 1.20.0 2017-11-09 09:53:55 -05:00
transfer Adding one time file transfer 2017-12-20 14:10:58 -05:00
weather Use unset (#156) 2017-12-15 14:32:03 -05:00
ytview Updating to 1.20.0 2017-11-09 09:53:55 -05:00
.gitignore Add cryptocurrency (#88) 2017-07-27 16:46:23 -04:00
.travis.yml Allowing osx failures for CI 2017-10-14 04:05:21 -04:00
bash-snippets.1 Updating cryptocurrency to use rate.sx 2017-12-20 14:36:28 -05:00
bash-snippets.1.ronn Updating cryptocurrency to use rate.sx 2017-12-20 14:36:28 -05:00
changelog.md Updating to 1.20.0 2017-11-09 09:53:55 -05:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-06-26 22:02:55 -04:00
CONTRIBUTING.md Fixing PR template link 2017-08-09 00:52:57 -04:00
install.sh Added pwned to install and uninstall 2017-12-12 11:19:04 -05:00
LICENSE Initial commit 2017-06-26 17:55:08 -04:00
README.md Updating cryptocurrency to use rate.sx 2017-12-20 14:36:28 -05:00
skeleton Updating to 1.20.0 2017-11-09 09:53:55 -05:00
uninstall.sh Added pwned to install and uninstall 2017-12-12 11:19:04 -05:00

Bash-Snippets

A collection of small bash scripts for heavy terminal users with no dependencies

Version Codacy Badge Build Status platform license

All of these scripts have been heavily tested on macOS and Linux

Most of these scripts have been tested on Windows 10 and the official developer bash instance. Does not work with Cygwin or Mysys2.

Tools

Cheat

The fastest way to find {command options|code pieces} you need

Supports multiple languages and many bash commands

Cloudup

A tool that facilitates backing up github repositories to bitbucket

If you have ever felt the fear of the github unicorn this could be your savior

Furthermore you can backup the repositories of any github user to your bitbucket.

Backup all github repositories of the designated user at once with the -a option. Or run it with no flags and backup individual repositories.

Crypt

A wrapper for openssl that allows for quickly encrypting and decrypting files

crypt -e [original file] [encrypted file] # encrypts files
crypt -d [encrypted file] [output file] # decrypts files

Encryption Details

  • Uses AES 256 level encryption
  • Key is salted before creation
  • Password is never in plain text, and OpenSSL generates key based on password
  • Encrypted data is encoded in Base64, so it can be used as plain text in an email. (Not usually necessary if attached as a file)

Tested With .pdf, .txt, .docx, .doc, .png, .jpeg

CAUTION Make sure to use different filenames, otherwise your file will be overwritten!

Cryptocurrency

Converts Cryptocurrency based on realtime exchange rates of the top 10 cryptos

A valid use case would be:

cryptocurrency -f eur

Originally written by: Jonas-Taha El Sesiy Heavy modifications by: Alex Epstein

Currency

Converts currency based on realtime exchange rates

If you want to bypass to guided input you can pass in 3 arguments and it will run from there ex.currency [baseCurrency] [exchangeToCurrency] [amountBeingExchanged] so a valid use case would be currency USD EUR 12.35

Geo

Provides data for wan, lan, router, dns, mac, and ip geolocation

Written by: Jake Meyer

Lyrics

Grab lyrics for a given song quickly from the command line.

Meme

A lightning fast meme generator.

Movies

Quick search that grabs relevant information about a movie

Newton

Performs numerical calculations all the way up to symbolic math parsing.

Qrify

Takes any string of text and turns it into a qr code

This is useful for sending links or saving a string of commands to your phone

Written by: Linyos Torovoltos

Short

Gets the link that is being masked by a url shortner

Siteciphers

Check which ciphers are enabled / disabled for a given https site.

Sometimes ciphers are deemed vulnerable, so when you are changing configuration, this can be used to confirm that the cipher truly is disabled.

Some browsers (For example old versions of IE) don't support some of the newer ciphers, which would be a good example of when a SysAdmin would need a list of currently supported ciphers so that changes can be made.

Stocks

Provides information about a certain stock symbol

Taste

Recommendation engine that provides three similar items like the supplied item

Also can provide information on a given item

Valid items are: shows, books, music, artists, movies, authors, games

Needs an API Key (don't worry it's free)

  • Get the API key here
  • After getting the API key run the following line export TASTE_API_KEY="yourAPIKeyGoesHere" >> ~/.bash_profile
Todo

A simplistic command line todo list

Transfer

Quickly transfer files from the command line.

Weather

Provides a 3 day forecast

With no arguments it will grab the weather for your location as determined by your ip

With arguments you can pass in a city or country and get the weather in that area

Also can show the current moon phase

Youtube-Viewer

Provides a way to watch youtube videos from the terminal.

You can use ytview -c [channel name] to see recent videos by that artist.

You can use ytview -s [videoToSearch] or just ytview [videoToSearch] to search for videos.

Written by: Linyos Torovoltos

API's Used

All API's
  • To get location based on ip address: ipinfo
  • To get and print weather based on a location: wttr
  • To grab the stock information in JSON format: alphavantage
  • To grab the latest exchange rate between currencies: fixer
  • To grab information on movies: omdbapi
  • To grab recommendations based on an item: tastedive
  • To determine masked link behind url shortner: ki.tc
  • To grab cheatsheets for commands and languages: cheat
  • To encode text into a qr code: qrenco
  • To grab a list of a users repositories: github
  • To upload a repository to bitbucket: bitbucket
  • To get your WAN ip address: ipify
  • To grab the latest exchange rate between cryptocurrencies to standard currencies: coinmarketcap
  • To perform symbolic math and other computations: newton
  • To transfer files: transfer
  • To grab lyrics from a song: lyrics.ovh
  • To generate memes: MemeGen
  • To get a chart of the top 10 cryptocurrencies rate.sx

Installing

For macOS via homebrew / Linux via linuxbrew
brew install bash-snippets # installs all tools
brew install bash-snippets --without-all-tools --with-newton --with-weather # specifying install for individual tools
Git Install
  • First clone the repository:
git clone https://github.com/alexanderepstein/Bash-Snippets
  • Then cd into the cloned directory:
cd Bash-Snippets
  • Git checkout to the latest stable release
git checkout v1.20.0
  • Run the guided install script with
./install.sh

this will let you choose which scripts to install

  • Install all the scripts
./install.sh all
  • Install an individual script
./install.sh stocks

Updating

For macOS if installed via homebrew / Linux if installed via linuxbrew
brew upgrade bash-snippets
Git Update

With any of the installed tools you can automate the update by running it with the -u option or passing in update as the arguments Ex.

stocks update

or

stocks -u

This will clone the repository and install the new versions of scripts that were installed, if you didn't install a certain tool this script will not install the new version of that tool.

Uninstalling

For macOS if installed via homebrew / Linux if installed via linuxbrew
brew uninstall bash-snippets
Git Uninstall
  • If you don't have the Bash-Snippets folder anymore clone the repository:
git clone https://github.com/alexanderepstein/Bash-Snippets
  • cd into the Bash-Snippets directory:
cd Bash-Snippets

To go through a guided uninstall

./uninstall.sh

To uninstall all installed bash-snippets

./uninstall.sh all

Donate

If this project helped you in any way and you feel like supporting me

Donate Donate

BTC: 1PSVVs6EnhdRGhUFb6Dz6EGWKKyHe3xACe
ETH: 0x585c4e1aa22d9Cc92d1a6b3fAe0c4a5274b5a884
LTC: Lf3SDjkck7iqy5TGn3wqzNvf5LL97JNhGk

Inspired by: Ruby-Scripts

License

MIT License

Copyright (c) 2017 Alex Epstein

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.