Init
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
netling/
|
||||
*.exe
|
||||
*.hlp
|
||||
*.a
|
||||
*.lib
|
||||
*.dll
|
||||
*.lnk
|
||||
10
2mp3.ps1
Normal file
10
2mp3.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
$file = $args[0]
|
||||
|
||||
if ($file -eq $null)
|
||||
{
|
||||
$file = Read-Host -Prompt "Enter filename"
|
||||
}
|
||||
|
||||
$filenew = $file.Substring(0,$file.Length-4)
|
||||
|
||||
ffmpeg -i `"$file`" -vn -ar 44100 -ac 2 -ab 320k -f mp3 `"$filenew.mp3`"
|
||||
8
applysshkey.ps1
Normal file
8
applysshkey.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$destinationHost = $args[0]
|
||||
|
||||
if ($destinationHost -eq $null)
|
||||
{
|
||||
$destinationHost = Read-Host -Prompt "Enter Host (e.g. root@contoso.com)"
|
||||
}
|
||||
|
||||
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh $destinationHost '[ -d .ssh ] || mkdir .ssh; cat >> .ssh/authorized_keys'
|
||||
8
ff2gif.ps1
Normal file
8
ff2gif.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$palname = $args[1]+'-palette.png'
|
||||
|
||||
if(![System.IO.File]::Exists($palname))
|
||||
{
|
||||
ffmpeg -i $args[0] -vf fps=60,scale=480:-1:flags=lanczos,palettegen $palname
|
||||
}
|
||||
|
||||
ffmpeg -i $args[0] -i $palname -filter_complex "fps=30,scale=400:-1:flags=lanczos[x];[x][1:v]paletteuse" $args[1]
|
||||
8
ff2sgif.ps1
Normal file
8
ff2sgif.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$palname = $args[1]+'-palette.png'
|
||||
|
||||
if(![System.IO.File]::Exists($palname))
|
||||
{
|
||||
ffmpeg -i $args[0] -vf fps=5,scale=-1:50:flags=lanczos,palettegen $palname
|
||||
}
|
||||
|
||||
ffmpeg -i $args[0] -i $palname -filter_complex "fps=5,scale=-1:50:flags=lanczos[x];[x][1:v]paletteuse" $args[1]
|
||||
10
ffdash.ps1
Normal file
10
ffdash.ps1
Normal file
@@ -0,0 +1,10 @@
|
||||
$file = $args[0]
|
||||
|
||||
#Audio Process
|
||||
ffmpeg -i $file -vn -acodec libvorbis -ab 128k -dash 1 audio_128k.webm
|
||||
|
||||
#Video Process
|
||||
ffmpeg -i $file -c:v libvpx-vp9 -keyint_min 150 -g 150 -tile-columns 4 -frame-parallel 1 -f webm -dash 1 -an -vf scale=640:480 -b:v 1000k -dash 1 -preset fast video_640x480_1000k.webm -an -vf scale=1280:720 -b:v 1500k -dash 1 -preset fast video_1280x720_1500k.webm
|
||||
|
||||
#Video Manifest
|
||||
ffmpeg -f webm_dash_manifest -i video_640x480_1000k.webm -f webm_dash_manifest -i video_1280x720_1500k.webm -f webm_dash_manifest -i audio_128k.webm -c copy -map 0 -map 1 -map 2 -f webm_dash_manifest -adaptation_sets "id = 0, streams = 0, 1 id = 1, streams = 3" video_manifest.mpd
|
||||
5
ffscale.ps1
Normal file
5
ffscale.ps1
Normal file
@@ -0,0 +1,5 @@
|
||||
$file = $args[0]
|
||||
$fileout = $args[1]
|
||||
$scale = $args[2]
|
||||
|
||||
ffmpeg -i $file -filter:v scale=$scale -c:a copy -map 0 -preset veryfast -movflags +faststart $fileout
|
||||
41
getKeys.ps1
Normal file
41
getKeys.ps1
Normal file
@@ -0,0 +1,41 @@
|
||||
$pfxLocation = $args[0]
|
||||
|
||||
if ($pfxLocation -eq $null) {
|
||||
$pfxLocation = Read-Host -Prompt "Enter PFX Location"
|
||||
}
|
||||
|
||||
$password = Read-Host -AsSecureString -Prompt "Enter Password"
|
||||
$password = ConvertFrom-SecureString -SecureString $password -AsPlainText
|
||||
|
||||
if(!$pfxLocation.EndsWith(".pfx")) {
|
||||
$pfxLocation = $pfxLocation+".pfx"
|
||||
}
|
||||
|
||||
$pfxLocationWithoutExt = $pfxLocation.Replace(".pfx", "")
|
||||
|
||||
$pfxFilePath = "`"$($pfxLocation)`""
|
||||
|
||||
$caCrt = "`"$($pfxLocationWithoutExt)-ca.crt`""
|
||||
$crt = "`"$($pfxLocationWithoutExt).crt`""
|
||||
$encryptedKey = "`"$($pfxLocationWithoutExt)-encrypted.key`""
|
||||
$key = "`"$($pfxLocationWithoutExt).key`""
|
||||
$fullCrt = "`"$($pfxLocationWithoutExt)-full.crt`""
|
||||
|
||||
#ca-cert
|
||||
openssl pkcs12 -in $pfxLocation -nodes -nokeys -cacerts -out $caCrt -passin pass:$password
|
||||
|
||||
#key file
|
||||
openssl pkcs12 -in $pfxLocation -nocerts -out $encryptedKey -passin pass:$password -passout pass:$password
|
||||
|
||||
#key decrypt
|
||||
openssl rsa -in $encryptedKey -out $key -passout pass:$password
|
||||
|
||||
#cert
|
||||
openssl pkcs12 -in $pfxLocation -clcerts -nokeys -out $crt -passin pass:$password
|
||||
|
||||
$crt = "$($pfxLocationWithoutExt).crt"
|
||||
$caCrt = "$($pfxLocationWithoutExt)-ca.crt"
|
||||
$fullCrt = "$($pfxLocationWithoutExt)-full.crt"
|
||||
|
||||
#join files
|
||||
Get-Content $crt, $caCrt | Set-Content $fullCrt
|
||||
14
rtdownloader.ps1
Normal file
14
rtdownloader.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
$url = $args[0]
|
||||
$file = $args[1]
|
||||
|
||||
if($url -eq $null)
|
||||
{
|
||||
$url = Read-Host -Prompt "Enter url that trails with .m3u8"
|
||||
}
|
||||
|
||||
if($file -eq $null)
|
||||
{
|
||||
$file = Read-Host -Prompt "Enter destination file+extension"
|
||||
}
|
||||
|
||||
ffmpeg -i $url -c copy -bsf:a aac_adtstoasc $file
|
||||
140
screenfetch.ps1
Normal file
140
screenfetch.ps1
Normal file
@@ -0,0 +1,140 @@
|
||||
#### Screenfetch for powershell
|
||||
#### Author Julian Chow
|
||||
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
|
||||
####### Functions ########
|
||||
Function Get-PrimaryResolution{ Param ($monitorArray)
|
||||
foreach ($monitor in $monitorArray){
|
||||
if($monitor.Primary){
|
||||
$primaryResolution = [System.Tuple]::Create($monitor.Bounds.Width, $monitor.Bounds.Height);
|
||||
return $primaryResolution;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
####### Information Collection #########
|
||||
|
||||
## Resolution Information
|
||||
$PrimaryResolution = Get-PrimaryResolution([System.Windows.Forms.Screen]::AllScreens);
|
||||
$Horizontal = $PrimaryResolution.Item1;
|
||||
$Vertical = $PrimaryResolution.Item2;
|
||||
|
||||
## Uptime Information
|
||||
$uptime = ((gwmi Win32_OperatingSystem).ConvertToDateTime((gwmi Win32_OperatingSystem).LocalDateTime) -
|
||||
(gwmi Win32_OperatingSystem).ConvertToDateTime((gwmi Win32_OperatingSystem).LastBootUpTime));
|
||||
|
||||
## Disk Information
|
||||
# Available Space
|
||||
$FreeDiskSize = (gwmi Win32_LogicalDisk).FreeSpace | select -f 1;
|
||||
$FreeDiskSizeGB = $FreeDiskSize / 1073741824;
|
||||
$FreeDiskSizeGB = "{0:N0}" -f $FreeDiskSizeGB;
|
||||
# Total Space
|
||||
$DiskSize = (gwmi Win32_LogicalDisk).size | select -f 1;
|
||||
$DiskSizeGB = $DiskSize / 1073741824;
|
||||
$DiskSizeGB = "{0:N0}" -f $DiskSizeGB;
|
||||
$FreeDiskPercent = ($FreeDiskSizeGB / $DiskSizeGB) * 100;
|
||||
$FreeDiskPercent = "{0:N0}" -f $FreeDiskPercent;
|
||||
# Used Space
|
||||
$UsedDiskSizeGB = $DiskSizeGB - $FreeDiskSizeGB;
|
||||
$UsedDiskPercent = ($UsedDiskSizeGB / $DiskSizeGB) * 100;
|
||||
$UsedDiskPercent = "{0:N0}" -f $UsedDiskPercent;
|
||||
|
||||
## Environment Information
|
||||
$Username = $env:username;
|
||||
$Machine = (gwmi Win32_OperatingSystem).CSName;
|
||||
$OS = (gwmi Win32_OperatingSystem).Caption;
|
||||
$BitVer = (gwmi Win32_OperatingSystem).OSArchitecture;
|
||||
$Kernel = (gwmi Win32_OperatingSystem).Version;
|
||||
|
||||
## Hardware Information
|
||||
$Motherboard = Get-CimInstance Win32_BaseBoard | Select-Object Manufacturer, Product;
|
||||
$CPU = (((gwmi Win32_Processor).Name) -replace '\s+', ' ');
|
||||
$GPU = (gwmi Win32_DisplayConfiguration).DeviceName;
|
||||
$FreeRam = ([math]::Truncate((gwmi Win32_OperatingSystem).FreePhysicalMemory / 1KB));
|
||||
$TotalRam = ([math]::Truncate((gwmi Win32_ComputerSystem).TotalPhysicalMemory / 1MB));
|
||||
$UsedRam = $TotalRam - $FreeRam;
|
||||
$FreeRamPercent = ($FreeRam / $TotalRam) * 100;
|
||||
$FreeRamPercent = "{0:N0}" -f $FreeRamPercent;
|
||||
$UsedRamPercent = ($UsedRam / $TotalRam) * 100;
|
||||
$UsedRamPercent = "{0:N0}" -f $UsedRamPercent;
|
||||
|
||||
####### Printing Output #########
|
||||
|
||||
# Line 1 - HostName
|
||||
Write-Host " ....:::: " -f Cyan -NoNewline;
|
||||
Write-Host $Username -f red -nonewline;
|
||||
Write-Host "@" -f gray -nonewline;
|
||||
Write-Host $Machine -f red;
|
||||
|
||||
# Line 2 - OS
|
||||
Write-Host " ....:::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "OS: " -f Red -NoNewline;
|
||||
Write-Host $OS $BitVer;
|
||||
|
||||
# Line 3 - Kernel
|
||||
Write-Host " ....:::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Kernel: " -f Red -nonewline;
|
||||
Write-Host $Kernel;
|
||||
|
||||
# Line 4 - Uptime
|
||||
Write-Host "....:::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Uptime: " -f Red -nonewline;
|
||||
Write-Host $uptime.Days"d " $uptime.Hours"h " $uptime.Minutes"m " $uptime.Seconds"s " -separator "";
|
||||
|
||||
# Line 5 - Motherboard
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Motherboard: " -f Red -nonewline;
|
||||
Write-Host $Motherboard.Manufacturer $Motherboard.Product;
|
||||
|
||||
# Line 6 - Shell (Hardcoded since it is unlikely anybody can run this without powershell)
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Shell: " -f Red -nonewline;
|
||||
Write-Host "PowerShell $($PSVersionTable.PSVersion.ToString())"
|
||||
|
||||
# Line 7 - Resolution (for primary monitor only)
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Resolution: " -f Red -NoNewline;
|
||||
Write-Host $Horizontal "x" $Vertical;
|
||||
|
||||
# Line 8 - Windows Manager (HARDCODED, sorry bbzero users)
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Window Manager: " -f Red -nonewline;
|
||||
Write-Host "DWM";
|
||||
|
||||
# Line 10 - Font (HARDCODED)
|
||||
Write-Host "................ ................ " -f Cyan -NoNewline;
|
||||
Write-Host "Font: " -f Red -nonewline;
|
||||
Write-Host "Segoe UI";
|
||||
|
||||
# Line 11 - CPU
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "CPU: " -f Red -nonewline;
|
||||
Write-Host $CPU;
|
||||
|
||||
# Line 12 - GPU
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "GPU: " -f Red -nonewline;
|
||||
Write-Host $GPU;
|
||||
|
||||
# Line 13 - Ram
|
||||
Write-Host ":::::::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "RAM: " -f Red -nonewline;
|
||||
Write-Host $UsedRam "MB / $TotalRam MB" -NoNewline;
|
||||
Write-Host " (" -NoNewline
|
||||
Write-Host $UsedRamPercent"%" -f Green -NoNewline;
|
||||
Write-Host ")";
|
||||
|
||||
# Line 13 - Disk Usage
|
||||
Write-Host "'''':::::::::::: :::::::::::::::: " -f Cyan -NoNewline;
|
||||
Write-Host "Disk: " -f Red -NoNewline;
|
||||
Write-Host $UsedDiskSizeGB"GB" " / " $DiskSizeGB"GB" -NoNewline;
|
||||
Write-Host " (" -NoNewline;
|
||||
Write-Host $UsedDiskPercent"%" -f Green -NoNewline;
|
||||
Write-Host ")";
|
||||
|
||||
# Empty Lines
|
||||
Write-Host " '''':::: :::::::::::::::: " -f Cyan;
|
||||
Write-Host " '''':::::::::::: " -f Cyan;
|
||||
Write-Host " '''':::: " -f Cyan;
|
||||
|
||||
8
ytdlbae-w.ps1
Normal file
8
ytdlbae-w.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$url = $args[0]
|
||||
|
||||
if ($url -eq $null)
|
||||
{
|
||||
$url = Read-Host -Prompt "Enter url"
|
||||
}
|
||||
|
||||
youtube-dl --extract-audio --audio-format wav --audio-quality 0 -i --output "%(title)s.%(ext)s" $url
|
||||
8
ytdlbae.ps1
Normal file
8
ytdlbae.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$url = $args[0]
|
||||
|
||||
if ($url -eq $null)
|
||||
{
|
||||
$url = Read-Host -Prompt "Enter url"
|
||||
}
|
||||
|
||||
youtube-dl --extract-audio --audio-format m4a --audio-quality 0 -i --output "%(title)s.%(ext)s" $url
|
||||
8
ytdlbve.ps1
Normal file
8
ytdlbve.ps1
Normal file
@@ -0,0 +1,8 @@
|
||||
$url = $args[0]
|
||||
|
||||
if ($url -eq $null)
|
||||
{
|
||||
$url = Read-Host -Prompt "Enter url"
|
||||
}
|
||||
|
||||
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' -i --merge-output-format mp4 --output "%(title)s.%(ext)s" $url
|
||||
Reference in New Issue
Block a user