scripts

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

commit 517694fc4a26acb945fd3e85298c250d4e071b93
parent 5870d5b03967cb765b14ece15e5a488d58d419a0
Author: gearsix <gearsix@tuta.io>
Date:   Tue,  4 Jan 2022 22:51:54 +0000

moved src/->nix/; added some powershell scripts to win/

Diffstat:
MREADME.md | 4+++-
Rinstall -> install.sh | 0
Rsrc/backup.sh -> nix/backup.sh | 0
Rsrc/catrm.sh -> nix/catrm.sh | 0
Rsrc/compress-pdf.sh -> nix/compress-pdf.sh | 0
Rsrc/depreciated/cpc.sh -> nix/depreciated/cpc.sh | 0
Rsrc/depreciated/openurl.sh -> nix/depreciated/openurl.sh | 0
Rsrc/depreciated/strlen.sh -> nix/depreciated/strlen.sh | 0
Rsrc/depreciated/touchn.sh -> nix/depreciated/touchn.sh | 0
Rsrc/depreciated/xopen.sh -> nix/depreciated/xopen.sh | 0
Rsrc/flac2mp3.sh -> nix/flac2mp3.sh | 0
Rsrc/git-cfg.sh -> nix/git-cfg.sh | 0
Rsrc/git-clone-bulk.sh -> nix/git-clone-bulk.sh | 0
Rsrc/git-pull-all.sh -> nix/git-pull-all.sh | 0
Rsrc/gobuild.sh -> nix/gobuild.sh | 0
Rsrc/grepf.sh -> nix/grepf.sh | 0
Rsrc/mkdcp.sh -> nix/mkdcp.sh | 0
Rsrc/mkdmv.sh -> nix/mkdmv.sh | 0
Rsrc/mkdnvim.sh -> nix/mkdnvim.sh | 0
Rsrc/mkdtouch.sh -> nix/mkdtouch.sh | 0
Rsrc/openurl.sh -> nix/openurl.sh | 0
Rsrc/pomodoro.sh -> nix/pomodoro.sh | 0
Rsrc/preview-md.sh -> nix/preview-md.sh | 0
Rsrc/randstr.sh -> nix/randstr.sh | 0
Rsrc/shush.sh -> nix/shush.sh | 0
Rsrc/strindex.sh -> nix/strindex.sh | 0
Rsrc/while-true.sh -> nix/while-true.sh | 0
Rsrc/xbright.sh -> nix/xbright.sh | 0
Awin/random.ps1 | 5+++++
Awin/zipto7z.ps1 | 17+++++++++++++++++
30 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -1,6 +1,6 @@ # g6scripts -A collection of personal scripts I use in linux environments +A collection of personal scripts I use. ## contents @@ -16,6 +16,8 @@ A collection of personal scripts I use in linux environments I use most of these scripts for convenience and to save on typing. +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. + ## installing diff --git a/install b/install.sh diff --git a/src/backup.sh b/nix/backup.sh diff --git a/src/catrm.sh b/nix/catrm.sh diff --git a/src/compress-pdf.sh b/nix/compress-pdf.sh diff --git a/src/depreciated/cpc.sh b/nix/depreciated/cpc.sh diff --git a/src/depreciated/openurl.sh b/nix/depreciated/openurl.sh diff --git a/src/depreciated/strlen.sh b/nix/depreciated/strlen.sh diff --git a/src/depreciated/touchn.sh b/nix/depreciated/touchn.sh diff --git a/src/depreciated/xopen.sh b/nix/depreciated/xopen.sh diff --git a/src/flac2mp3.sh b/nix/flac2mp3.sh diff --git a/src/git-cfg.sh b/nix/git-cfg.sh diff --git a/src/git-clone-bulk.sh b/nix/git-clone-bulk.sh diff --git a/src/git-pull-all.sh b/nix/git-pull-all.sh diff --git a/src/gobuild.sh b/nix/gobuild.sh diff --git a/src/grepf.sh b/nix/grepf.sh diff --git a/src/mkdcp.sh b/nix/mkdcp.sh diff --git a/src/mkdmv.sh b/nix/mkdmv.sh diff --git a/src/mkdnvim.sh b/nix/mkdnvim.sh diff --git a/src/mkdtouch.sh b/nix/mkdtouch.sh diff --git a/src/openurl.sh b/nix/openurl.sh diff --git a/src/pomodoro.sh b/nix/pomodoro.sh diff --git a/src/preview-md.sh b/nix/preview-md.sh diff --git a/src/randstr.sh b/nix/randstr.sh diff --git a/src/shush.sh b/nix/shush.sh diff --git a/src/strindex.sh b/nix/strindex.sh diff --git a/src/while-true.sh b/nix/while-true.sh diff --git a/src/xbright.sh b/nix/xbright.sh diff --git a/win/random.ps1 b/win/random.ps1 @@ -0,0 +1,4 @@ +# DESCRIPTION: Select a random item from all files in a directory +$n = 1 +If ($args[0]) { $n = $args[0] } +Get-Random -InputObject $(Get-ChildItem) -Count $n +\ No newline at end of file diff --git a/win/zipto7z.ps1 b/win/zipto7z.ps1 @@ -0,0 +1,16 @@ +# DESCRIPTION: convert all .zip files in current directory to .7z +# DEPENDENCIES: requires 7z.exe to be in your $PATH +Foreach ($zip in $(Get-ChildItem -Filter *.zip)) { + Set-Variable -Name name -Value $zip.toString().TrimEnd(".zip") + Write-Output $name + Expand-Archive -Path $zip + + Set-Directory $name + 7z a -mx9 $name + + Move-Item "$name.7z" .. + Set-Location .. + + Remove-Item $zip + Remove-Item $name -Recurse +} +\ No newline at end of file