GithubHelp home page GithubHelp logo

manu-mannattil / scripts Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 130 KB

Little scripts that I use from time to time

License: The Unlicense

sed 2.08% Shell 74.66% Python 19.63% Awk 3.63%
scripts-collection scripts

scripts's Introduction

scripts

"I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand." -- Douglas Adams, Last Chance to See

An assorted collection of little scripts that I use from time to time. I've tried to make the shell scripts as POSIX compatible as possible, but some require Bash and/or GNU Coreutils. Also, most scripts are standalone scripts that require only a few external dependencies (with almost all of them available in the Debian repositories).

Highlights

  • goop is a filename "detoxing" script named after the company of the same name. The basic usage is goop <file>.... The purpose of goop is to safely remove spaces and other special characters from the filenames of the supplied files and restrict each filename to the character set [a-zA-Z0-9._-].

  • com is an NIH Python implementation of Tom Duff's program of the same name, with some changes in function. com scans the supplied files line by line and looks for comment lines beginning with the keyword "com:" and executes the rest of the line as a shell command, e.g., consider hello.c:

    /* com: \{ cc {} -o {.} ; \} && {.}
     */
    
    /* contents of hello.c */
    

    On running com hello.c, com will replace {} and {.} with "hello.c" and "hello". This way, hello.c can be compiled (and executed) without writing a makefile.

  • lyrics is a lyrics fetcher script that fetches song lyrics (from AZLyrics at the moment) according to the supplied keywords. Typos in the keywords are usually handled without a problem. Example usage:

    lyrics rebecca black friday
    lyrics rebeca blcak thursday
    
    # Fetch lyrics of current song in the player, e.g., DeaDBeeF.
    lyrics $(deadbeef --nowplaying '%a %t' 2>/dev/null)
    
  • brep and ffind are "intelligent" wrappers around GNU's version of grep and find that takes care of 90% of their use cases for me.

  • huecat is an NIH lolcat implementation in Python that will concatenate files (just like cat) and garishly print the contents on the stdout (assumed to be attached to a 256-color terminal). Huecat is so rainbow rhythms! Example usage:

    fortune | cowsay | huecat
    man vi | huecat -f | less
    
  • fullfeed converts partial RSS feeds (i.e., feeds that force you to click and link to read the full post) into full feeds.

  • PDF manipulation scripts based on PDFtk and Ghostscript: pdfcompress compresses PDF files using Ghostscript; pdfmetaedit is a script that will let you edit the metadata (e.g., "author" and "title" fields) of a PDF file using $EDITOR; pdfmetastrip strips (most) metadata from a PDF file; pdfsed is a script that lets you edit PDF files using sed.

  • plmgr is a media player agnostic M3U playlist manager. Its only purpose is to add/delete the currently playing track to/from a playlist file.

  • SubRip (SRT) subtitle manipulation scripts: srtextract can be used to extract subtitles from a video file. srtpol is a sed script to "polish" (i.e., smarten quotes, fix dashes, etc.) subtitles. srtran can be used to linearly transform subtitle timestamps (to fix framerate issues, for instance).

  • e and editinvim are helper scripts for gVim. e can be used to connect to an active gVim server or start a new one. editinvim can be used to edit textboxes in (most) GUI applications using gVim.

  • tala is a wrapper script around cryptsetup and friends to make it easier to create and manage LUKS containers (aka devices). tala was written as an alternative to TrueCrypt.

  • pass helper scripts: passprint converts a password store into a PDF so that you can print your passwords. passmenu helps you pick passwords using rofi or dmenu.

  • inkconv is a handy script that uses Inkscape to interconvert EMF, EPS, PDF, PNG, PS, SVG, WMF, and XAML files.

  • mutt-open is a file opener that integrates xdg-open with mutt.

  • x230t-rotate is a display rotation script to be used with a ThinkPad X230t tablet (and other Wacom tablets).

  • Calibre-based ebook utilities: ebook-formats interconverts a directory of EPUB and MOBI ebooks in parallel. ebook-organize reorganizes a directory of ebooks into the form .../author/title/title.ext.

  • LaTeX-related utilities: texclean remove temporary files left around when compiling LaTeX documents, texprune makes a clean copy of a LaTeX source tree keeping only the essential files, and texstrip removes all comments from a LaTeX file.

License

Public domain. See the file UNLICENSE for more details.

scripts's People

Contributors

manu-mannattil avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

eplord

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.