Repository: alexanderepstein/Bash-Snippets Branch: master Commit: 581a6b4ea681 Files: 66 Total size: 376.9 KB Directory structure: gitextract_7784tk_y/ ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE.md │ ├── PULL_REQUEST_TEMPLATE.md │ ├── stale.yml │ └── workflows/ │ └── shellcheck.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bak2dvd/ │ └── bak2dvd ├── bash-snippets/ │ └── bash-snippets ├── bash-snippets.1 ├── bash-snippets.1.html ├── bash-snippets.1.ronn ├── changelog.md ├── cheat/ │ └── cheat ├── cloudup/ │ └── cloudup ├── crypt/ │ └── crypt ├── cryptocurrency/ │ └── cryptocurrency ├── currency/ │ └── currency ├── extras/ │ ├── Linux/ │ │ └── maps/ │ │ └── maps │ └── README.md ├── geo/ │ └── geo ├── gist/ │ ├── README.md │ └── gist ├── install.sh ├── lyrics/ │ └── lyrics ├── meme/ │ └── meme ├── movies/ │ ├── movies │ └── tmdb ├── newton/ │ └── newton ├── pwned/ │ └── pwned ├── qrify/ │ └── qrify ├── short/ │ └── short ├── siteciphers/ │ └── siteciphers ├── skeleton ├── skeleton.bats ├── stocks/ │ └── stocks ├── taste/ │ └── taste ├── tests/ │ ├── bak2dvd.bats │ ├── cheat.bats │ ├── cloudup.bats │ ├── crypt.bats │ ├── cryptocurrency.bats │ ├── currency.bats │ ├── geo.bats │ ├── gist.bats │ ├── meme.bats │ ├── movies.bats │ ├── newton.bats │ ├── qrify.bats │ ├── short.bats │ ├── siteciphers.bats │ ├── stocks.bats │ ├── taste.bats │ ├── todo.bats │ ├── transfer.bats │ ├── weather.bats │ └── ytview.bats ├── todo/ │ └── todo ├── transfer/ │ └── transfer ├── uninstall.sh ├── weather/ │ └── weather └── ytview/ └── ytview ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: [alexanderepstein] ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ **Issue Label:** * [ ] Bug * [ ] New feature * [ ] Enhancement * [ ] New component **Description:** ### If its a bug make sure to include this section. **OS and OS version:** * [ ] Mac * [ ] Linux 32 Bit * [ ] Linux 64 Bit * [ ] Windows 32 Bit * [ ] Windows 64 Bit OS Version: ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ **Pull Request Label:** * [ ] Bug * [ ] New feature * [ ] Enhancement * [ ] New component * [ ] Typo **Pull Request Checklist:** - [ ] Have you followed the [guidelines for contributing](https://github.com/alexanderepstein/Bash-Snippets/blob/master/CONTRIBUTING.md)? - [ ] Have you checked that there aren't other open [pull requests](https://github.com/alexanderepstein/Bash-Snippets/pulls) for the same fix or component? - [ ] Have you ran the tests locally with `bats tests`? ----- ================================================ FILE: .github/stale.yml ================================================ # Number of days of inactivity before an issue becomes stale daysUntilStale: 175 # Number of days of inactivity before a stale issue is closed daysUntilClose: 5 # Issues with these labels will never be considered stale exemptLabels: - New Component # Label to use when marking an issue as stale staleLabel: Stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable closeComment: > This issue has been automatically closed because it has been inactive for 180 days. ================================================ FILE: .github/workflows/shellcheck.yml ================================================ on: push jobs: shellcheck: name: Shellcheck runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run ShellCheck uses: ludeeus/action-shellcheck@master ================================================ FILE: .gitignore ================================================ # IDE .idea # Meta files .DS_Store Thumbs.db ================================================ FILE: .travis.yml ================================================ language: bash matrix: include: - os: linux dist: trusty sudo: required - os: osx allow_failures: - os: linux before_install: - sudo ./install.sh all - export TASTE_API_KEY='290044-Taste-QIQUQKOZ' install: - if [ $TRAVIS_OS_NAME = linux ]; then sudo add-apt-repository ppa:duggan/bats --yes; fi - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get update; fi - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install -qq bats; else brew install bats; fi - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install -qq openssl; else brew install openssl; fi script: - bats tests ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at epsteina@wit.edu. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing ### First off, thank you for considering contributing to Bash-Snippets. #### Where do I go from here? If you've noticed a bug or have a question, search the issue tracker to see if someone else in the community has already created a ticket. If not, go ahead and make one! #### Otherwise if implementing a fix, feature or new component go through these steps #### 1. Fork & Clone The Repository * Fork the repository * It is assumed you are on either a Unix or Linux system in which are there are no dependencies * To download the full source code after forking ```bash git clone https://github.com/yourusernamehere/Bash-Snippets ``` #### 2. Implement your fix, feature or new component ###### Fix/Feature At this point, you're ready to make your changes! ###### New Component * Decide on a short but sweet name for your tool * Create a folder in the Bash-Snippets root directory named after the tool * Copy over the Bash-Snippets tool [skeleton](https://github.com/alexanderepstein/Bash-Snippets/blob/master/skeleton) to the newly created folder * Rename the skeleton in the new directory to the name of the tool * Using newly copied over file as a basis (with the name of your tool) code your new component! Feel free to ask for help; everyone is a beginner at first :smile_cat: Make sure to make your commit messages informative and concise. #### 3. Check The Script Runtime If you changed the weather script for example try running it and see if it works as intended. Run ```bats tests``` when inside the Bash-Snippets directory to test the tools. If you added a new script/tool test it to see if it works. #### 4. Create A Pull Request First make sure to commit and push your changes to your forked repository. Check to see if there are any conflicts with the main repository and your fork. If there are none submit the request and give details as to what you changed or added. #### 5. Bask In All The Glory Of Adding To A FOSS Application  ================================================ FILE: 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. ================================================ FILE: README.md ================================================
##### A collection of small bash scripts for heavy terminal users with no dependencies
 [](https://www.codacy.com/app/alexanderepstein/Bash-Snippets?utm_source=github.com&utm_medium=referral&utm_content=alexanderepstein/Bash-Snippets&utm_campaign=Badge_Grade) [](https://travis-ci.org/alexanderepstein/Bash-Snippets)  []()
### 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.
#### Looking for maintainers: I have been and probably will forever be too busy to maintain this properly on my own. I am looking for a few others to help out, if you want to be a maintainer either email me or raise an issue. I will probably only accept maintainers who have made a few contributions (no matter how small) and seem to understand the vision of this project.
bash-snippets - A collection of small bash scripts for heavy terminal users
Description: Cheatsheets for quick information about multiple programming languages along with terminal commands
Usage: cheat [flags] [command] or cheat [flags] [programming language] [subject]
-s Does a search for last argument rather than looking for exact match
-i Case insensitive search
-b Word boundaries in search
-r Recursive search
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Special Pages:
hello Describes building the hello world program written in the language
list This lists all cheatsheets related to previous arg if none it lists all cheatsheets
learn Shows a learn-x-in-minutes language cheat sheet perfect for getting started with the language
1line A collection of one-liners in this language
weirdness A collection of examples of weird things in this language
Examples:
cheat rust hello
cheat -r -b -i go
cheat julia Functions
cheat -i go operators
Description: Backs up a users github repositories to your bitbucket account. With no flags cloudup will guide you through backing up a single repository
Usage: cloudup [flags] or cloudup [flags] [listOfGHRepoNamesSplitBySpaces]
-p Upload the repositor(y)(ies) as private to bitbucket (must have private repo ability on bitbucket)
-a Backup all github repositories
-s Only backup repositories that you have created (no forks) (only works in conjunction with the -a flag)
-t Backup the repository with a timestamp added to the repostiory name (will always create a new unique bitbucket repo)
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
cloudup
cloudup -p -a
cloudup -p nameOfRepo1 nameOf Repo2
cloudup nameOfRep
Description: A wrapper around openssl that facilitates encrypting and decrypting files.
Usage: crypt [flag] [inputFile] [outputFile]
-e Encrypt the inputFile and store it in the outputFil
-d Decrypt the inputFile and store it in the outputFil
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
crypt -e mySecretFile.txt myEncryptedFile.jpg (change filetype so default program is incorrect)
crypt -d myEncryptedFile.jpg thisIsNowDecrypted.txt (change filetype back so now default program is correct)
Description: A realtime cryptocurrency converter. With no flags it will pull down the latest stats of the top 10 cryptos
Usage: cryptocurrency or cryptocurrency [flag] or cryptocurrency [flag] [arg]
-o Utilize the old functionality of the tool
-f Fiat currency for conversions
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples: cryptocurrency -o cryptocurrency -f eur
Description: A realtime currency converter. With no flags it will guide you through the currency exchange
Usage: currency or currency [flag] or currency [base] [exchangeTo] [amount]
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Supported Currencies:
| AUD | BGN | BRL | CAD | | CHF | CNY | CZK | DKK | | EUR | GBP | HKD | HRK | | HUF | IDR | ILS | INR | | JPY | KRW | MXN | MYR | | NOK | NZD | PHP | PLN | | RON | RUB | SEK | SGD | | THB | TRY | USD | ZAR |
Examples:
currency EUR USD 12.35
currency
Description: Provides quick access for wan, lan, router, dns, mac, and ip geolocation data
Usage: geo [flag]
-w Returns WAN IP
-l Returns LAN IP(s)
-r Returns Router IP
-d Returns DNS Nameserver
-m Returns MAC address for interface. Ex. eth0
-g Returns Current IP Geodata
Examples:
geo -g
geo -wlrdgm eth0
Custom Geo Output => [all] [query] [city] [region] [country] [zip] [isp]
Example: geo -a 8.8.8.8 -o city,zip,isp
-o [options] Returns Specific Geodata
-a [address] For specific ip in -s
-v Returns Version
-h Returns Help Screen
-u Updates Bash-Snippets
Description: Manage your gists with git and Github API v3
Usage: gist [command] [args]
[star|all] List your gists, use 'star' as argument for your starred gists, 'all' or 'a' for both your and starred gists. Format for each line is: INDEX URL FILE_NUM COMMENT_NUM DESCRIPTION
fetch Update the local list of your gists, 'star' as argument for your starred gists
INDEX Show the path of local gist repo and do custom actions
new Create a new gist with files or STDIN
grep Grep gists by description, filename and content with a given pattern
tag Modify/List tags for a gist
tags List all tags and pinned tags
pin, Pin/Unpin tags, or filter gists with pinned tags
lan Filter gists or list gist with coding languages
detail Show the detail of a gist
edit Edit description for a gist
delete Delete gists by given indices
push Push changes by git
clean Clean local repos of removed gists
config Do configuration
user Get list of gists with a given Github user
github Import selected gist as a new Github repo
help Show the helper message
Example:
gist (Show your gists)
gist tag (Show your gists with tags)
gist fetch (update the list of gists from github.com)
gist 3 (show the repo path of your 3rd gist, and do custom actions)
gist 3 --no-action (show the repo path of your 3rd gist, and do not perform actions)
gist new --desc bar foo (create a new gist with files and description)
Description: Fetch lyrics for a certain song.
Usage: lyrics [flags] or tool [-a] [arg] [-s] [arg]
-a Artist of the song to fetch lyrics for
-s Song of the artist to fetch lyrics for
-f Export the lyrics to file rather than outputting to stdout
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
lyrics -a logic -s run it
lyrics -a logic -s run it -f ~/runItLyrics.txt
Description: A lightning fast meme generator
Usage: tool [flags] or tool [flags] [arguments]
-u Update Bash-Snippet Tools
-h Show the help
-f Choose the output filename
-v Get the tool version
Examples:
Description: Provides relevant information about a certain movie.
Usage: movies [flag] or movies [movieToSearch]
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
-d Show detailed information
Examples:
movies Argo
movies Inception
Description: Performs numerical calculations all the way up to symbolic math parsing.
Usage: newton [operation] [expression] or newton [flag]
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
| Operations Sample Expression Sample Result |
|---|
| Simplify [[2x2]+7]*[4x2] 8 x4 + 28 x2 |
| Factor x2 + 2x x (x + 2) |
| Derive x2+2x 2 x + 2 |
| Integrate x2+2x 1/3 x3 + x2 +C |
| Roots/Zeroes x2+2x 2, 0 |
| Tangent 2~x3 12 x + -16 | (Finding tangent line when x=2 for expression x3) |
| Area 2:4~x3 60 | (Finding area under curve from 2 to 4 for expression x3) |
| Cos pi -1 |
| Sin pi 0 |
| Tan pi/4 1 |
| ArcCos 1 0 |
| ArcSin 0 0 |
| ArcTan pi arcsin(pi) |
| Abs -2 2 |
| Log 2~8 3 | (Log base 2 of eight) |
Valid Symbols: + add - subtract [ left parenthesis (you must use brackets bash has a bultin for parenthesis) ] right parenthesis (you must use brackets bash has a bultin for parenthesis) * multiply / divide ^ power : between the range of left and right side (only for area under curve) ~ parameter on right side (only for area, tangent line and log)
Examples:
newton simplify [[2x2]+7]*[4x2]
movies derive x2+2x
Usage: pwned [email]
Description: Checks where an email account has been breached
* -u Update Bash-Snippet Tools
* -h Show the help
* -v Get the tool version
Examples:
* pwned emailtocheck@email.com
Usage: qrify [stringtoturnintoqrcode]
Description: Converts strings or urls into a qr code.
* -u Update Bash-Snippet Tools
* -m Enable multiline support
* -f Save the QRCode to a file
* -d Decode the QR code from a PNG/GIF/JP(E)G file
* -h Show the help
* -v Get the tool version
Examples:
* qrify this is a test string
* qrify -m two \n lines
* qrify -f fileNameHere Insert what you want to encode here
* qrify github.com # notice no http:// or https:// this will fail
* qrify -d fileName.png
Description: Unmasks shortended urls.
Usage: short [shortURL] or short [flag]
-e Expand the following URL
-s Shorten the following URL
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Example:
Input: short -e tinyurl.com/jhkj
Output: http://possiblemaliciouswebsiteornot.com
Input: short -s google.com
Output: http://ki.tc/23sd1d
Description: Checks the available ciphers for the SSL of an https site.
Usage: siteciphers [flag] or siteciphers [optionalDFlag] [website]
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
-d Set the delay between requests sent to the site (default is 1 sec)
Examples:
siteciphers github.com
siteciphers -d 0.75 google.com
Description: Finds the latest information on a certain stock.
Usage: stocks [flag] or stocks [company/ticker]
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
stocks AAPL
stocks Tesla
Description: A recommendation engine that provides 3 similar items based on some input topic. Taste also has the ability to provide information on the item of interest. Supports: shows, books, music, artists, movies, authors, games
Usage: taste [flag] [item]
-i Get more information on similar items
-s Get information on the item itself
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
taste -i Kendrick Lamar
taste Catcher in the Ry
taste -s Red Hot Chili Peppers
Description: A simplistic commandline todo list.
Usage: todo [flags] or todo [flags] [arguments]
-c Clear all the current tasks
-r Remove the following task number
-g Get the current tasks
-a Add the following task
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
todo -a My very first task
todo -r 1
todo -g
todo -c
Description: Quickly transfer files from the command line.
Usage: transfer [flags] or transfer [flag] [args] or transfer [filePathToUpload]
-d Download a single file
* First arg: Output file directory
* Second arg: File url id
* Third arg: File name
-o Onetime file upload
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
transfer ~/fileToTransfer.txt
transfer ~/firstFileToTransfer.txt ~/secondFileToTransfer.txt # upload multiple files at once
transfer -d ~/outputDirectory fileID fileName
transfer -o ~/fileToTransfer.txt
Description: Provides a 3 day forecast on your current location or a specified location. With no flags Weather will default to your current location.
Usage: weather or weather [flag] or weather [country] or weather [city] [state]
weather [optionalLocation] [i][M] get weather in imperial units, optional M means windspeed in m/s
weather [optionalLocation] [m][M] lowercase m gets weather in metric units, optional M means windspeed in m/s
weather [Moon] grabs the phase of the moon
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
weather
weather Paris m
weather Tokyo
weather Moon
weather mM
Description: Search and play youtube videos right from the terminal.
Usage: ytview [flag] [string] or ytview [videoToSearch]
-s Searches youtube
-c Shows the latest videos of a channel
-u Update Bash-Snippet Tools
-h Show the help
-v Get the tool version
Examples:
ytview -s Family Guy Chicken Fight
ytview -c Numberphile
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
or
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.
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
Alexander Epstein Github: https://github.com/alexanderepstein
Jake Meyer Github: https://github.com/jakewmeyer
Linyos Torovoltos Github: https://gitbub.com/linyostorovovoltos
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.