Skip to content

kendfss/shellpower

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShellPower

what
A collection of powershell scripts to help aid and play flows

how

why
Stubby little fingers grow weary of repeaded command sequences

Usage

This repository holds PowerShell scripts that I created for personal convenience.
Add them to a directory that is on your Path environment variable for optimal use.

You will have to personalize:

You may have to personalize:

You should personalize:

The three "splee" scripts enable the user to use Deezer's Spleeter CLI in a batched mode.
The number corresponds to the number of audio tracks the corresponding model is capable of parsing from a single source.

alert

Produce a sequence of n beeps with random frequency

> alert 3 # produces 3 beeps 
> alert # produces a random number (lower than 12) 
bar

Echo a line of text comprised by a repetition of your chosen string

> bar 3
***
> bar qwerty 3
qwertyqwertyqwerty
basename

offers the same functionality as the eponymous bash command

> (basename "c:/program files") -eq "program files"
True
blank

Echo n blank lines

> blank 3



>
  • See Also: goc
ccd

copy current directory to clibpoard

> ccd
  • See Also: pcd
cdls

CD to and run LS in consecutive directories

> cdls folder1 ../folder2 folder3 

Is equal to

> cd folder1; ls; cd ..; cd folder2; ls; cd folder3; ls
cdn

Same as cdls except it only prints the names of the directory contents as opposed to default windows behaviour (which is the same as ls -l on unix)

> cdn folder1 ../folder2 folder3 
choose

Same as cpr except it accepts arguments manually

> choose (exts mkv webm mp4)
clone

Open your git cloning manager

> clone 
close

Close a running process

> close fl64 
# closes fl64.exe
cls

Clears the screen before perfoming cdls and returning to starting directory

> cls folder1 ../folder2 folder3 
# closes fl64.exe
cpr

Copy the name of a random item in the current directory to the clipboard

> cpr
deploy

a set up script for installing the .profile

> deploy
dls

Clears the screen before implementing cdls

> cls folder1 ../folder2 folder3 
# closes fl64.exe
download

Download a file from the internet

> download source.url destination/file.path
  • Wrapper on invoke-webrequest
exec

Execute a sequence of commands in succession

> exec "command 1" ... "command n"
  • Wrapper on invoke-expression
ext

Scan the current directory for files matching given extensions

> ext "extension 1" "extension 2" ... "extension n"
ffhere

Play files in tne current directory with ffmpeg's ffplay program

> ffhere 1 2 3
# will play the 1st 2nd and 3rd files listed in an "ls" call
> ffhere
# will play everything in the current directory
ffp

FFPlay files from the clipbboard or passed as argument

> ffp
# get clipboard, split by line break, play each file
> ffp (names | grep -i "search criteria")
# will play every file in the current directory whose name matches "search criteria"
files

Echo the names of the files in an get-childitem -file -names call of each argument (assuming it is a path to a directory)

> files dir1 dir2 dir3
# will look in the 1st 2nd and 3rd directories passed as arguments
> files
# will look in the current directory
folders

Echo the names of the folders in an get-childitem -directory -names call of each argument (assuming it is a path to a directory)

> folders dir1 dir2 dir3
# will look in the 1st 2nd and 3rd directories passed as arguments
> folders
# will look in the current directory
foo

Open foobar2000

> foo
  • Assumes: it is installed at "C:\Program Files (x86)\foobar2000"
gcd

git clone and cd into a repository

c:/users/someone> gcd https://github.com/kendfss/shellpower
c:/users/someone/shellpower>
gitfast

Quickly init, commit, and push a directory to github

> gitfast "repo-name"
  • Assumes: You're tryin to push to one of my repositories
goc

Go doc any number of arguments

> goc image.decode os.executable io/fs
gomo

Spin up a demo project for go. Assumes you have content for a "main.go" file in clipboard.

> gomo demo_project_name/or/path
  • Assumes: Golang has been installed
gosite

cd into $env:gopath

> gosite
  • Assumes: Go has been installed
gosrc

cd into the directory above the golang installation's /bin

> gosrc
  • Assumes: Golang has been installed and its /bin directory is on the path variable
goto

Open the directory containing a given executable which is accessible via the path environment variable. Also echoes the path of the executable

> goto powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
gun

Go run your Golang source file

> gun path/to/my/main/file.go
happy_birthday

Play happy birthday with lyrics

> happy_birthday syllable1 syllable2
# prints the lyrics, while playing the melody, puts the two arguments (syllables) into "happy birthday, dear {syllable1} {syllable2}" t
ind

Echo the index of an element of a countable iterable

> ind 1 3
1 of 3
isdir

Check if a path is a directory in the file system

> isdir path/in/question
isfile

Check if a path is a file in the file system

> isfile path/in/question
isit

Return a boolean indicating if each argument is a command on this system

> isit arg1 arg2 ... argN
  • Wraps get-command
  • See also which
mcd

Create a whole tree with a single command

> mcd folder1 ../folder2 folder3
# equals md folder1; cd folder1; cd ..; md folder2; cd folder2; md folder3; cd folder3 
> mcd testdir1 td2 ../td3 td4
# testdir1
# ├───td2
# └───td3
#     └───td4
mdn

Opens the mozilla mdn docs in explorer

> mdn
  • assumes you've set a $mdn variable
mkimagelist

takes file and directory paths and creates a file, named image_list.txt with the found images for giving to ffmpeg

> mkimagelist [path1 [path2 ...]]
mkimagevid

Commands ffmpeg to create a video using the file generated by mkimagelist. The resulting file will be called out.mp4

> mkimagevid
mkvid

Commands ffmpeg to create a video using a given image and audio file. The resulting file will be called out.mp4

> mkvid image/file/path audio/file/path
names

run ls -n aka get-childitem -n and filter for files whose names match arguments

> names arg1 arg2 argN
  • case insensitive
nameSpacer

Check if a given path exists and return a version of it that doesn't

> nameSpacer c:/users
c:/users_2
next

Scan a sequence of directories for names matching a given extension

> next "extension" "directory 1" ... "directory n"
  • See Also: ext
new

Create a new powershell script

> new name1 name2 ... nameN 
# will create:
    # $base/name1.ps1
    # $base/name2.ps1
    ...
    # $base/nameN.ps1
# and open each one in a text editor
  • Assumes you have set a $scripts variable
  • Assumes you have set a editor alias
np

open [in] notepad

> np file/path
npp

open [in] notepad++

> npp path/to/some/thing/or/place
  • Assumes you have an alias for notepad++ as "n++" in your path or $profile
onde

Find out precisely where executables on the path are located

> onde exe1 exe2 etc..
  • Note: You will have to append '.ps1' if you are looking for powershell scripts
open

Open the given file with the default program

> open path/to/file
pcd

cd into the directory in your clipboard

> pcd
play

Play a sequence of notes on a single 11-note octave "keyboard" rooted at 440hz

> play 0 1 1 2 3 5 8 13 21
pop

open something with explorer and focus its window.

> pop
  • "start-process"/"start"/etc don't focus the new window
pout

Repetitive echo that was probably the first powershell script i wrote. I forgot about, and would otherwise delete, it but reading it now I realize I'd also forgotten some syntax features I should remember to implement elsewhere in this library. So it's sticking around, for now.

> pout
pow

Raise some argument to a power of choice

> pow 2 3
8
profile

Open your $profile file

> profile
  • Assumes you have set a editor alias
pub

Pub get a sequence of arguments

> pub uri1 uri2 #etc...
  • Assumes you have installed flutter/dart installed
pushenv

Augment an environment variable

> pushenv "key" "value" "separator"
> pushenv "key" "value" 
  • Not persistent
  • Remember to use a separator if needed
putenv

Set an environment variable

> putenv "variable" "value"
  • Not persistent
readus

Cat the readme.md files of multiple directories by simply stating the folder names

> cd my/repository/depository
> readus tensorflow python some/other/repo or/folder maybe/its/on/another/disk idk/up/to/you/really
recycle

Send path to the recycle bin

> recycle path1 path2 pathN
  • Currently broken
rmp

Remove a file whose path is in the clipboard

> rmp
  • Equivalent to rm (get-clipboard)
sample

move the selected file to the samples folder

> sample
# gets path from clipboard
> sample arg1 arg2 ... argN
# act on a sequence of arguments
  • Assumes you have set a $samples variable
scrap

Rage quit the project in the current directory by sending it to the recycle bin

> scrap
  • Requires recycle
sizes

Print the names and sizes of files in the current directory, first argument(s) denote(s) [a] search term[s], if the last argument is an int it will mean b, kb, mb (default), or gb mode

> sizes [search_term_1 ... search_term_N] [0_1_2_or_3]
  • case insensitive
sound

Print the sizes of the given arguments. Size of all child files for directories.

> sizeof .ssh
2012
> sizeof links
1399
> sizeof music
37889861619
sound

Open the sound control panel

> sound
splee2

Split an audio stream into a vocal and instrumental track

> splee2 path/to/audio/file
  • Assumes you have python and have previously installed spleeter
splee4

Split an audio stream into a vocal, instrumental, drum, bass, and piano tracks

> splee4 path/to/audio/file
  • Assumes you have python and have previously installed spleeter
splee5

Split an audio stream into a vocal, instrumental, drum, bass, and piano tracks

> splee5 path/to/audio/file
  • Assumes you have python and have previously installed spleeter
splitext

Split the last suffix from the path

> splitext path/to/something.suffix1.suffix2
suffix2
sublime_docs

Serve the unofficial Sublime Text documentation locally

> sublime_docs
st

Open a sequence of arguments (or the current directory) in sublime text

> st dir/file1.ext file2.ext .
  • Assumes you have previously installed Sublime Text and have it aliased as "sublime"
tilde

ssh into tilde

> tilde
unix

Convert the path of the current directory to wsl-unix form and send it to the clip-board

> unix
which

Echo the full paths (if found) of the given arguments

> which arg1 arg2 ... argN
  • Wraps get-command
  • See also isit
y22

Grab a 1280x720-720p MP4 video (where applicable)

> y22 url1 url2 urlN
  • Assumes you have installed youtube-dl
  • Assumes $ytdls is set
yda

Youtube download the audio streams associated with a sequence of arguments

> yda url1 url2 urlN
  • Assumes you have installed youtube-dl
  • Assumes $ytdls is set
  • uses ind
ydc

Check the available formats associated with a sequence of arguments

> ydc url1 url2 urlN
ydl

Youtube download the audio streams associated with a sequence of arguments

> ydl url1 url2 urlN
ytdls

cd into a pre-defined directory

C:\Windows\System32> ytdls url1 url2 urlN
pre/defined/directory> 
  • Assumes $ytdls is set
  • uses ind

About

regular features of my commandline history

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published