Giter VIP home page Giter VIP logo

bash-scripts's Introduction

Bash scripts

License

Scripts marked with a ๐ŸŒŸ are ones I use a lot or am particularly proud of.

Image manipulation

  • ๐ŸŒŸ imagedate.sh: Rewrite file and metadata dates on images to increment in the order of the alphabetized filenames. Useful when you have a system (Snapfish) that will only order by date, but you want images ordered by filename.
  • minpic.sh: Minify JPEG and PNG images, losslessly, for the web. Really just a more convenient wrapper for Trimage.
  • ๐ŸŒŸ modimg.sh: Create optimized image formats for the web. Generate WebP, AVIF, and JXL images for browsers that support them, then optimize the fallback JPEG, PNG and GIF images. See the file for additional options and details.
  • webpjpg.sh: Convert webp images to lossless PNG first, then to JPEG.
  • ๐ŸŒŸ pdf2jpg.sh: Convert each page of a PDF to JPEG images, each with the same name as the PDF and the page number appended. Page range, image resolution and quality are configurable. Defaults to progressive JPEGs optimized for the web.

Video manipulation

  • avimp4.sh: Convert AVI videos to MP4 format. More thorough than ffmpeg's default process, resulting in both smaller and better-quality videos.
  • ๐ŸŒŸ convertvid.sh: Convert any video files readable by ffmpeg (including but not limited to MP4, MPG, M4V, MOV, WEBM, WMV, AVI, 3GP) into modern H265-encoded MP4 file. This will generally be smaller in file size and more widely playable than other video formats.
  • copyvid.sh: Quick conversion of any file format to MP4.
  • fadevid.sh: Add a fade-in and fade-out, both visually (from/to black) and audially (from/to silence) to a video clip.
  • joinvid.sh: Combine videos.
  • markvid.sh: Add a watermark image to a video.
  • minvid.sh: Minify a video by re-encoding it and stripping metadata.
  • minsmvid.sh: Reduce video size even more than minvid, with second argument for bitrate.
  • stripvid.sh: Strip metadata from a video.
  • trimvid.sh: Trim MP4 videos with a starting timecode and a duration or stop timecode.
  • ๐ŸŒŸ vidcap.sh: Create screencaps of a video, that is, individual images from different time codes of the video. (Not to be confused with video captioning.)

Boilerplate code

A collection of patterns and snippets I use when writing scripts, many derived from William E. Shotts, Jr. See boilerplate for an overview.

Test files

See test for sample files and sources.

Usage

Download the script files you want. You might need to run chmod +x *.sh to make them executable.

You can use them only in the folder in which they reside, or you can make them system-wide. To do the latter, move them to ~/bin. Then, if you're not doing so already, export this directory to your PATH in .bash_profile, .bashrc, .zshrc, etc.:

export PATH="$HOME/bin:$PATH"

If you wish, you can also add aliases for them, saving three whole characters!

alias minvid="minvid.sh"

Dependencies

All scripts note any dependencies required.

I have tested these on Linux (Linux Mint, based on Ubuntu/Debian) using the Z Shell, but they should run in any Bash-compatible environment.

Linting

All scripts have shellcheck run on them with every save and are auto-formatted with shfmt using the Sublime Text plugin.

Other resources

You may also be interested in my local dotfiles (Linux), which also has flavors in Mac and Windows, as well as a hosted (Linux) setup.

License

GNU Affero General Public License v3.0 or later (AGPL 3+). See LICENSE.

bash-scripts's People

Contributors

rootwork avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.