Skip to content

manu-mannattil/scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Little scripts that I use from time to time

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published