BASH-SNIPPETS(1)

๐Ÿ“ฆ version 1.23.0, in nixos 26.05, nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

okay so bestie, first things first: this page is bash-snippets(1) โ€” a collection of small bash scripts for heavy terminal users. that's it, that's the whole vibe. a whole lil squad of tiny bash scripts for people who basically live in their terminal ๐Ÿซถ

like, if you're the kind of person whose tmux has tabs, this is your page. slay. let's go โœจ


๐ŸŽ€ TOOLS ๐ŸŽ€

๐Ÿง  Cheat

Description: cheatsheets for quick information about multiple programming languages, plus terminal commands. it's giving "I forgot the syntax but I refuse to open a browser" ๐Ÿ’…

Usage: cheat [flags] [command] or cheat [flags] [programming language] [subject]

  • -s โ€” does a search for the last argument rather than looking for an exact match ๐Ÿ”
  • -i โ€” case insensitive search (we love a forgiving queen)
  • -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 โ€” lists all cheatsheets related to the previous arg; if there's none, it lists all cheatsheets
  • learn โ€” shows a learn-x-in-minutes language cheat sheet, perfect for getting started with the language (literally the icon of "just start" ๐Ÿ‘‘)
  • 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

โ˜๏ธ Cloudup

Description: backs up a user's 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 (you must have private repo ability on bitbucket for this one, no cap)
  • -a โ€” backup all github repositories
  • -s โ€” only backup repositories that you have created (no forks) โ€” heads up, this only works in conjunction with the -a flag
  • -t โ€” backup the repository with a timestamp added to the repostiory name (this 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

๐Ÿ” Crypt

Description: a wrapper around openssl that facilitates encrypting and decrypting files. keeping your secrets secret, periodt ๐Ÿคซ

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 the filetype so the default program is incorrect ๐Ÿ‘€)
  • crypt -d myEncryptedFile.jpg thisIsNowDecrypted.txt (change the filetype back so now the default program is correct โœจ)

๐Ÿช™ CryptoCurrency

Description: a realtime cryptocurrency converter. with no flags it will pull down the latest stats of the top 10 cryptos. main character energy for your portfolio ๐Ÿ“ˆ

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

๐Ÿ’ฑ Currency

Description: a realtime currency converter. with no flags it will guide you through the currency exchange, hand-holding included ๐Ÿซถ

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

all 32 of them, iconically:

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

๐ŸŒ Geo

Description: provides quick access for wan, lan, router, dns, mac, and ip geolocation data. it knows where you are. always. ๐Ÿ™ˆ

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 a specific ip in -s
  • -v โ€” returns version
  • -h โ€” returns help screen
  • -u โ€” updates Bash-Snippets

๐ŸŽค Lyrics

Description: fetch lyrics for a certain song. karaoke night but make it terminal ๐ŸŽถ

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

๐Ÿ˜น Meme

Description: a lightning fast meme generator. lightning. fast. โšก

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

  • meme -f dogeMeme

๐ŸŽฌ Movies

Description: provides relevant information about a certain movie. letterboxd could never ๐Ÿฟ

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

๐ŸŽ Newton

Description: performs numerical calculations all the way up to symbolic math parsing. math girlies rise ๐Ÿงฎโœจ

Usage: newton [operation] [expression] or newton [flag]

  • -u โ€” update Bash-Snippet Tools
  • -h โ€” show the help
  • -v โ€” get the tool version

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 [[2x]+7]*[4x]
  • movies derive x+2x
not me pointing out that the second example literally says movies ๐Ÿ’€ that's what the page says, bestie, I don't make the rules.

๐Ÿ•ต๏ธ Pwned

Usage: pwned [email]

Description: checks where an email account has been breached. it's giving "your data is out there and we're gonna tell you where" ๐Ÿ˜ญ

  • -u โ€” update Bash-Snippet Tools
  • -h โ€” show the help
  • -v โ€” get the tool version

๐ŸŒธ Examples

  • pwned emailtocheck@email.com

๐Ÿ”ณ Qrify

Usage: qrify [stringtoturnintoqrcode]

Description: converts strings or urls into a qr code. little squares, big power ๐ŸŽ€

  • -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

๐Ÿ”— Short

Description: unmasks shortended urls. detective mode: activated ๐Ÿ”๐Ÿ’…

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


๐Ÿ”’ Siteciphers

Description: checks the available ciphers for the SSL of an https site. cipher check, but make it cute ๐Ÿฆ‹

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

๐Ÿ“Š Stocks

Description: finds the latest information on a certain stock. finance bestie reporting for duty ๐Ÿ“ˆ๐Ÿ‘‘

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

๐ŸŽจ Taste

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

โœ… Todo

Description: a simplistic commandline todo list. productivity era ๐ŸŽ€โœจ

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

๐Ÿ“ค Transfer

Description: quickly transfer files from the command line. drop it and go ๐Ÿ’จ

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

๐ŸŒฆ๏ธ Weather

Description: provides a 3 day forecast on your current location or a specified location. with no flags, Weather will default to your current location. checking the vibes, meteorologically ๐ŸŒˆ

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

okay that's this batch of tools bestie โ€” and there's literally more where that came from, so keep reading ๐Ÿ‘‘

Okay so, examples โ€” because seeing it in action is literally the whole vibe check:

  • weather
  • weather Paris m
  • weather Tokyo
  • weather Moon
  • weather mM

๐ŸŒˆ Ytview

Description: Search and play youtube videos right from the terminal. Yes bestie, your terminal is a media player now, we love a multitasking icon. ๐Ÿ’…

Usage: ytview [flag] [string] or ytview [videoToSearch]

  • -s โ€” searches youtube for you ๐Ÿ”
  • -c โ€” shows the latest videos of a channel, so you can stalk your faves (respectfully) ๐Ÿ‘€
  • -u โ€” Update Bash-Snippet Tools
  • -h โ€” Show the help
  • -v โ€” Get the tool version

Examples:

  • ytview -s Family Guy Chicken Fight
  • ytview -c Numberphile

๐Ÿ”„ Updating

Okay so here's the cute part: 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. Two ways to do the exact same slay:

  • stocks update

or

  • stocks -u

This will clone the repository and install the new versions of scripts that were installed. And here's the important bit โ€” if you didnยดt install a certain tool, this script will not install the new version of that tool. So no surprise guests in your $PATH, periodt. โœจ


๐Ÿงน Uninstalling

If you donยดt have the Bash-Snippets folder anymore, clone the repository first:

git clone https://github.com/alexanderepstein/Bash-Snippets`

Then cd into the Bash-Snippets directory:

cd Bash-Snippets

Then, to go through a guided uninstall:

  • ./uninstall.sh

It walks you through it, so you're not out here guessing. We love a guided moment. ๐Ÿซถ


๐Ÿ‘‘ AUTHOR

Alexander Epstein Github: https://github.com/alexanderepstein

๐Ÿ’œ Contributors

๐Ÿ“œ 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.


Fr fr, that's a wrap โ€” this whole page comes from the Bash-Snippets source, version ff, dated December 2017, in the BASH-SNIPPETS(1) manual. Go forth and be iconic with it ๐Ÿฆ‹๐Ÿ’–
๐Ÿ“ฆ where this page comes from