Skip to main content

A collection of useful personal utilities, separated from the core skilleter-thingy package

Project description

Skilleter-Extras

Licence: GPL v3

Author: John Skilleter v0.99

Collection of miscellaneous, developer-orientated utilities for Linux and MacOS. Untested on other operating systems.

Permanently (for the foreseeable future!) in a beta stage - usable, with a few rough edges, and probably with bugs when used in way I'm not expecting!

IMPORTANT

Some scripts have been moved here from the skilleter-thingy package, which is now more focussed on Git-related functionality.

If you already have the skilleter-thingy package installed (version 0.3.42 or older) then you should use the --force option when installing skilleter-extras to ensure that the symlinks for these scripts are updated to point to the skilleter-extras version.

General Commands

addpath

Add or remove entries from a path list (e.g. as used by the PATH environment variable)

usage: addpath [-h] [--add ADD] [--prefix PREFIX] [--suffix SUFFIX] [--remove REMOVE] [--separator SEPARATOR] path

Add or remove entries from a path list (e.g. as used by the PATH environment variable)

positional arguments:
  path                  The path to modify

options:
  -h, --help            show this help message and exit
  --add ADD             Add an entry to the front of the path (do nothing if it is already present in the path)
  --prefix PREFIX       Add an entry to the front of the path (or move it there if it is already present)
  --suffix SUFFIX       Add an entry to the end of the path (or move it there if it is already present)
  --remove REMOVE       Remove an entry from the path (do nothing if it is not present
  --separator SEPARATOR Override the default path separator

borger

Wrapper for the borg backup utility to make it easier to use with a fixed set of options.

console_colours

Alias: consolecolours

Display all available colours in the console.

diskspacecheck

Check how much free space is available on all filesystems, ignoring read-only filesystems, /dev and tmpfs.

Issue a warning if any are above 90% used.

docker-purge

Stop or kill docker instances and/or remove docker images.

ffind

Simple file find utility - replaces the find command with something that is more human-friendly.

ffind [-h] [--path PATH] [--long] [--colour] [--no-colour] [--all] [--zero] [--iname] [--follow] [--git] [--diff] [--regex] [--fullpath] [--human-readable] [--grep GREP] [--abspath]
            [--unquoted] [--quiet] [--invert] [--exec EXEC] [--count] [--count-only] [--type TYPE] [--file] [--dir] [--block] [--char] [--pipe] [--symlink] [--socket] [--any] [--verbose]
            [--debug]
            [patterns ...]

positional arguments:
  patterns              List of things to search for.

options:
  -h, --help            show this help message and exit
  --path PATH, -p PATH  Search the specified path, rather than the current directory
  --long, -l            Output details of any files that match (cannot be used with -0/--zero)
  --colour, -C, --color
                        Colourise output even if not outputting to the terminal
  --no-colour, -N, --no-color
                        Never colourise output
  --all                 Search all directories (do not skip .git, and similar control directories)
  --zero, -0            Output results separated by NUL characters
  --iname, -i           Perform case-independent search
  --follow, -F          Follow symlinks
  --git, -g             Only search for objects in the current git repository
  --diff, -D, --diffuse
                        Run Diffuse to on all the found objects (files only)
  --regex, -R           Use regex matching rather than globbing
  --fullpath, -P        Match the entire path, rather than just the filename
  --human-readable, -H  When reporting results in long format, use human-readable sizes
  --grep GREP, -G GREP  Only report files that contain text that matches the specified regular expression
  --abspath, -A         Report the absolute path to matching entities, rather than the relative path
  --unquoted, -U        Do not use quotation marks around results containing spaces
  --quiet, -q           Do not report permission errors that prevented a complete search
  --invert, -I          Invert the wildcard - list files that do not match
  --exec EXEC, -x EXEC  Execute the specified command on each match (optionally use ^ to mark the position of the filename)
  --count, -K           Report the number of objects found
  --count-only, -c      Just report the number of objects found
  --type TYPE, -t TYPE  Type of item(s) to include in the results, where b=block device, c=character device, d=directory, p=pipe, f=file, l=symlink, s=socket. Defaults to files and directories
  --file, -f            Include files in the results (the default if no other type specified)
  --dir, -d             Include directories in the results
  --block               Include block devices in the results
  --char                Include character devices in the results
  --pipe                Include pipes in the results
  --symlink, --link     Include symbolic links in the results
  --socket              Include sockets in the results
  --any, -a             Include all types of item (the default unless specific types specified)
  --verbose, -v         Output verbose data
  --debug               Output debug data

gphotosync

Utility for syncing photos from Google Photos to local storage

linecount

Summarise number of files, lines of text and total size of files in a directory tree

usage: linecount [-h] [--ext]

options:
  -h, --help  show this help message and exit
  --ext, -e   Identify file type using the file extension (faster but less accurate)

moviemover

Search for files matching a wildcard in a directory tree and move them to an equivalent location in a different tree

py-audit

Query api.osv.dev to determine whether a specified version of a particular Python package is subject to known security vulnerabilities

py-audit [-h] [requirements ...]

positional arguments:
  requirements  The requirements file (if not specified, then the script searches for a requirements.txt file)

options:
  -h, --help    show this help message and exit

phototidier

Perform various tidying operations on a directory full of photos:

  • Remove leading '$' and '_' from filenames
  • Move files in hidden directories up 1 level
  • If the EXIF data in a photo indicates that it was taken on date that doesn't match the name of the directory it is stored in (in YYYY-MM-DD format) then it is moved to the correct directory, creating it if necessary.

All move/rename operations are carried out safely with the file being moved having a numeric suffix added to the name if it conflicts with an existing file.

photodupe

remdir

Recursively delete empty directories

remdir [-h] [--dry-run] [--debug] [--verbose] [--ignore IGNORE] [--keep KEEP] dirs [dirs ...]

positional arguments:
  dirs                  Directories to prune

options:
  -h, --help            show this help message and exit
  --dry-run, -D         Dry-run - report what would be done without doing anything
  --debug               Output debug information
  --verbose             Output verbose information
  --ignore IGNORE, -I IGNORE
                        Files to ignore when considering whether a directory is empty
  --keep KEEP, -K KEEP  Directories that should be kept even if they are empty

rpylint

Run pylint on all the Python source files in a directory tree

usage: rpylint [-h] [paths ...]

positional arguments:
  paths       List of files or paths to lint

options:
  -h, --help  show this help message and exit

splitpics

Copy a directory full of pictures to a destination, creating subdirectories with a fixed number of pictures in each in the destination directory for use with FAT filesystems and digital photo frames.

strreplace

Simple search and replace utility for those times when trying to escape characters in a regexp to use sed is more hassle than it is worth.

strreplace [-h] [--inplace] search replace [infile] [outfile]

positional arguments: search Search text replace Replacement text infile Input file outfile Output file

options: -h, --help show this help message and exit --inplace, -i Do an in-place search and replace on the input file

tfparse

Read JSON Terraform output and convert back to human-readable text

This allows multiple errors and warnings to be reported as there's no way of doing this directly from Terraform

usage: tfparse [-h] [--abspath] [infile ...]

positional arguments:
  infile         The error file (defaults to standard input if not specified)

options:
  -h, --help     show this help message and exit
  --abspath, -a  Output absolute file paths

trimpath

Intelligently trim a path to fit a given width (used by gitprompt)

venv-create

Create a script to create/update a virtual environment and run a python script in it.

usage: venv-create [-h] name

positional arguments:
  name        Name of the script to create

options:
  -h, --help  show this help message and exit

window-rename

xchmod

Command to run chmod only on files that need it (only modifies files that don't have the required permissions already).

usage: xchmod [-h] [--debug] [--verbose] [--recursive] mode paths [paths ...]

positional arguments:
  mode             Mode to set
  paths            List of directory paths to search

options:
  -h, --help       show this help message and exit
  --debug          Output the list of files (if any) that need to be made publicly writeable
  --verbose        List files as they are updated
  --recursive, -R  Operate recursively

yamlcheck

YAML validator - checks that a file is valid YAML (use yamllint to verify that it is nicely-formatted YAML).

usage: yamlcheck [-h] [--dump] [--block] [--flow] [--hiera] files [files ...]

positional arguments:
  files       YAML source file

options:
  -h, --help  show this help message and exit
  --dump      Dump the YAML data after parsing it
  --block     Force block style when dumping the YAML data
  --flow      Force flow style when dumping the YAML data
  --hiera     Process the file as Puppet Hiera data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skilleter_extras-0.1.0.tar.gz (58.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

skilleter_extras-0.1.0-py3-none-any.whl (66.8 kB view details)

Uploaded Python 3

File details

Details for the file skilleter_extras-0.1.0.tar.gz.

File metadata

  • Download URL: skilleter_extras-0.1.0.tar.gz
  • Upload date:
  • Size: 58.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for skilleter_extras-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0de695b139d3743e544b45df8ba5b211f0f3e6ee1b4cad4fbeac70da471db54
MD5 feec052ce3116d536bfb63c92d9724fb
BLAKE2b-256 d9444fd603457a7cb5506c58baa6c4aad2898de91971ec7cb923ccfab1c1c980

See more details on using hashes here.

File details

Details for the file skilleter_extras-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for skilleter_extras-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb573f3c5c82c203d5d93373217a947c8ae7a6e57f360cfef37434bddb04741e
MD5 52650882a4783d1e51b887ee101bb5f1
BLAKE2b-256 4359429df6f096ef5e4b67105499d14c87846624a1af43426eb187b04b7f1d9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page