2017-06-27 02:18:07 +02:00
< div align = "center" >
2017-06-26 23:55:08 +02:00
# Bash-Snippets
2017-06-27 02:29:24 +02:00
2017-07-03 16:00:31 +02:00
< img src = "https://cloud.githubusercontent.com/assets/2059754/24601246/753a7f36-1858-11e7-9d6b-7a0e64fb27f7.png" height = "250px" width = "250px" >
2017-06-27 02:29:24 +02:00
2017-06-27 03:55:38 +02:00
##### A collection of small bash scripts for heavy terminal users with no dependencies
2017-06-27 02:18:07 +02:00
2017-07-04 03:55:22 +02:00
![Version ](https://img.shields.io/github/release/alexanderepstein/Bash-Snippets.svg ) [![Codacy Badge ](https://api.codacy.com/project/badge/Grade/a4bf023a3d0d499abc9d2bf14b296a14 )](https://www.codacy.com/app/alexanderepstein/Bash-Snippets?utm_source=github.com& utm_medium=referral& utm_content=alexanderepstein/Bash-Snippets& utm_campaign=Badge_Grade) ![platform ](https://img.shields.io/badge/platform-OSX%2C%20Linux%20%26%20Windows-blue.svg ) [![license ](https://img.shields.io/github/license/mashape/apistatus.svg?style=plastic )]()
2017-06-27 19:51:31 +02:00
2017-06-28 02:32:43 +02:00
2017-07-04 03:55:22 +02:00
### All of these scripts have been heavily tested on OSX 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.
2017-06-28 02:32:43 +02:00
2017-07-04 17:37:53 +02:00
#### Favorite Tool?
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Weather )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Weather/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Yotube-Viewer )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Yotube-Viewer/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Stocks )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Stocks/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Geo )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Geo/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Currency )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Currency/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Cloudup )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Cloudup/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Crypt )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Crypt/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Movies )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Movies/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Cheat )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Cheat/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Taste )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Taste/vote)
[![ ](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Short )](https://m131jyck4m.execute-api.us-west-2.amazonaws.com/prod/poll/01BM73YVF896YZJ5GQE77VDCMJ/Short/vote)
2017-06-27 02:18:07 +02:00
< / div >
2017-07-04 17:37:53 +02:00
2017-06-27 02:18:07 +02:00
## Weather
2017-06-28 15:41:12 +02:00
Provides a 3 day forecast
2017-07-04 02:35:58 +02:00
With no arguments it will grab the weather for your location as determined by your ip
2017-06-27 02:18:07 +02:00
2017-06-27 02:22:25 +02:00
< div align = "center" >
< img height = "75%" width = "75%" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/weather/weather.png?raw=true" >
< / div >
2017-06-27 02:18:07 +02:00
2017-06-30 08:13:37 +02:00
With arguments you can pass in a city or country and get the weather in that area
Also can show the current moon phase
< div align = "center" >
< img height = "75%" width = "75%" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/weather/moon.png?raw=true" >
< / div >
2017-07-04 02:22:07 +02:00
## Youtube-Viewer
2017-06-30 08:13:37 +02:00
2017-07-04 02:22:07 +02:00
Provides a way to watch youtube videos from the terminal.
You can use ```ytview -c [channel name]``` to see recent videos by that artist.
2017-07-04 02:26:57 +02:00
You can use ```ytview -s [videoToSearch]``` or just ```ytview [videoToSearch]``` to search for videos.
2017-07-04 02:22:07 +02:00
< div align = "center" >
< img height = "75%" width = "75%" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/ytview/ytview.png?raw=true" >
< / div >
2017-06-28 15:41:12 +02:00
2017-06-27 02:18:07 +02:00
## Stocks
Provides information about a certain stock symbol
2017-06-27 02:22:25 +02:00
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/stocks/stocks.png?raw=true" >
< / div >
2017-06-27 02:18:07 +02:00
2017-07-01 06:07:24 +02:00
## Geo
Provides date for wan, lan, router, dns, mac, and ip geolocation
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/geo/geo.png?raw=true" >
< / div >
2017-07-03 03:34:34 +02:00
Written by: < a href = "https://github.com/jakewmeyer" > Jake Meyer
2017-07-01 06:07:24 +02:00
2017-06-27 02:18:07 +02:00
## Currency
Converts currency based on realtime exchange rates
2017-06-27 02:22:25 +02:00
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/currency/currency.png?raw=true" >
< / div >
2017-06-27 02:18:07 +02:00
2017-06-28 15:41:12 +02:00
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```
2017-06-27 03:55:38 +02:00
2017-07-04 15:35:20 +02:00
## Cloudup
A tool that facilitates backing up github repositories to bitbucket
< div align = "center" >
< img height = "75%" width = "75%" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/cloudup/cloudup.png?raw=true" >
< / div >
2017-06-27 03:03:40 +02:00
2017-07-04 17:37:53 +02:00
## Crypt
2017-06-27 03:03:40 +02:00
A wrapper for openssl that allows for quickly encrypting and decrypting files
2017-06-27 19:55:20 +02:00
```bash
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
* Data is encrypted in Base64, so it can be used as plain text in an email. (Not usually necessary if attached as a file)
2017-06-28 06:34:33 +02:00
**Tested With** .pdf, .txt, .docx, .doc, .png, .jpeg
2017-06-27 19:55:20 +02:00
2017-06-28 06:34:33 +02:00
**CAUTION** Make sure to use different filenames, otherwise your file will be overwritten!
2017-06-27 19:55:20 +02:00
2017-06-27 03:03:40 +02:00
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/crypt/crypt.png?raw=true" >
< / div >
2017-06-27 04:41:41 +02:00
## Movies
Quick search that grabs relevant information about a movie
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/movies/movies.png?raw=true" >
< / div >
2017-06-27 02:18:07 +02:00
2017-07-03 03:34:34 +02:00
## Cheat
The fastest way to find {command options|code pieces} you need
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/cheat/cheat.png?raw=true" >
< / div >
2017-06-30 07:41:59 +02:00
## Taste
Recommendation engine that provides three similar items like the supplied item
2017-06-30 07:52:25 +02:00
2017-06-30 07:41:59 +02:00
Also can provide information on a given item
2017-06-30 07:52:25 +02:00
Valid items are: shows, books, music, artists, movies, authors, games
2017-06-30 07:41:59 +02:00
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/taste/taste.png?raw=true" >
< / div >
### Needs an API Key
* To get an API key visit https://tastedive.com/account/api_access
* After getting the API key run the following command: export TASTE_API_KEY="yourAPIKeyGoesHere"
2017-06-30 15:02:58 +02:00
* If issues occur first try setting the API key without quotations marks
2017-06-30 07:41:59 +02:00
2017-06-30 17:18:49 +02:00
## Short
Gets the link that is being masked by a url shortner
< div align = "center" >
< img max-height = "500px" max-width = "500px" src = "https://github.com/alexanderepstein/Bash-Snippets/blob/master/short/short.png?raw=true" >
< / div >
2017-06-30 07:41:59 +02:00
2017-06-27 02:18:07 +02:00
## API's Used
2017-06-28 20:02:17 +02:00
* To get location based on ip address: < a href = "https://ipinfo.io" > ipinfo.io</ a >
* To get and print weather based on a location: < a href = "http://wttr.in" > wttr.in</ a >
2017-06-27 02:33:49 +02:00
* To grab the stock information in JSON format: < a href = "https://www.alphavantage.co" > alphavantage.co</ a >
2017-07-03 03:34:34 +02:00
* To grab the latest exchange rate between currencies: < a href = "http://fixer.io" > fixer.io</ a >
2017-06-27 04:44:17 +02:00
* To grab information on movies: < a href = "http://www.omdbapi.com/" > omdbapi.com</ a >
2017-06-30 07:41:59 +02:00
* To grab recommendations based on an item: < a href = "https://tastedive.com" > tastedive.com</ a >
2017-06-30 17:18:49 +02:00
* To determine masked link behind url shortner: < a href = "http://x.datasig.io" > x.datasig.io</ a >
2017-07-03 03:34:34 +02:00
* To grab cheatsheets for commands and languages: < a href = "http://cheat.sh/" > cheat.sh</ a >
2017-06-27 02:33:49 +02:00
#### Inspired by: <a href="https://github.com/jakewmeyer/Ruby-Scripts">Ruby-Scripts</a>
2017-06-27 02:18:07 +02:00
2017-06-27 03:20:38 +02:00
## Installing
* First clone the repository: ```git clone https://github.com/alexanderepstein/Bash-Snippets```
* Then cd into the cloned directory: ```cd Bash-Snippets```
2017-07-04 15:35:20 +02:00
* Git checkout to the latest stable release ```git checkout v1.9.0```
2017-06-28 04:48:23 +02:00
2017-06-28 03:47:23 +02:00
* Run the guided install script with
2017-06-27 03:20:38 +02:00
```bash
./install.sh
```
2017-06-28 03:47:23 +02:00
this will let you choose which scripts to install
2017-06-27 03:20:38 +02:00
2017-06-28 04:24:43 +02:00
* Install all the scripts
```bash
./install.sh all
```
* Install an individual script
```bash
./install.sh stocks
```
2017-06-28 04:48:23 +02:00
## Updating
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.
```bash
stocks update
```
or
```bash
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.
2017-06-27 03:20:38 +02:00
## Uninstalling
* 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 uninstall all scripts
```bash
./uninstall.sh
```
#### To uninstall individual scripts
Ex. Weather
```bash
cd weather
./uninstall.sh
```
2017-06-27 02:18:07 +02:00
## Donate
If this project helped you in any way and you feel like buying a broke college kid a cup of coffee
[![Donate ](https://img.shields.io/badge/Donate-Venmo-blue.svg )](https://venmo.com/AlexanderEpstein)
[![Donate ](https://img.shields.io/badge/Donate-SquareCash-green.svg )](https://cash.me/$AlexEpstein)
## 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.