scripts

My personal collection of scripts
git clone git://src.gearsix.net/scriptsscripts.zip
Log | Files | Refs | Atom | README | LICENSE

README.md (raw) (4256B)


   1 
   2 ## overview
   3 
   4 A collection of personal scripts I use.
   5 
   6 I use most of these scripts for convenience and to save on typing.
   7 
   8 More recently I've been making an effort to learn PowerShell as I tend to use windows a fair bit too, so there are a few one-off scripts used for that too.
   9 
  10 - **nix/** - Scripts for POSIX (Unix, MacOS, Linux, etc) machines. Mostly written in `sh` and `bash`.
  11 - **win/** - Scripts for Windows. Using `PowerShell`
  12 - **any/** - Scripts for multiple environments (mostly `Python`).
  13 
  14 
  15 ## install
  16 
  17 **POSIX (Linux, Mac, BSD)**
  18 
  19 I've created an install script (bash).
  20 
  21 	usage: ./install [ARGUMENTS] [SCRIPT]
  22 
  23 	SCRIPTS
  24 	  Optionally, you can specify a script to install.
  25 	  Any specified scripts must be the filepath to the
  26 	  script (not just the filename).
  27 
  28 	ARGUMENTS
  29 	  -f, --force         overwrites files when installing
  30 	  -r,   --reinstall   re-install scripts already existing in
  31 			      destination directory
  32 	  -d, --dest [DEST]   set the install destination
  33 	  -a, --all           install ALL the scripts ('y' to all prompts)
  34 	  -l, --link          'ln' the script (not cp).
  35 	  -h, --help          print this dialog
  36 
  37 
  38 **Windows**
  39 
  40 I haven't got a script for Windows since there aren't enough scripts to justify the effort (yet).
  41 
  42 What I usually do is just put the scripts in a directory and add it to the `PATH` environment variable.
  43 
  44 
  45 ## scripts
  46 
  47 ### Powershell
  48 
  49 - *random* - a script I use to select a random item in a directory.
  50 - *zipto7z* - converts all .zip files in current directory to .7z.
  51 - *flac2mp3* - convert flac files to mp3 files using ffmpeg.
  52 
  53 ### Python
  54 
  55 - *d2h* - convert decimal numbers to hexadecimal.
  56 - *h2d* - convert hexadecimal numbers to decimal.
  57 - *jiggle* - move the mouse 1px every minute - keep the screen awake.
  58 
  59 
  60 ### POSIX shell (and bash)
  61 
  62 **strings & numbers**
  63 
  64 Scripts related to string parsing/manipulation
  65 
  66 - *strindex* - print the index (from 0..n) of the first character in substring $1 found in string $2.
  67 - *grepf* - find all files in dir $1, that conatin string $2. I use this one a lot.
  68 - *randstr* - generate a random string.
  69 
  70 **file management**
  71 
  72 - *backup* - cp input files $@ from `filename` to `filename.bak` (mv with `-m`).
  73 - *catrm* - `rm -i` but with the option to cat the file.
  74 - *flac2mp3* - converts .flac files $@ to .mp3. Requires ffmpeg.
  75 - *openurl* - xdg-open all links found in files $@.
  76 - *mkdcp* - make directory $1 and copy files into it ($2..$n).
  77 - *mkdmv* - make directory $1 and move files into it ($2..$n)
  78 - *mkdnvim* - make directory $1, touch file $2 and open file $2 in $EDITOR.
  79 - *mkdtouch* - make a directory $1, touch files in it ($2..$n).
  80 
  81 **tooling**
  82 
  83 - *pyserve* - shorthand for `python3 -m http.server --directory $1`.
  84 - *git-cfg* - shorthand for calling `git config --local user.name $1 && git config --local user.email $2`.
  85   - You can also use it for setting global config using `-g`
  86 - *git-clone-bulk* - clone a list of git repositories.
  87 - *git-pull-all* - pull all remote git branches from the current upstream.
  88 - *git-pradd* - git diff $@, for each prompt y/n whether to git add it
  89 - *git-init* - initialize a git server repository (I use it for my own remote server)
  90 - *gobuild* - build a go module in all available output formats, useful for releases.
  91 - *preview-md* - convert a markdown file $1 to html, open if $2 == "-o" or "--open".
  92   - Uses cmark by default, set conversion tool and default output destination in src.
  93 - *compress-pdf* - compress a .pdf file ($1), requires *ghostscript* (*gs*).
  94 - *rled* - invoke ed with a readline wrapper (for input history)
  95 - *gnome-shell-cycle-wallpaper* - One I used to cycle the wallpaper on a GNOME desktop infrequently
  96 
  97 **misc**
  98 
  99 - *shush* - run $@ in the background and hide output.
 100 - *pomodoro* - a [pomodoro](https://en.wikipedia.org/wiki/Pomodoro_Technique) timer.
 101 - *while-true* - clear the terminal, run $1 sleep ($2 || 1 sec), repeat forever (Ctrl+C to cancel).
 102 - *onfilech* - stat a file ($1) every 10 seconds, if the output changes, run a command ($2...$n).
 103 - *awkcol* - column with awk (at one point  column wasn't available but awk was)
 104 
 105 **depreciated**
 106 
 107 This contains scripts that I once used but aren't required anymore (or I eventually realised were useless).
 108 
 109 
 110 ## authors
 111 
 112 - gearsix
 113