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:
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