-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: alert, isfile, new, play, y22, ydl, yda, beep, ls; add: deploy, …
…basename, open, mkvid
- Loading branch information
kendfss
committed
Oct 19, 2024
1 parent
c2d7687
commit a6d2e60
Showing
17 changed files
with
234 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Aliases | ||
# set-alias lyx "C:\Program Files (x86)\LyX 2.3\bin\LyX.exe" | ||
set-alias edge "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" | ||
# set-alias curl "C:\ProgramData\chocolatey\bin\curl.exe" | ||
set-alias vlc "C:\Program Files\VideoLAN\VLC\vlc.exe" | ||
# set-alias py38 "E:\Languages\Python38-64\python.exe" | ||
set-alias firefox "C:\Program Files\Mozilla Firefox\firefox.exe" | ||
# set-alias pm "F:\Programs\Workstations\FL Studio 20.8.1\System\Tools\Plugin Manager\PluginManager.exe" | ||
set-alias chrome "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" | ||
set-alias -option AllScope cls "c:/shellpower/cls.ps1" | ||
# set-alias gw "ghostwriter.exe" | ||
set-alias envars "SystemPropertiesAdvanced.exe" | ||
# set-alias sublime "E:\IDEs\Sublime Text 3\sublime_text.exe" | ||
# set-alias brython brython-cli | ||
# set-alias ptp ptpython | ||
# set-alias sumatra "C:\Program Files\SumatraPDF\SumatraPDF.exe" | ||
set-alias c set-clipboard | ||
set-alias p get-clipboard | ||
set-alias editor (where.exe hx) | ||
# set-alias make "C:\msys64\usr\bin\make.exe" | ||
set-alias s select | ||
set-alias touch "C:\Program Files\Git\usr\bin\touch.exe" | ||
set-alias grep "C:\Program Files\Git\usr\bin\grep.exe" | ||
set-alias gbash "C:\Program Files\Git\git-bash.exe" | ||
# Variables | ||
# $startup = "C:\Users\Kenneth\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" | ||
# $ytdls = "f:/ytdls" | ||
$scripts = "c:/shellpower" | ||
# $mdn = "E:\gitting\gitclone\clones\mdn\content\files\en-us" | ||
# $samples = join-path $ytdls "samples" | ||
# $filth = "e:/projects/web/tilde/eli2and40-tilde_club/organized" | ||
$EDITOR=(where.exe hx) | ||
if ($PWD -eq "C:\Windows\System32") { | ||
cd ~ | ||
} | ||
# clear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
$n = if ($args.length) {$args[0] - 1} else {get-random 12} | ||
$n = if ($args.length) {$args[0] - 1} else {(get-random 12)+1} | ||
echo $n | ||
foreach ($i in (0..$n)) {play (get-random)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
foreach ($arg in $args) { | ||
split-path -Path $arg -Leaf | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
param( | ||
[double]$freq = 440, | ||
[double]$len = 300 | ||
) | ||
|
||
[console]::beep($freq, $len) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
function goBack { | ||
if ($startingDir) { | ||
cd $startingDir | ||
} | ||
} | ||
|
||
if ((split-path -Path $pwd -Leaf).ToLower() -ne "shellpower") { | ||
if ($scripts) { | ||
$startingDir=$pwd | ||
cd $scripts | ||
} else { | ||
echo "not in shellpower and cannot find it" | ||
exit 1 | ||
} | ||
} | ||
|
||
if ($profile) { | ||
if (test-path -Path $profile) { | ||
echo '$profile already exists, not sure what to do (replace or add a source/.).' | ||
goBack | ||
exit 1 | ||
} | ||
if (!(test-path -Path .profile)) { | ||
echo 'cannot find .profile to source to $profile' | ||
goBack | ||
exit 1 | ||
} | ||
# cat .profile > $profile | ||
New-Item -ItemType HardLink -Path "$profile" -Target "$(join-path $pwd .profile)" > $null && echo 'hard linked $profile' | ||
} | ||
|
||
goBack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
foreach ($arg in $args) { | ||
# $isfile = Test-Path -Path $arg -PathType Leaf | ||
Test-Path -Path $arg -PathType Leaf | ||
# echo $isfile | ||
# yield $isfile | ||
} | ||
|
||
|
||
# rfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
# function ls { | ||
# if ($args.length -gt 1) { | ||
# if (isdir $args[0]) { | ||
# for ($i=1; $i -lt $args.length; $i++) { | ||
# get-childitem -name $args[0] $args[$i] | ||
# } | ||
# } else{ | ||
# foreach ($arg in $args) { | ||
# get-childitem -name $arg | ||
# } | ||
# } | ||
# } else { | ||
# get-childitem -name $args[0] | ||
# } | ||
# } | ||
|
||
# ls $args | ||
|
||
function ls { | ||
if ($args.length -gt 1) { | ||
if (isdir $args[0]) { | ||
for ($i=1; $i -lt $args.length; $i++) { | ||
get-childitem -name $args[0] $args[$i] | ||
} | ||
} else{ | ||
foreach ($arg in $args) { | ||
get-childitem -name $arg | ||
} | ||
} | ||
} else { | ||
get-childitem -name $args[0] | ||
} | ||
} | ||
|
||
ls $args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
param ( | ||
[string[]]$Paths | ||
) | ||
|
||
# Define a list of image file extensions to check for (in lowercase) | ||
$imageExtensions = @("jpg", "jpeg", "png", "gif", "bmp", "tiff") | ||
|
||
# Initialize an array to hold image paths | ||
$imageList = @() | ||
|
||
# Iterate through each path provided as an argument | ||
foreach ($path in $Paths) { | ||
# Check if the path is a directory | ||
if (Test-Path $path -PathType Container) { | ||
# Get all files in the directory and check their extensions | ||
$files = Get-ChildItem -Path $path -File -Recurse | ||
foreach ($file in $files) { | ||
# Get the file extension and convert it to lowercase | ||
$extension = $file.Extension.TrimStart('.').ToLower() | ||
if ($imageExtensions -contains $extension) { | ||
$imageList += (Resolve-Path $file.FullName) | ||
} | ||
} | ||
} | ||
# Check if the path is a file and an image | ||
elseif (Test-Path $path -PathType Leaf) { | ||
# Get the file extension and convert it to lowercase | ||
$extension = $path.Substring($path.LastIndexOf('.') + 1).ToLower() | ||
if ($imageExtensions -contains $extension) { | ||
$imageList += (Resolve-Path $path) | ||
} | ||
} | ||
} | ||
|
||
# Create the image_list.txt file in the current working directory | ||
$imageListPath = Join-Path -Path (Get-Location) -ChildPath "image_list.txt" | ||
|
||
# Write the image paths to the file | ||
$imageList | ForEach-Object { "file '$($_)'" } | Set-Content -Path $imageListPath -Encoding UTF8 | ||
|
||
# Inform the user about the created file | ||
Write-Host "Image list created at: $imageListPath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ffmpeg -r 0.1 -f concat -safe 0 -i image_list.txt -c:v libx264 -pix_fmt yuv420p out.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
image = $args[0] | ||
audio = $args[1] | ||
ffmpeg -loop 1 -i $image -i $audio -c:v libx264 -tune stillimage -c:a copy -b:a 192k -pix_fmt yuv420p -shortest out.mp4 | ||
|
||
# https://duckduckgo.com/?q=ffmpeg+combine+photo+and+audio&t=ffab&ia=web&iax=qa | ffmpeg combine photo and audio at DuckDuckGo | ||
# https://www.bannerbear.com/blog/how-to-create-a-slideshow-from-images-with-ffmpeg/ | How to Create a Slideshow from Images with FFmpeg - Bannerbear | ||
# https://ffmpeg.org/ffmpeg.html | ffmpeg Documentation | ||
# https://duckduckgo.com/?t=ffab&q=high+level+mp4+library&ia=web | high level mp4 library at DuckDuckGo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoke-item $args[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters